The dwarf reader sometimes produces lines with overlapping address ranges
mstange opened this issue · 1 comments
mstange commented
I noticed this in mozilla/dump_syms#466 .
The two consumers of symbolic_debuginfo::Function
, namely dump_syms and symcache_writer, have a few requirements about the shape of the information which are not expressed at the type level.
And the dwarf reader currently sometimes doesn't fulfill those requirements in the debuginfo it creates.
I'm going to look into writing some validation code so that this type of issue becomes easier to debug.
mstange commented
The validation has landed (in #716), so you can now see this bug for yourself:
% cargo run --release -p debuginfo_debug -- symbolic-testutils/fixtures/macos/crash.dSYM/Contents/Resources/DWARF/crash > /dev/null
Compiling symbolic-debuginfo v10.1.5 (/Users/mstange/code/symbolic/symbolic-debuginfo)
Compiling symbolic v10.1.5 (/Users/mstange/code/symbolic/symbolic)
Compiling debuginfo_debug v10.1.2 (/Users/mstange/code/symbolic/examples/debuginfo_debug)
Finished release [optimized + debuginfo] target(s) in 29.83s
Running `target/release/debuginfo_debug symbolic-testutils/fixtures/macos/crash.dSYM/Contents/Resources/DWARF/crash`
WARNING: Overlapping line at 0x3517 in function _ZNSt3__16__sortIRNS_6__lessIN15google_breakpad15DynamicImageRefES3_EEPS3_EEvT0_S7_T_: Starts before the end of the previous line (0x3508..0x3520)
WARNING: Overlapping line at 0x35a8 in function _ZNSt3__16__sortIRNS_6__lessIN15google_breakpad15DynamicImageRefES3_EEPS3_EEvT0_S7_T_: Starts before the end of the previous line (0x359a..0x35b0)
WARNING: Overlapping line at 0x3641 in function _ZNSt3__16__sortIRNS_6__lessIN15google_breakpad15DynamicImageRefES3_EEPS3_EEvT0_S7_T_: Starts before the end of the previous line (0x363d..0x3650)
WARNING: Overlapping line at 0x36fc in function _ZNSt3__16__sortIRNS_6__lessIN15google_breakpad15DynamicImageRefES3_EEPS3_EEvT0_S7_T_: Starts before the end of the previous line (0x36f7..0x3700)
WARNING: Overlapping line at 0x3719 in function _ZNSt3__16__sortIRNS_6__lessIN15google_breakpad15DynamicImageRefES3_EEPS3_EEvT0_S7_T_: Starts before the end of the previous line (0x3712..0x3720)
WARNING: Overlapping line at 0x373e in function _ZNSt3__16__sortIRNS_6__lessIN15google_breakpad15DynamicImageRefES3_EEPS3_EEvT0_S7_T_: Starts before the end of the previous line (0x3737..0x3740)
WARNING: Overlapping line at 0x3752 in function _ZNSt3__16__sortIRNS_6__lessIN15google_breakpad15DynamicImageRefES3_EEPS3_EEvT0_S7_T_: Starts before the end of the previous line (0x374e..0x3760)
WARNING: Overlapping line at 0x3581 in function _ZNKSt3__16__lessIN15google_breakpad15DynamicImageRefES2_EclERKS2_S5_: Starts before the end of the previous line (0x357a..0x3590)
WARNING: Overlapping line at 0x38a6 in function _ZNSt3__118__insertion_sort_3IRNS_6__lessIN15google_breakpad15DynamicImageRefES3_EEPS3_EEvT0_S7_T_: Starts before the end of the previous line (0x389a..0x38b0)
WARNING: Overlapping line at 0x3da2 in function _ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIN15google_breakpad15DynamicImageRefES3_EEPS3_EEbT0_S7_T_: Starts before the end of the previous line (0x3d8e..0x3db0)
WARNING: Overlapping line at 0x2347 in function _ZN15google_breakpad13ReadImageInfoINS_7MachO64EEEvRNS_13DynamicImagesEy: Starts before the end of the previous line (0x2344..0x2350)
WARNING: Overlapping line at 0x241f in function _ZN15google_breakpad13ReadImageInfoINS_7MachO64EEEvRNS_13DynamicImagesEy: Starts before the end of the previous line (0x23ff..0x2420)
WARNING: Overlapping line at 0x261a in function _ZN15google_breakpad13ReadImageInfoINS_7MachO64EEEvRNS_13DynamicImagesEy: Starts before the end of the previous line (0x2610..0x2620)
WARNING: Overlapping line at 0x2375 in function _ZNSt3__116allocator_traitsINS_9allocatorIN15google_breakpad15DynamicImageRefEEEE20__construct_backwardIPS3_EEvRS4_T_S9_RS9_: Starts before the end of the previous line (0x236f..0x2380)
WARNING: Overlapping line at 0x267f in function _ZNSt3__113adjacent_findINS_11__wrap_iterIPN15google_breakpad15DynamicImageRefEEERNS_10__equal_toIS3_S3_EEEET_S9_S9_T0_: Starts before the end of the previous line (0x267b..0x2680)
WARNING: Overlapping line at 0x291b in function _ZN15google_breakpad13ReadImageInfoINS_7MachO32EEEvRNS_13DynamicImagesEy: Starts before the end of the previous line (0x2918..0x2920)
WARNING: Overlapping line at 0x29ef in function _ZN15google_breakpad13ReadImageInfoINS_7MachO32EEEvRNS_13DynamicImagesEy: Starts before the end of the previous line (0x29cf..0x29f0)
WARNING: Overlapping line at 0x2bea in function _ZN15google_breakpad13ReadImageInfoINS_7MachO32EEEvRNS_13DynamicImagesEy: Starts before the end of the previous line (0x2be0..0x2bf0)
WARNING: Overlapping line at 0x2945 in function _ZNSt3__116allocator_traitsINS_9allocatorIN15google_breakpad15DynamicImageRefEEEE20__construct_backwardIPS3_EEvRS4_T_S9_RS9_: Starts before the end of the previous line (0x293f..0x2950)
WARNING: Overlapping line at 0x2c4f in function _ZNSt3__113adjacent_findINS_11__wrap_iterIPN15google_breakpad15DynamicImageRefEEERNS_10__equal_toIS3_S3_EEEET_S9_S9_T0_: Starts before the end of the previous line (0x2c4b..0x2c50)
WARNING: Overlapping line at 0x1e4c in function _ZN15google_breakpad12DynamicImage29CalculateMemoryAndVersionInfoEv: Starts before the end of the previous line (0x1e49..0x1e50)
WARNING: Overlapping line at 0x1f02 in function _ZN15google_breakpad12DynamicImage29CalculateMemoryAndVersionInfoEv: Starts before the end of the previous line (0x1eff..0x1f10)
WARNING: Overlapping line at 0x2dcb in function _ZN15google_breakpad13DynamicImages18GetExecutableImageEv: Starts before the end of the previous line (0x2dc9..0x2dd0)
WARNING: Overlapping line at 0x2e1d in function _ZN15google_breakpad13DynamicImages23GetExecutableImageIndexEv: Starts before the end of the previous line (0x2e14..0x2e20)
WARNING: Overlapping line at 0x2ecb in function _ZNSt3__16vectorIhNS_9allocatorIhEEE18__construct_at_endEm: Starts before the end of the previous line (0x2ebb..0x2ed0)
WARNING: Overlapping line at 0x2f6e in function _ZNSt3__114__split_bufferIhRNS_9allocatorIhEEE18__construct_at_endEm: Starts before the end of the previous line (0x2f5b..0x2f70)
WARNING: Overlapping line at 0x2f89 in function _ZNSt3__114__split_bufferIhRNS_9allocatorIhEEE18__construct_at_endEm: Starts before the end of the previous line (0x2f83..0x2f90)
WARNING: Overlapping line at 0x33c6 in function _ZNSt3__116allocator_traitsINS_9allocatorIN15google_breakpad15DynamicImageRefEEEE20__construct_backwardIPS3_EEvRS4_T_S9_RS9_: Starts before the end of the previous line (0x33b2..0x33d0)
WARNING: Overlapping line at 0x33eb in function _ZNSt3__116allocator_traitsINS_9allocatorIN15google_breakpad15DynamicImageRefEEEE20__construct_backwardIPS3_EEvRS4_T_S9_RS9_: Starts before the end of the previous line (0x33e5..0x33f0)
WARNING: Overlapping line at 0x4e5d in function _ZN15google_breakpad16ExceptionHandler14WaitForMessageEPv: Starts before the end of the previous line (0x4e5b..0x4e60)
WARNING: Overlapping line at 0x4f2a in function _ZN15google_breakpad16ExceptionHandler14WaitForMessageEPv: Starts before the end of the previous line (0x4f28..0x4f30)
WARNING: Overlapping line at 0x4fcc in function _ZN15google_breakpad16ExceptionHandler14WaitForMessageEPv: Starts before the end of the previous line (0x4fca..0x4fd0)
WARNING: Overlapping line at 0x5583 in function _ZNSt3__116allocator_traitsIN15google_breakpad16PageStdAllocatorI18MDMemoryDescriptorEEE20__construct_backwardIPS3_EEvRS4_T_S9_RS9_: Starts before the end of the previous line (0x5568..0x5590)
WARNING: Overlapping line at 0x55c3 in function _ZNSt3__116allocator_traitsIN15google_breakpad16PageStdAllocatorI18MDMemoryDescriptorEEE20__construct_backwardIPS3_EEvRS4_T_S9_RS9_: Starts before the end of the previous line (0x55b2..0x55d0)
WARNING: Overlapping line at 0x5b06 in function _ZNSt3__116allocator_traitsIN15google_breakpad16PageStdAllocatorI18MDMemoryDescriptorEEE20__construct_backwardIPS3_EEvRS4_T_S9_RS9_: Starts before the end of the previous line (0x5aeb..0x5b10)
WARNING: Overlapping line at 0x5b43 in function _ZNSt3__116allocator_traitsIN15google_breakpad16PageStdAllocatorI18MDMemoryDescriptorEEE20__construct_backwardIPS3_EEvRS4_T_S9_RS9_: Starts before the end of the previous line (0x5b32..0x5b50)
WARNING: Overlapping line at 0x667e in function _ZN15google_breakpad17MinidumpGenerator21WriteMemoryListStreamEP14MDRawDirectory: Starts before the end of the previous line (0x666d..0x6680)
WARNING: Overlapping line at 0x8521 in function _ZN15google_breakpad13DynamicImagesD2Ev: Starts before the end of the previous line (0x851a..0x8530)
WARNING: Overlapping line at 0x87df in function _ZNSt3__116allocator_traitsIN15google_breakpad16PageStdAllocatorI18MDMemoryDescriptorEEE20__construct_backwardIPS3_EEvRS4_T_S9_RS9_: Starts before the end of the previous line (0x87c2..0x87e0)
WARNING: Overlapping line at 0x8818 in function _ZNSt3__116allocator_traitsIN15google_breakpad16PageStdAllocatorI18MDMemoryDescriptorEEE20__construct_backwardIPS3_EEvRS4_T_S9_RS9_: Starts before the end of the previous line (0x8807..0x8820)
WARNING: Overlapping line at 0x9838 in function ConvertUTF8toUTF32: Starts before the end of the previous line (0x9817..0x9840)
WARNING: Overlapping line at 0xa6a3 in function _ZNSt3__16vectorItNS_9allocatorItEEE18__construct_at_endEmRKt: Starts before the end of the previous line (0xa69c..0xa6b0)
WARNING: Overlapping line at 0xa6d8 in function _ZNSt3__16vectorItNS_9allocatorItEEE18__construct_at_endEmRKt: Starts before the end of the previous line (0xa6c8..0xa6e0)
WARNING: Overlapping line at 0xa6f8 in function _ZNSt3__16vectorItNS_9allocatorItEEE18__construct_at_endEmRKt: Starts before the end of the previous line (0xa6f2..0xa700)
WARNING: Overlapping line at 0xa7f1 in function _ZNSt3__116allocator_traitsINS_9allocatorItEEE9constructItJtEEEvRS2_PT_DpOT0_: Starts before the end of the previous line (0xa7cd..0xa800)
WARNING: Overlapping line at 0xa819 in function _ZNSt3__116allocator_traitsINS_9allocatorItEEE9constructItJtEEEvRS2_PT_DpOT0_: Starts before the end of the previous line (0xa813..0xa820)
WARNING: Overlapping line at 0xa9a5 in function _ZNSt3__114__split_bufferItRNS_9allocatorItEEE18__construct_at_endEmRKt: Starts before the end of the previous line (0xa99d..0xa9b0)
WARNING: Overlapping line at 0xa9d8 in function _ZNSt3__114__split_bufferItRNS_9allocatorItEEE18__construct_at_endEmRKt: Starts before the end of the previous line (0xa9c8..0xa9e0)
WARNING: Overlapping line at 0xa9f8 in function _ZNSt3__114__split_bufferItRNS_9allocatorItEEE18__construct_at_endEmRKt: Starts before the end of the previous line (0xa9f2..0xaa00)
WARNING: Overlapping line at 0xab38 in function _ZNSt3__16vectorItNS_9allocatorItEEE12__move_rangeEPtS4_S4_: Starts before the end of the previous line (0xab17..0xab40)
WARNING: Overlapping line at 0xab81 in function _ZNSt3__16vectorItNS_9allocatorItEEE12__move_rangeEPtS4_S4_: Starts before the end of the previous line (0xab61..0xab90)
WARNING: Overlapping line at 0xbeaa in function _ZN16MacFileUtilities7MachoID8WalkerCBEPNS_11MachoWalkerEP12load_commandxbPv: Starts before the end of the previous line (0xbea5..0xbeb0)
WARNING: Overlapping line at 0xc035 in function _ZN16MacFileUtilities7MachoID8WalkerCBEPNS_11MachoWalkerEP12load_commandxbPv: Starts before the end of the previous line (0xc030..0xc040)
WARNING: Overlapping line at 0xc138 in function _ZN16MacFileUtilities7MachoID8WalkerCBEPNS_11MachoWalkerEP12load_commandxbPv: Starts before the end of the previous line (0xc133..0xc140)
WARNING: Overlapping line at 0xc247 in function _ZN16MacFileUtilities7MachoID8WalkerCBEPNS_11MachoWalkerEP12load_commandxbPv: Starts before the end of the previous line (0xc242..0xc250)
WARNING: Overlapping line at 0xcb76 in function _ZN16MacFileUtilities11MachoWalker10FindHeaderEiiRx: Starts before the end of the previous line (0xcb64..0xcb80)
WARNING: Overlapping line at 0xcfe1 in function _ZN16MacFileUtilities11MachoWalker14WalkHeaderCoreExjb: Starts before the end of the previous line (0xcfd9..0xcff0)
WARNING: Overlapping line at 0xd09e in function _ZN16MacFileUtilities11MachoWalker14WalkHeaderCoreExjb: Starts before the end of the previous line (0xd090..0xd0a0)
WARNING: Overlapping line at 0xd366 in function _ZNSt3__111char_traitsIcE4findEPKcmRS2_: Starts before the end of the previous line (0xd361..0xd370)
WARNING: Overlapping line at 0xd4e5 in function _ZNSt3__119__str_find_first_ofIcmNS_11char_traitsIcEELm18446744073709551615EEET0_PKT_S3_S6_S3_S3_: Starts before the end of the previous line (0xd4df..0xd4f0)
The patch in #717 fixes this.