Skip to content

Gradle 8.8 crashed on MacOS 11.x (8.7 still works as expected) #29476

Closed

Description

@hoc081098

Current Behavior

Run ./gradlew :sample:app:assembleDebug --stacktrace

GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
    JAVA_HOME: /Users/runner/hostedtoolcache/Java_Zulu_jdk/17.0.11-9/x[6](https://github.com/hoc081098/kmp-viewmodel/actions/runs/9393781511/job/25870394801#step:7:6)4
    JAVA_HOME_17_X64: /Users/runner/hostedtoolcache/Java_Zulu_jdk/1[7](https://github.com/hoc081098/kmp-viewmodel/actions/runs/9393781511/job/25870394801#step:7:7).0.11-9/x64
    GRADLE_ACTION_ID: gradle/actions/setup-gradle
    GRADLE_BUILD_ACTION_SETUP_COMPLETED: true
    GRADLE_BUILD_ACTION_CACHE_RESTORED: true
    DEVELOCITY_INJECTION_INIT_SCRIPT_NAME: gradle-actions.inject-develocity.init.gradle
    DEVELOCITY_AUTO_INJECTION_CUSTOM_VALUE: gradle-actions
    GITHUB_DEPENDENCY_GRAPH_ENABLED: false


To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.8/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build 
Configuration on demand is an incubating feature.
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=abe64d9a-d9a5-40b4-a5b8-45620bbdd052, currentDir=/Users/runner/work/kmp-viewmodel/kmp-viewmodel}
Attempting to read last messages from the daemon log...
Daemon pid: 2939
  log file: /Users/runner/.gradle/daemon/8.8/daemon-2939.out.log
----- Last  20 lines from daemon log file - daemon-2939.out.log -----
2024-06-06T01:44:47.402+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2024-06-06T01:44:47.404+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2024-06-06T01:44:47.405+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] resetting idle timer
2024-06-06T01:44:47.406+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
2024-06-06T01:44:47.406+0000 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building Build{id=abe64d9a-d9a5-40b4-a5b8-45620bbdd052, currentDir=/Users/runner/work/kmp-viewmodel/kmp-viewmodel}. Dispatching build started information...
2024-06-06T01:44:47.407+0000 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 21: dispatching org.gradle.launcher.daemon.protocol.BuildStarted@680450b8
2024-06-06T01:44:47.410+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: [PATH, GRADLE_BUILD_ACTION_SETUP_COMPLETED, GITHUB_REPOSITORY_OWNER, GITHUB_REPOSITORY_ID, CHROMEWEBDRIVER, GITHUB_RUN_NUMBER, ANDROID_HOME, NUNIT3_PATH, GITHUB_WORKSPACE, GITHUB_RETENTION_DAYS, GITHUB_API_URL, GITHUB_RUN_ATTEMPT, JAVA_MAIN_CLASS_2874, PWD, GITHUB_JOB, GITHUB_ACTIONS, STATS_V3PS, DOTNET_MULTILEVEL_LOOKUP, NVM_CD_FLAGS, STATS_RDCL, RUNNER_ENVIRONMENT, DEVELOCITY_AUTO_INJECTION_CUSTOM_VALUE, ANDROID_NDK, GITHUB_ENV, STATS_VMD, GITHUB_EVENT_PATH, XPC_FLAGS, STATS_D, LC_ALL, GITHUB_DEPENDENCY_GRAPH_ENABLED, GITHUB_ACTOR_ID, GITHUB_REF_TYPE, LC_CTYPE, SHLVL, RUNNER_TOOL_CACHE, GITHUB_SERVER_URL, JAVA_HOME, GITHUB_REF, RUNNER_NAME, BOOTSTRAP_HASKELL_NONINTERACTIVE, STATS_TRP, XCODE_13_DEVELOPER_DIR, NUNIT_BASE_PATH, XCODE_12_DEVELOPER_DIR, GITHUB_OUTPUT, JAVA_HOME_17_X64, GITHUB_REPOSITORY, GITHUB_STEP_SUMMARY, GITHUB_ACTION_REF, GOROOT_1_21_X64, RCT_NO_LAUNCH_PACKAGER, DEVELOCITY_INJECTION_INIT_SCRIPT_NAME, CI, RUNNER_ARCH, STATS_UE, GITHUB_SHA, ImageOS, ImageVersion, XCODE_11_DEVELOPER_DIR, STATS_VMFE, RUNNER_PERFLOG, PERFLOG_LOCATION_SETTING, RUNNER_TRACKING_ID, RUNNER_WORKSPACE, GRADLE_OPTS, GITHUB_REF_PROTECTED, EDGEWEBDRIVER, GITHUB_WORKFLOW, HOMEBREW_NO_INSTALL_CLEANUP, CONDA, GRADLE_BUILD_ACTION_CACHE_RESTORED, PIPX_HOME, GITHUB_BASE_REF, GITHUB_WORKFLOW_SHA, GITHUB_PATH, ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE, LOGNAME, GITHUB_EVENT_NAME, GITHUB_TRIGGERING_ACTOR, SHELL, AGENT_TOOLSDIRECTORY, HOMEBREW_CASK_OPTS, ANDROID_NDK_HOME, ANDROID_NDK_ROOT, VCPKG_INSTALLATION_ROOT, GITHUB_GRAPHQL_URL, GRADLE_ACTION_ID, JAVA_HOME_21_X64, TMPDIR, RUNNER_OS, DOTNET_ROOT, BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK, GITHUB_WORKFLOW_REF, GITHUB_ACTION, POWERSHELL_DISTRIBUTION_CHANNEL, __CF_USER_TEXT_ENCODING, GITHUB_ACTOR, GOROOT_1_19_X64, PIPX_BIN_DIR, VM_ASSETS, GECKOWEBDRIVER, JAVA_HOME_8_X64, LANG, GITHUB_REPOSITORY_OWNER_ID, STATS_D_D, STATS_EXTP, XPC_SERVICE_NAME, GITHUB_STATE, STATS_EXT, GITHUB_REF_NAME, NVM_DIR, ANDROID_NDK_LATEST_HOME, HOMEBREW_NO_AUTO_UPDATE, GITHUB_ACTION_REPOSITORY, GITHUB_RUN_ID, GOROOT_1_20_X64, USER, ANDROID_SDK_ROOT, SSH_AUTH_SOCK, RUNNER_TEMP, GITHUB_HEAD_REF, JAVA_HOME_11_X64, HOME]
2024-06-06T01:44:47.4[16](https://github.com/hoc081098/kmp-viewmodel/actions/runs/9393781511/job/25870394801#step:7:17)+0000 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 19: received class org.gradle.launcher.daemon.protocol.CloseInput
2024-06-06T01:44:47.4[17](https://github.com/hoc081098/kmp-viewmodel/actions/runs/9393781511/job/25870394801#step:7:18)+0000 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 19: Received IO message from client: org.gradle.launcher.daemon.protocol.CloseInput@437cdb27
2024-06-06T01:44:47.424+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.LogToClient] About to start relaying all logs to the client via the connection.
[20](https://github.com/hoc081098/kmp-viewmodel/actions/runs/9393781511/job/25870394801#step:7:21)24-06-06T01:44:47.425+0000 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 2939). The daemon log file: /Users/runner/.gradle/daemon/8.8/daemon-2939.out.log
2024-06-06T01:44:47.427+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon] Requesting daemon stop after processing Build{id=abe64d9a-d9a5-40b4-a5b8-45620bbdd052, currentDir=/Users/runner/work/kmp-viewmodel/kmp-viewmodel}
2024-06-06T01:44:47.428+0000 [DEBUG] [org.gradle.launcher.daemon.server.clientinput.ClientInputForwarder] Closing this process' stdin at end of input.
2024-06-06T01:44:47.428+0000 [LIFECYCLE] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Daemon will be stopped at the end of the build 
2024-06-06T01:44:47.428+0000 [DEBUG] [org.gradle.launcher.daemon.server.clientinput.ClientInputForwarder] This process will no longer process any forwarded input.
2024-06-06T01:44:47.429+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Stop as soon as idle requested. The daemon is busy: true
2024-06-06T01:44:47.431+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon stop has been requested. Sleeping until state changes.
2024-06-06T01:44:47.431+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build.
2024-06-06T01:44:47.432+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=23327f6e-7775-4474-ac82-769b506c9f8c,javaHome=/Users/runner/hostedtoolcache/Java_Zulu_jdk/17.0.11-9/x64,javaVersion=17,daemonRegistryDir=/Users/runner/.gradle/daemon,pid=2939,idleTimeout=120000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=--add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xmx4g,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
Configuration on demand is an incubating feature.
----- End of the daemon log -----

JVM crash log found: file:///Users/runner/work/kmp-viewmodel/kmp-viewmodel/hs_err_pid2939.log

FAILURE: Build failed with an exception.

* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.launcher.daemon.client.DaemonDisappearedException: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
	at org.gradle.launcher.daemon.client.DaemonClient.handleDaemonDisappearance(DaemonClient.java:284)
	at org.gradle.launcher.daemon.client.DaemonClient.monitorBuild(DaemonClient.java:257)
	at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:[21](https://github.com/hoc081098/kmp-viewmodel/actions/runs/9393781511/job/25870394801#step:7:22)2)
	at org.gradle.launcher.daemon.client.SingleUseDaemonClient.execute(SingleUseDaemonClient.java:65)
	at org.gradle.launcher.daemon.client.SingleUseDaemonClient.execute(SingleUseDaemonClient.java:38)
	at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:57)
	at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:167)
	at org.gradle.launcher.cli.DefaultCommandLineActionFactory$ParseAndBuildAction.execute(DefaultCommandLineActionFactory.java:261)
	at org.gradle.launcher.cli.DefaultCommandLineActionFactory$ParseAndBuildAction.execute(DefaultCommandLineActionFactory.java:[23](https://github.com/hoc081098/kmp-viewmodel/actions/runs/9393781511/job/25870394801#step:7:24)2)
	at org.gradle.launcher.cli.DebugLoggerWarningAction.execute(DebugLoggerWarningAction.java:74)
	at org.gradle.launcher.cli.DebugLoggerWarningAction.execute(DebugLoggerWarningAction.java:30)
	at org.gradle.launcher.cli.WelcomeMessageAction.execute(WelcomeMessageAction.java:96)
	at org.gradle.launcher.cli.WelcomeMessageAction.execute(WelcomeMessageAction.java:40)
	at org.gradle.launcher.cli.NativeServicesInitializingAction.execute(NativeServicesInitializingAction.java:55)
	at org.gradle.launcher.cli.NativeServicesInitializingAction.execute(NativeServicesInitializingAction.java:29)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:41)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:[26](https://github.com/hoc081098/kmp-viewmodel/actions/runs/9393781511/job/25870394801#step:7:27))
	at org.gradle.launcher.cli.DefaultCommandLineActionFactory$WithLogging.execute(DefaultCommandLineActionFactory.java:365)
	at org.gradle.launcher.Main.doAction(Main.java:35)
	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:51)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:34)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.gradle.wrapper.GradleWrapperMain.main(SourceFile:70)

