Restore GDB backtrace on Linux#13261
Merged
Merged
Conversation
761f333 to
e3e9ba9
Compare
Contributor
|
The bug was introduced at #13079 (comment). Without the ability to run native debuggers in the testsuite, it is not possible to catch these bugs. Thankfully, this is being worked on: #13199 (comment). |
kayceesrk
approved these changes
Jun 26, 2024
e3e9ba9 to
09d02c2
Compare
09d02c2 to
8c0a776
Compare
ghost
approved these changes
Jun 26, 2024
ghost
left a comment
There was a problem hiding this comment.
I would have naively expected both versions of arm64.S to be equivalent (i.e. that it would be safe to do CFI_OFFSET after CFI_ADJUST, taking the adjustment offset into account). But then the new flavour is consistent with the use of CFI_ADJUST elsewhere in the file. (e.g. in ENTER_FUNCTION)
This was referenced Jul 1, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small correction to #13241 reported by @kayceesrk
Using the meander example from Retrofitting effect handlers onto OCaml https://dl.acm.org/doi/10.1145/3453483.3454039
Running a GDB session on Ubuntu 24.04/arm64:
$ cat meander.ml external ocaml_to_c : unit -> int = "ocaml_to_c" exception E1 exception E2 let c_to_ocaml () = raise E1 let _ = Callback.register "c_to_ocaml" c_to_ocaml let omain () = try (* h1 *) try (* h2 *) ocaml_to_c () with E2 -> 0 with E1 -> 42 let _ = assert (omain () = 42)%Compiled using
ocamlopt meander_c.c meander.ml -o meander.exeThe bracktrace is corrupted when jumping from the C Runtime into initial OCaml frames, and then again when executing the callback.
With this fix to CFI you get the following (correct) behaviour