summaryrefslogtreecommitdiff
path: root/testsuite/tests/backtrace/callstack.reference
Commit message (Collapse)AuthorAgeFilesLines
* Systhreads: add a domain_initialize hookFlorian Angeletti2022-10-051-1/+1
| | | | | Systhreads can use this hook to initialize the systhreads machinery before any OCaml code runs on the corresponding domain.
* Reimplement Thread.exit using the Thread.Exit exception (#10935)Xavier Leroy2022-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, Thread.exit tried to behave exactly like pthread_exit(): it stops the current thread immediately, but doesn't stop the whole program as long as other threads keep running. As discussed in #9071, this behavior is a problem for resource management ("finally" functions are not called). As discussed during the Multicore merge review and reported in #10927, this behavior is a problem in the presence of multiple domains. As first proposed in #9100, this PR reimplements Thread.exit by simply raising a dedicated Thread.Exit exception. This is good for resource management ("finally" functions are properly called) and simplifies the implementation tremendously. It does introduce incompatibilities with OCaml 4. In particular, if `Thread.exit` is called from the main program or from a domain but not from a thread started by `Thread.create`, the exception `Thread.Exit` is not automatically caught and will abort the program / the domain, unless explicitly handled by the program. Following the discussion at #10935, `Thread.exit` is marked as deprecated with the suggestion to use `raise Thread.Exit` instead, and we'll try to introduce `Thread.Exit` in 4.14 (without changing `Thread.exit` behavior) so that it is possible to write code that works both in 4.14 and in 5.00. Fixes: #9071 Closes: #9100 Fixes: #10927
* promote lib-threads and backtraceEnguerrand Decorne2021-12-071-1/+1
|
* Add set_uncaught_exception_handler to systhreads (#10469)Engil2021-08-091-1/+1
|
* Memprof: provide the guarantee that an allocation callback is always run in ↵Jacques-Henri Jourdan2020-10-191-1/+1
| | | | | | | | | | | | | the same thread the allocation takes place. This is done by using a local entry array for each thread, containing tracked blocks whose allocation callback has not yet been called. This allows some simplification in the code running callbacks for young allocations. Indeed, since the entry array is local to one thread, we know for sure that it cannot be modified during a callback, and therefore we no longer need to remember the indices of the corresponding new entries.
* ocamltest: do not compare binaries produced by ocamlopt.opt and ↵Nicolás Ojeda Bär2020-06-231-11/+11
| | | | ocamlopt.byte (#9677)
* Update testsuite with new backtrace format, and add test for namesStephen Dolan2020-04-271-12/+12
|
* Fix tests/backtrace/callstack.ml by changing the order of the content of ↵Jacques-Henri Jourdan2019-10-211-3/+4
| | | | | | | | that file. (#9063) The original test had a race condition between finalization and thread preemption. That was probably the cause for the wrong backtrace observed here: https://github.com/ocaml/ocaml/pull/8641#issuecomment-544231899
* Better stack backtraces for C calls in bytecode (#8641)Jacques-Henri Jourdan2019-10-121-0/+2
| | | | | | | | The previous mechanism worked for C calls that raise an exception, but not for C calls that call back into OCaml code which raises an exception. This commit addresses the issue by saving the PC in the interpreter stack before a C call, so that the backtrace mechanism always sees it. However, if an external is declared in the .ml file and exposed in the .mli file as a val, then ocamlc generates a wrapper that adds a spurious entry in the stack frame. In this PR, this change in behavior results in the re-declaration of Printexc.get_callstack as an external instead of a val, so that the spurious stack frame does not appear in call stacks obtained from Printexc.get_callstack.
* Update testsuite to work when libraries aren't builtDavid Allsopp2019-01-081-5/+5
|
* Make Printexc.get_callstack work in newly-created, native-code threads (#1895)sliquister2018-07-121-0/+12
The `top_of_stack` field of the `th` descriptor for the new thread was initialized too late, causing `caml_top_of_stack` to be NULL when the thread starts running. The fix is to initialize `th->top_of_stack` earlier.