Error: Process completed with exit code 1.

Expected Behavior

Don't crash.
Version 8.7 still works as expected.

Context (optional)

Steps to Reproduce

Gradle version

8.8

Build scan URL (optional)

No response

Your Environment (optional)

GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
    JAVA_HOME: /Users/runner/hostedtoolcache/Java_Zulu_jdk/17.0.11-9/x[6](https://github.com/hoc081098/kmp-viewmodel/actions/runs/9393781511/job/25870394801#step:7:6)4
    JAVA_HOME_17_X64: /Users/runner/hostedtoolcache/Java_Zulu_jdk/1[7](https://github.com/hoc081098/kmp-viewmodel/actions/runs/9393781511/job/25870394801#step:7:7).0.11-9/x64
    GRADLE_ACTION_ID: gradle/actions/setup-gradle
    GRADLE_BUILD_ACTION_SETUP_COMPLETED: true
    GRADLE_BUILD_ACTION_CACHE_RESTORED: true
    DEVELOCITY_INJECTION_INIT_SCRIPT_NAME: gradle-actions.inject-develocity.init.gradle
    DEVELOCITY_AUTO_INJECTION_CUSTOM_VALUE: gradle-actions
    GITHUB_DEPENDENCY_GRAPH_ENABLED: false

Activity

  1. lWoHvYe commented on Jun 9, 2024

    @lWoHvYe

    I face the same issue in my local (MacOS 11.7, Gradle 8.8)

  2. hoc081098 commented on Jun 9, 2024

    @hoc081098
    Author
  3. ljacomet commented on Jun 10, 2024

    @ljacomet
    Member

    This issue needs a decision from the team responsible for that area. They have been informed. Response time may vary.


    This might be tied to #28259

    @hoc081098 Can you share a JVM crash log when this happens?

  4. lptr commented on Jun 11, 2024

    @lptr
    Contributor

    Relevant logs from #29482:

    ---------------  S U M M A R Y ------------
    
    Command Line: --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=IL -Duser.language=en -Duser.variant -javaagent:/Users/jenkins/.gradle/wrapper/dists/gradle-8.8-bin/dl7vupf4psengwqhwktix4v1/gradle-8.8/lib/agents/gradle-instrumentation-agent-8.8.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.8
    
    Host: "Macmini6,2" x86_64 2300 MHz, 8 cores, 8G, Darwin 19.6.0, macOS 10.15.7 (19H2026)
    Time: Mon Jun 10 15:58:33 2024 IDT elapsed time: 40.560627 seconds (0d 0h 0m 40s)
    
    ---------------  T H R E A D  ---------------
    
    Current thread is native thread
    
    Stack: [0x0000700001aea000,0x0000700001b6a000],  sp=0x0000700001b67298,  free space=500k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C  [libnative-platform-file-events.dylib+0x0]  __dso_handle+0x0
    C  [libnative-platform-file-events.dylib+0x15c27]  void std::__1::__variant_detail::__ctor<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill> >::__generic_construct[abi:v160006]<std::__1::__variant_detail::__copy_constructor<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill>, (std::__1::__variant_detail::_Trait)1> const&>(std::__1::__variant_detail::__ctor<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill> >&, std::__1::__variant_detail::__copy_constructor<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill>, (std::__1::__variant_detail::_Trait)1> const&)+0x47
    C  [libnative-platform-file-events.dylib+0x15b8a]  std::__1::__variant_detail::__copy_constructor<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill>, (std::__1::__variant_detail::_Trait)1>::__copy_constructor(std::__1::__variant_detail::__copy_constructor<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill>, (std::__1::__variant_detail::_Trait)1> const&)+0x2a
    C  [libnative-platform-file-events.dylib+0x15b4d]  std::__1::__variant_detail::__assignment<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill> >::__assignment(std::__1::__variant_detail::__assignment<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill> > const&)+0x1d
    C  [libnative-platform-file-events.dylib+0x15b1d]  std::__1::__variant_detail::__move_assignment<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill>, (std::__1::__variant_detail::_Trait)1>::__move_assignment(std::__1::__variant_detail::__move_assignment<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill>, (std::__1::__variant_detail::_Trait)1> const&)+0x1d
    C  [libnative-platform-file-events.dylib+0x15aed]  std::__1::__variant_detail::__copy_assignment<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill>, (std::__1::__variant_detail::_Trait)1>::__copy_assignment(std::__1::__variant_detail::__copy_assignment<std::__1::__variant_detail::__traits<FileEvent, ErrorEvent, PoisonPill>, (std::__1::__variant_detail::_Trait)1> const&)+0x1d
    C  [libnative-platform-file-events.dylib+0x15abd]  std::__1::__variant_detail::__impl<FileEvent, ErrorEvent, PoisonPill>::__impl(std::__1::__variant_detail::__impl<FileEvent, ErrorEvent, PoisonPill> const&)+0x1d
    C  [libnative-platform-file-events.dylib+0x15a8d]  std::__1::__variant_detail::__impl<FileEvent, ErrorEvent, PoisonPill>::__impl(std::__1::__variant_detail::__impl<FileEvent, ErrorEvent, PoisonPill> const&)+0x1d
    C  [libnative-platform-file-events.dylib+0x15a5d]  std::__1::variant<FileEvent, ErrorEvent, PoisonPill>::variant(std::__1::variant<FileEvent, ErrorEvent, PoisonPill> const&)+0x1d
    C  [libnative-platform-file-events.dylib+0x15a2d]  std::__1::variant<FileEvent, ErrorEvent, PoisonPill>::variant(std::__1::variant<FileEvent, ErrorEvent, PoisonPill> const&)+0x1d
    C  [libnative-platform-file-events.dylib+0x15a01]  void std::__1::allocator<std::__1::variant<FileEvent, ErrorEvent, PoisonPill> >::construct[abi:v160006]<std::__1::variant<FileEvent, ErrorEvent, PoisonPill>, std::__1::variant<FileEvent, ErrorEvent, PoisonPill> const&>(std::__1::variant<FileEvent, ErrorEvent, PoisonPill>*, std::__1::variant<FileEvent, ErrorEvent, PoisonPill> const&)+0x21
    C  [libnative-platform-file-events.dylib+0x13805]  void std::__1::allocator_traits<std::__1::allocator<std::__1::variant<FileEvent, ErrorEvent, PoisonPill> > >::construct[abi:v160006]<std::__1::variant<FileEvent, ErrorEvent, PoisonPill>, std::__1::variant<FileEvent, ErrorEvent, PoisonPill> const&, void>(std::__1::allocator<std::__1::variant<FileEvent, ErrorEvent, PoisonPill> >&, std::__1::variant<FileEvent, ErrorEvent, PoisonPill>*, std::__1::variant<FileEvent, ErrorEvent, PoisonPill> const&)+0x25
    C  [libnative-platform-file-events.dylib+0x133ef]  std::__1::deque<std::__1::variant<FileEvent, ErrorEvent, PoisonPill>, std::__1::allocator<std::__1::variant<FileEvent, ErrorEvent, PoisonPill> > >::push_back(std::__1::variant<FileEvent, ErrorEvent, PoisonPill> const&)+0x6f
    C  [libnative-platform-file-events.dylib+0x1336d]  std::__1::queue<std::__1::variant<FileEvent, ErrorEvent, PoisonPill>, std::__1::deque<std::__1::variant<FileEvent, ErrorEvent, PoisonPill>, std::__1::allocator<std::__1::variant<FileEvent, ErrorEvent, PoisonPill> > > >::push[abi:v160006](std::__1::variant<FileEvent, ErrorEvent, PoisonPill> const&)+0x1d
    C  [libnative-platform-file-events.dylib+0xd9d2]  BlockingQueue<std::__1::variant<FileEvent, ErrorEvent, PoisonPill> >::enqueue(std::__1::variant<FileEvent, ErrorEvent, PoisonPill> const&)+0x32
    C  [libnative-platform-file-events.dylib+0xd809]  Server::handleEvents(unsigned long, char**, unsigned int const*, unsigned long long const*)+0xb9
    C  [libnative-platform-file-events.dylib+0xd441]  handleEventsCallback(__FSEventStream const*, void*, unsigned long, void*, unsigned int const*, unsigned long long const*)+0x41
    C  [FSEvents+0x2993]  implementation_callback_rpc+0xb19
    C  [FSEvents+0x1dfe]  _Xcallback_rpc+0xe9
    C  [FSEvents+0x1cf7]  FSEventsD2F_server+0x37
    C  [FSEvents+0x1c61]  __create_d2f_port_source_block_invoke+0xe8
    C  [libdispatch.dylib+0x2658]  _dispatch_client_callout+0x8
    C  [libdispatch.dylib+0x4818]  _dispatch_continuation_pop+0x19e
    C  [libdispatch.dylib+0x144be]  _dispatch_source_invoke+0x824
    C  [libdispatch.dylib+0x7af6]  _dispatch_lane_serial_drain+0x107
    C  [libdispatch.dylib+0x85d6]  _dispatch_lane_invoke+0x16b
    C  [libdispatch.dylib+0x11c09]  _dispatch_workloop_worker_thread+0x254
    C  [libsystem_pthread.dylib+0x2a3d]  _pthread_wqthread+0x122
    C  [libsystem_pthread.dylib+0x1b77]  start_wqthread+0xf
    
  5. added this to the 8.9 RC1 milestone on Jun 11, 2024
  6. lptr commented on Jun 11, 2024

    @lptr
    Contributor

    If the two issues are the same problem, then we have a reproducer both on macOS 10.15.7 (#29482) and macOS 11.7.10 (this issue)

  7. added and removed
    a:bugThis doesn't work as expected
    on Jun 11, 2024
  8. lptr commented on Jun 11, 2024

    @lptr
    Contributor

    I tried reproducing the problem by assuming it's a null-pointer issue. I tried passing nullptr to the FileEvent constructor here:

    https://github.com/gradle/native-platform/blob/master/file-events/src/file-events/cpp/apple_fsnotifier.cpp#L105-L108

    And also to ErrorEvent here:

    https://github.com/gradle/native-platform/blob/master/file-events/src/file-events/cpp/apple_fsnotifier.cpp#L111

    I managed to crash the JVM, but this produced a somewhat different stack trace. So it's unlikely that such a nullptr issue is behind the problem:

    C  [libsystem_platform.dylib+0x1904]  _platform_strlen+0x4
    C  [libnative-platform-file-events.dylib+0x6038]  std::__1::char_traits<char>::length[abi:ue170006](char const*)+0x18
    C  [libnative-platform-file-events.dylib+0x6d54]  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_string[abi:ue170006]<0>(char const*)+0x38
    C  [libnative-platform-file-events.dylib+0x4900]  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_string[abi:ue170006]<0>(char const*)+0x24
    C  [libnative-platform-file-events.dylib+0xfe60]  Server::handleEvents(unsigned long, char**, unsigned int const*, unsigned long long const*)+0x38
    C  [libnative-platform-file-events.dylib+0xfad0]  handleEvent
    
  9. lptr commented on Jun 11, 2024

    @lptr
    Contributor

    I managed to reproduce on GitHub with a fork: https://github.com/lptr/kmp-viewmodel/actions/runs/9468537930

    Crash logs: https://github.com/lptr/kmp-viewmodel/actions/runs/9468537930/artifacts/1590291032

    It is an identical crash to #29482 with the same stacktrace, even though this happens on some machine under VMWare, while #29482 happens on a Mac mini.

  10. 2 remaining items

  11. lptr commented on Jun 11, 2024

    @lptr
    Contributor

    I couldn't reproduce on my M1 mac:

    $ sw_vers
    ProductName:		macOS
    ProductVersion:		14.5
    BuildVersion:		23F79
    $ system_profiler SPHardwareDataType
    Hardware:
    
        Hardware Overview:
    
          Model Name: MacBook Pro
          Model Identifier: MacBookPro18,2
          Model Number: Z14V001TCD/A
          Chip: Apple M1 Max

    I also could not reproduce using an Intel Mac mini:

    $ sw_vers
    ProductName:		macOS
    ProductVersion:		14.5
    BuildVersion:		23F79
    $ system_profiler SPHardwareDataType
    Hardware:
    
        Hardware Overview:
    
          Model Name: Mac mini
          Model Identifier: Macmini8,1
          Processor Name: 6-Core Intel Core i7
          Processor Speed: 3.2 GHz

    Also failed to reproduce with an M1 Mac mini running 13.5.1:

    $ sw_vers
    ProductName:		macOS
    ProductVersion:		13.5.1
    BuildVersion:		22G90
    $ system_profiler SPHardwareDataType
    Hardware:
    
        Hardware Overview:
    
          Model Name: Mac mini
          Model Identifier: Macmini9,1
          Model Number: Z12N00006D/A
          Chip: Apple M1
  12. lptr commented on Jun 11, 2024

    @lptr
    Contributor
  13. lptr commented on Jun 11, 2024

    @lptr
    Contributor

    With --no-watch-fs the build works fine even on macos-11: https://github.com/lptr/kmp-viewmodel/actions/runs/9469336253/job/26087758352

    So that is a workaround we can offer for Gradle 8.8. Another workaround of course is to upgrade to macOS 12+. Unless there's a need for a specific macOS version, it's probably a good idea to use macos-latest in GitHub workflows anyway.

    That said...

    It looks like there's some issue in macOS 10 and 11 with something the new file-system watching code we've introduced in #28259 relies on. It also seems that whatever the problem was has been fixed in macOS 12 and later. This might be something with the new GCD-based APIs for file-event subscriptions, or perhaps the issue is with the C++17 features we started using. 🤷 There certainly has been some back-and-forth with std::variant in macOS 10.13 IIRC...

    I see the following options going forward:

    1. Revert Use new macOS file-system event delivery in file-system watching #28259 and go back to the non-GCD watching.

      We've introduced the GCD/C++17 watching in Gradle 8.8 because in macOS 13 the previous method of setting up file event listeners was deprecated. Reverting it would risk that a future macOS version will remove the deprecated APIs. This is not really an option.

    2. Assuming the problem is with C++17 support, rewrite the code so we don't need to depend on C++17, but keep using the new GCD-based APIs for file watching.

      This would be a significant amount of work, and would make our code worse, so I'm not a fan. That said, theoretically this could serve as a long-term solution.

    3. Keep the code as is, but disable file-system watching automatically on macOS 11 and before.

      This would be relatively simple to implement. We already do something similar with Alpine Linux (see Detect musl libc on Linux and disable native services #28258). It would be quite hard to test this, though, as we don't currently have means to run tests on macOS 11. We could rely on GitHub Actions, but integrating that into our testing is non-trivial.

    4. Only document that macOS 11 and before do not support file-system watching, and ask users to run with --no-watch-fs manually.

    Given the fact that macOS 11 (not to mention 10) has already reached end-of-life, I would definitely not invest into 2). 1) is not really an option. It's kind of tempting to choose 4)...

    I can try to implement 3), but for the testing aspect it would still be a non-trivial change. OTOH, running tests on various macOS versions using GitHub sounds like a good feature to add. 🤔

    If we choose to implement the auto-disabling feature, we'll need to release 8.8.1 with it.

  14. removed
    👋 team-triageIssues that need to be triaged by a specific team
    on Jun 11, 2024
  15. self-assigned this
    on Jun 11, 2024
  16. lptr commented on Jun 11, 2024

    @lptr
    Contributor

    We could implement the auto-disabling in https://github.com/gradle/native-platform, and then we could use its build to run tests using GitHub. That might be easier to integrate than if we tried to do the same with the gradle/gradle build... 🤔

  17. lptr commented on Jun 12, 2024

    @lptr
    Contributor

    GitHub build for native-platform:

    Not sure when I'll have the time to finish this, but it runs now.

  18. lptr commented on Jun 12, 2024

    @lptr
    Contributor

    Looks like #29514 fixes the problem: https://github.com/lptr/kmp-viewmodel/actions/runs/9479024243/job/26116663434#step:7:34

    Disabling file system watching on macOS 11.7.10, as it is only supported for macOS 12+
    Using 3 worker leases.
    Configuration on demand is an incubating feature.
    Received JVM installation metadata from '/Users/runner/hostedtoolcache/Java_Zulu_jdk/21.0.3-9/x64': {JAVA_HOME=/Users/runner/hostedtoolcache/Java_Zulu_jdk/21.0.3-9/x64, JAVA_VERSION=21.0.3, JAVA_VENDOR=Azul Systems, Inc., RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=21.0.3+9-LTS, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=21.0.3+9-LTS, VM_VENDOR=Azul Systems, Inc., OS_ARCH=x86_64}
    Watching the file system is configured to be enabled if available
    File system watching is inactive
    
  19. lptr commented on Jun 14, 2024

    @lptr
    Contributor

    Fixed via #29514

  20. friederbluemle commented on Aug 31, 2024

    @friederbluemle
    Contributor

    @lptr Is there any chance you could release 8.8.1 with this fix, as you mentioned in one of your comments above? I'm not able to update from 8.8 to 8.9, it doesn't seem to be fully backwards compatible...

  21. ljacomet commented on Sep 2, 2024

    @ljacomet
    Member

    @friederbluemle We will not do patch releases for previous minors in the current major.

    Could you file an issue for the reason(s) that blocks your upgrade?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions