getsentry/symbolic

Unexpected setting of low_pc during constants::DW_AT_high_pc DebugAddrIndex processing

mstange opened this issue · 0 comments

I think DWARF 5 parsing is broken:

constants::DW_AT_high_pc => match attr.value() {
AttributeValue::Addr(addr) => high_pc = Some(addr),
AttributeValue::DebugAddrIndex(index) => {
low_pc = Some(self.inner.info.address(self.inner.unit, index)?)
}
AttributeValue::Udata(size) => high_pc_rel = Some(size),
_ => return Err(GimliError::UnsupportedAttributeForm.into()),
},

This code sets low_pc for DebugAddrIndex values of DW_AT_high_pc. That seems surprising, it should be setting high_pc instead. This is probably just a bug in #326.

Here's the corresponding code from the addr2line crate: https://github.com/gimli-rs/addr2line/blame/62e726615816b865e0998f8b1c6ebaf1645e8334/src/lib.rs#L427-L434

I think DebugAddrIndex is only used in DWARF 5, which is not in wide use yet, which is probably why this hasn't caused many problems yet.