ruby: support EC offset extraction for statically-linked Ruby#28
Closed
dalehamel wants to merge 3 commits into
Closed
ruby: support EC offset extraction for statically-linked Ruby#28dalehamel wants to merge 3 commits into
dalehamel wants to merge 3 commits into
Conversation
Member
Author
Coredump Test PlanThis PR needs a coredump test for a statically-linked Ruby binary (no Test:
|
c3ca8b5 to
64117f2
Compare
For statically-linked Ruby binaries (bin/ruby rather than libruby.so), TLS descriptors are not available. Instead, rb_current_ec_noinline accesses the execution context directly via a TP-relative offset (FS:offset on x86_64, MRS tpidr_el0 + ADD on aarch64). This reuses the asm/amd.ExtractTLSOffset and asm/arm.ExtractTLSOffset infrastructure from the Python TLS PR (open-telemetry#1109) to disassemble rb_current_ec_noinline and extract the offset. Also changes current_ec_tpbase_tls_offset from u64 to s64 since static TLS offsets (local exec model) are negative on x86_64. Also adds RUBY_DISABLE_GC env var support to the loop.rb test script to allow capturing coredumps without GC interference.
cfb41a7 to
c881316
Compare
Adds coredump tests for a statically-linked Ruby 3.4.7 binary on both arm64 and amd64, exercising the binRubyRegex match and extractEcTLSOffset() disassembly path for finding ruby_current_ec via direct TP-relative offset. Captured via gdb attach + breakpoint on rb_vm_exec to ensure a clean snapshot deep in the Ruby VM stack.
c881316 to
a2ccaf1
Compare
Member
Author
|
merged upstream 🎉 |
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.
superseded by open-telemetry#1227