# Gradle 7 file watching in Alpine Docker container leads to JVM crash SIGSEGV

## What's going on

Running Gradle 7 inside an Alpine Docker container (e.g. python:3-alpine) crashes the JVM with a SIGSEGV in libnative-platform-file-events.so when file watching is enabled. The crash happens during task execution right after the automatic Gradle update. File watching was introduced in Gradle 7 and the crash is specific to Alpine Linux containers, which use musl libc.

## The verified fix

This was a Gradle bug in the native file-watching integration on Alpine (musl). It was fixed by PR #17055, which shipped in Gradle 7.0.1, upgrade to 7.0.1 or later to resolve the crash. If you are stuck on 7.0.0, you can work around it by disabling file watching with the --no-watch-fs flag or org.gradle.vfs.watch=false in gradle.properties until you can upgrade.

Source: https://github.com/gradle/gradle/issues/16787

## How to use this

Take the question above and check if it matches what you're seeing. If it does, work through the verified fix step by step. Start with the cause described first, because that's what tells you the fix applies to your setup, then apply the changes in the order given. Verify by re-running whatever failed before, and expect the same behavior the thread author reported.
