Commit fe74581
committed
feat: preserve
We've been seeing opaque errors where, at Domain.join time, an exception
is raised because that exception bubbled up to the top of the domain's
stack. Unfortunately, the backtrace that is printed is the parent's
backtrace, not the child's (that is, it starts at Domain.join and
bubbles down to the parent's entrypoint). What we want to see is what
happens inside the child, but it's lost by this point in time.
Thinking that this was owing to the implemention of Domain.join, which
catches and rethrows the exception but without capturing the raw
backtrace, I believed the correct fix to be in the OCaml runtime, and
put out ocaml#14358 . KC, however, pointed out that this isn't the
right fix because the child's stack is fundamentally not propagated
between domains. Mea culpa.
semgrep/semgrep-proprietary#5022 fixed this at the level of
`Concurrent.map`, but the ergonomics of that patch weren't great because
we redundantly re-enable backtraces for each iteration of the map.
I later modified the OCaml runtime itself to do this, which I merged
upstream at ocaml#14416 , after filing
ocaml#14411 . This patch is just
a backport of that PR (which was already reviewed by compiler folks.)backtrace_enabled between domains1 parent 7497113 commit fe74581
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
745 | | - | |
746 | | - | |
747 | | - | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
748 | 749 | | |
749 | 750 | | |
750 | 751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
0 commit comments