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
Provide Thread.set_uncaught_exception_handler #6813
Comments
Comment author: @diml I'm not sure uncaught exceptions inside threads should call the handler set via [Printexc.set_uncaught_exception_handler]: the doc says it is executed after [at_exit] handlers and doesn't require the callback to be thread-safe. On the other hand it's easy to add a [Thread.set_uncaught_exception_handler]. For multi-threaded programs the handler should probably print the thread id so it make sense to have two different functions. |
Comment author: @whitequark That would work, indeed. |
Comment author: @diml I had another look at this, it should be simpler than the global uncaught exception handler given that the exception is caught on the OCaml side. Do you think you could submit a PR for this? I can review it |
Comment author: @whitequark I don't have time for this. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Still an issue. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Still an issue. |
If we wait again for a few years to fix this issue, it will probably happen on the Multicore runtime. I wonder how uncaught exceptions are handled there; @kayceesrk, @Engil? |
@gasche On Multicore, uncaught exceptions in (sys)threads are handled in the same way. I think the proposal to add
As far as Multicore is concerned, this is different for the |
Thanks for the answer. Here is what I understand:
Would you by chance be interested in submitting a PR to implement this? |
Sure enough, I will give it a try in the next few days. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
There is still some planned work in OCaml 5 (after 5.0) to better handle uncaught exceptions on both threads and domains. |
There's an issue and discussion here #11074 |
Albeit deemed unsatisfactory, formally OCaml 5 provides that. I think this can be closed. #11074 has a larger discussion on trying to improve things. |
Thanks! |
Original bug ID: 6813
Reporter: @whitequark
Assigned to: @diml
Status: assigned (set by @diml on 2015-03-14T10:21:20Z)
Resolution: open
Priority: normal
Severity: feature
Target version: 4.07.0+dev/beta2/rc1/rc2
Category: otherlibs
Monitored by: @hcarty
Bug description
Original summary was: Uncaught exceptions inside threads don't trigger handler set via Printexc.set_uncaught_exception_handler
See summary.
The text was updated successfully, but these errors were encountered: