-
Notifications
You must be signed in to change notification settings - Fork 1.7k
VM Crash while running 'pub-get' on MacOS #29539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think the problem is that Mac's library called This library has a lazily initialized global state, which is created whenever There is no special handling of this state in the prefork routines. Post fork in a child The absence of special handling in the prefork makes the following race possible:
Because prefork does nothing to ensure that forking thread owns frame #0: 0x00007fffd18bdc87 libsystem_platform.dylib`_os_once_gate_corruption_abort + 23
frame #1: 0x00007fffd18bd99b libsystem_platform.dylib`_os_once_gate_wait_slow + 134
frame #2: 0x00007fffd18b9a92 libsystem_platform.dylib`_os_alloc_once + 40
frame #3: 0x00007fffd18b30ae libsystem_notify.dylib`_notify_fork_child + 215
frame #4: 0x00007fffd0104b21 libSystem.B.dylib`libSystem_atfork_child + 49
frame #5: 0x00007fffd16f1437 libsystem_c.dylib`fork + 47 As a workaround we could just force initialize I did an experiment to check when do we potentially initialize it - and it turns out that asking for local time initializes it:
|
I filed a bug to Apple: 31962059 |
Your suggested workaround is to call OS::LocalTIme in the mac version of OS::InitOnce ? |
@a-siva either that or call it right before forking. We tried this sort of workaround with @jakobr-google and it seems that it fixed the problem. |
I wrote and submitted the following reproduction to Apple: https://gist.github.com/mraleph/e45db4d7a56bf65c3fe33e666bc31928 |
Eagerly initialize libnotify by accessing the current date. See dart-lang/sdk#29539 for details. Fixes flutter#9727.
Eagerly initialize libnotify by accessing the current date. See dart-lang/sdk#29539 for details. Fixes #9727.
Flutter noticed sporadic crashes of
pub get
-- see flutter/flutter#9727. Thepub get
process seems to exit with exitcode-4
which translates to illegal instruction.@jakobr-google Has reproduced it on his machine by running it in a loop and we have the dart-sdk and a corresponding coredump at (release mode):
The Dart SDK version is 1.23.0-dev.11.11 .
It seems to crash during a
fork()
inside the MacOS libc/platform library.@jakobr-google Will try to reproduce it again with bleeding edge, to see if the underlying issue might have already been fixed.
/cc @zanderso @a-siva @mraleph
The text was updated successfully, but these errors were encountered: