-
Notifications
You must be signed in to change notification settings - Fork 410
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
fsevents segfaulting under M1 mac #6151
fsevents segfaulting under M1 mac #6151
Comments
Do you get the segfault if you call |
Yes, that makes the segfault go away. In the test, it's being done in a separate thread. Do you have an idea how to fix this? Move |
I managed to remove the segfault by moving |
That PR is #6215 |
Head up that I also encounter this segfault on an intel mac |
Ah, that's great. Can you try #6215? I'm not super familiar with these stubs but there's definitely something wrong with memory management in there. |
I tried #6215 and running the code from the top of the issues on an intel and m1 mac and I no longer get the seg fault (I do get |
Do you want to take over that PR and get it over the finish line? |
That would be appreciated. I can guide you but I don't have a mac handy at the moment so I can't easily work on it. |
Yeh sure |
I did some digging today into why the crash happens when the fsevents callback calls The c function This implies that we'd also see this crash if we ever started, stopped, and then re-started a @emillon's fix (#6215) solves the problem by removing the call to |
…, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info, dune-action-plugin and chrome-trace (3.7.1) CHANGES: - Fix segfault on MacOS when dune was being shutdown while in watch mode. (ocaml/dune#7312, fixes ocaml/dune#6151, @gridbugs, @emillon) - Fix preludes not being recorded as dependencies in the `(mdx)` stanza (ocaml/dune#7109, fixes ocaml/dune#7077, @emillon). - Pass correct flags when compiling `stdlib.ml`. (ocaml/dune#7241, @emillon) - Handle "Too many links" errors when using Dune cache on Windows. The fix in 3.7.0 for this same issue was not effective due to a typo. (ocaml/dune#7472, @nojb)
Hi,
I'm trying to make the test suite work on M1 macs.
At the moment, the inline tests for
fsevents
are triggering a segfault.I reduced that to the following piece of code:
Here's the crash location:
Here,
t->runloop
cannot be written to. I'm not too sure about what happens with memory management in the fsevent stubs. Printing the value oft->runloop
before and aftercaml_callback_exn
shows a different value. One thing I also noticed is that indune_fsevents_flush_sync
, we're releasing the runtime beforeFSEventStreamFlushSync
, but that function runs callbacks which can call out to ocaml code. Even if the runtime is re-acquired indune_fsevents_callback
, I'm not sure that's valid.Can you have a look @rgrinberg ? Thanks!
The text was updated successfully, but these errors were encountered: