-
Notifications
You must be signed in to change notification settings - Fork 40
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
On MacOS, lablgtk2 runs OCaml code inside a blocking section, causing a crash in caml_memprof_handle_postponed_exn #141
Comments
btj
added a commit
to btj/lablgtk
that referenced
this issue
Nov 13, 2021
I just realized that this bug could cause not just crashes, but data races as well, in multithreaded programs. (VeriFast is not multithreaded but there may be multithreaded lablgtk2 apps out there.) |
btj
changed the title
lablgtk2 on MacOS: crash in caml_memprof_handle_postponed_exn
On MacOS, lablgtk2 runs OCaml code inside a blocking section, causing a crash in caml_memprof_handle_postponed_exn
Nov 13, 2021
btj
added a commit
to verifast/vfdeps
that referenced
this issue
Nov 17, 2021
Attempt to fix garrigue/lablgtk#141
garrigue
pushed a commit
that referenced
this issue
Dec 3, 2021
garrigue
pushed a commit
that referenced
this issue
Dec 3, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since recently, I am seeing my VeriFast application (using lablgtk2) crash sometimes on MacOS in
caml_memprof_handle_postponed_exn
. See verifast/verifast#252 .The chain of events is as follows:
ml_poll
lablgtk/src/ml_glib.c
Line 303 in 1569736
caml_enter_blocking_section
and then calls the Gdk Quartz defaultpoll_func
https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gdk/quartz/gdkeventloop-quartz.c#L709nextEventMatchingMask
with theNSDefaultRunLoopMode
.So, while I believe lablgtk is not "to blame" for this bug, any help or advice would of course be appreciated.
One (hacky) solution would be to add code to
marshal
to check if we are in a blocking section and, if so, temporarily exit it. Would that make sense?I am curious as to why I am seeing these crashes only now. One recent change is that I recently switched from OCaml 4.6 to OCaml 4.13. Perhaps 4.13 is more sensitive to calling into OCaml while inside a blocking section?
The text was updated successfully, but these errors were encountered: