Memtrace catches exceptions without necessarily re-raising them, and places itself in an invalid state when this happens (see https://github.com/janestreet/memtrace/blob/master/src/memprof_tracer.ml). But some programs around rely on exceptions arising from signals handlers (e.g. for sigint or sigalrm) or finalisers (e.g. Gc.alarms), which do not denote a failure of memtrace but should always be re-raised by the memprof callbacks.
The most straightforward solution is to delay the possibly-raising callbacks inside the memprof callbacks with a solution such as proposed here: ocaml/ocaml#8961. I record this issue as a reminder for when such a solution is available.
Memtrace catches exceptions without necessarily re-raising them, and places itself in an invalid state when this happens (see https://github.com/janestreet/memtrace/blob/master/src/memprof_tracer.ml). But some programs around rely on exceptions arising from signals handlers (e.g. for sigint or sigalrm) or finalisers (e.g. Gc.alarms), which do not denote a failure of memtrace but should always be re-raised by the memprof callbacks.
The most straightforward solution is to delay the possibly-raising callbacks inside the memprof callbacks with a solution such as proposed here: ocaml/ocaml#8961. I record this issue as a reminder for when such a solution is available.