Commit 1982303
committed
merge revision(s) 954b7ac: [Backport #19789]
addr2line.c: fix `DW_FORM_ref_addr` parsing for DWARF 2 (ruby#8146)
addr2line.c: fix DW_FORM_ref_addr parsing for DWARF 2
This fixes a crash when retrieving backtrace info with YJIT enabled on
macOS with Rust 1.71.0. Since Rust 1.71.0, the DWARF info generated by
the Rust compiler uses DW_FORM_ref_addr instead of DW_FORM_ref4 for
pointers to other DIEs.
DW_FORM_ref_addr representation in DWARF 2 is different from DWARF 3+,
so we need to handle it separately.
This patch fixes the parsing of DW_FORM_ref_addr for DWARF 2, which is
the default DWARF version Rustc uses on macOS.
See the DWARF 2.0.0 spec, section 7.5.4 Attribute Encodings
https://dwarfstd.org/doc/dwarf-2.0.0.pdf
https://bugs.ruby-lang.org/issues/19789
---
addr2line.c | 40 ++++++++++++++++++++++++++--------------
1 file changed, 26 insertions(+), 14 deletions(-)1 parent 1c76244 commit 1982303
2 files changed
+27
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1144 | 1144 | | |
1145 | 1145 | | |
1146 | 1146 | | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
1147 | 1160 | | |
1148 | 1161 | | |
1149 | 1162 | | |
1150 | 1163 | | |
1151 | 1164 | | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
| 1165 | + | |
1160 | 1166 | | |
1161 | 1167 | | |
1162 | 1168 | | |
| |||
1208 | 1214 | | |
1209 | 1215 | | |
1210 | 1216 | | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
1215 | 1221 | | |
1216 | | - | |
1217 | | - | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
1218 | 1230 | | |
1219 | 1231 | | |
1220 | 1232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments