Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
gdb issues?
Hi,
I have recently had a bear of a time getting the new rust which
landed in pkgsrc-wip the other day to build natively on several
of the targets we support for NetBSD.
The problem is that the "bootstrap" program (a rust executable)
lands on its nose with a SIGSEGV, and dumps core (without leaving
a discernible error message in the build log, so I had to ktrace
to find *that* out, argh!)
However, it appears that gdb has problems dealing with the
combination of the executable and the core file. I see similar
problems on the following platforms: NetBSD/macppc 10.0_BETA and
NetBSD/i386 9.3.
I'm beginning to wonder if it's my "gdb driving skills" which are
lacking, or whether it really works this poorly in other NetBSD
contexts as well...
The symptom looks like this on macppc 10.0_BETA:
: {18} gdb /usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/build/bootstrap/debug/bootstrap work/rustc-1.73.0-src/bootstrap.core
GNU gdb (GDB) 11.0.50.20200914-git
...
Reading symbols from /usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/build/bootstrap/debug/bootstrap...
[New process 19376]
warning: Error reading shared library list entry at 0x4b
warning: Error reading shared library list entry at 0x4b
Core was generated by `bootstrap'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0xfdc52444 in ?? ()
warning: Unsupported auto-load script at offset 0 in section .debug_gdb_scripts
of file /usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/build/bootstrap/debug/bootstrap.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) i reg
r0 0xbe2b18 12462872
r1 0xfffd4bf0 4294790128
r2 0xfdbbd008 4256944136
r3 0x0 0
r4 0x0 0
r5 0xfdedc1f8 4260217336
r6 0xfdedc1f8 4260217336
r7 0x0 0
r8 0x36 54
r9 0x0 0
r10 0x1 1
r11 0xfdc52408 4257555464
r12 0xfdef9400 4260336640
r13 0xf9fda0 16383392
r14 0xc37e74 12811892
r15 0x8 8
r16 0xc37f39 12812089
r17 0xc 12
r18 0xc37f45 12812101
r19 0xb 11
r20 0xc37f50 12812112
r21 0x5 5
r22 0xc37f55 12812117
r23 0x11 17
r24 0xc37f66 12812134
r25 0x0 0
r26 0x1 1
r27 0x0 0
r28 0xfdedc1f8 4260217336
r29 0xfffd4c80 4294790272
r30 0xfde6c584 4259759492
r31 0x4 4
pc 0xfdc52444 0xfdc52444
msr <unavailable>
cr 0x42000248 1107296840
lr 0xfdc52414 0xfdc52414
ctr 0xfdc52408 4257555464
xer 0x0 0
fpscr 0xfff80000 -524288
vscr <unavailable>
vrsave <unavailable>
(gdb) i target
Symbols from "/usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/build/bootstrap/debug/bootstrap".
Local core dump file:
`/usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/bootstrap.core',
file type elf32-powerpc.
0x00010000 - 0x00f29000 is load0
0x00f41000 - 0x00fa0000 is load1
0x00fa0000 - 0x00fa03c8 is load2a
0x00fa03c8 - 0x00fa1000 is load2b
0xfd600000 - 0xfd608128 is load3a
0xfd608128 - 0xfd610000 is load3b
0xfd610000 - 0xfd800000 is load4
0xfda18000 - 0xfda2c000 is load5
0xfda2c000 - 0xfda2d2dc is load6a
0xfda2d2dc - 0xfda4c000 is load6b
0xfda4c000 - 0xfda4d41c is load7a
0xfda4d41c - 0xfda58000 is load7b
0xfda58000 - 0xfda5834c is load8a
0xfda5834c - 0xfda74000 is load8b
0xfda74000 - 0xfda765c0 is load9a
0xfda765c0 - 0xfda88000 is load9b
0xfda88000 - 0xfda88384 is load10a
0xfda88384 - 0xfda8c000 is load10b
0xfda8c000 - 0xfda8cb7c is load11a
0xfda8cb7c - 0xfda98000 is load11b
0xfda98000 - 0xfda981b4 is load12a
0xfda981b4 - 0xfdab4000 is load12b
0xfdab4000 - 0xfdab52e0 is load13a
0xfdab52e0 - 0xfdac8000 is load13b
0xfdac8000 - 0xfdac85bc is load14a
0xfdac85bc - 0xfdad4000 is load14b
0xfdad4000 - 0xfdad414c is load15a
0xfdad414c - 0xfdaf0000 is load15b
0xfdaf0000 - 0xfdaf04c4 is load16a
0xfdaf04c4 - 0xfdaf4000 is load16b
0xfdaf4000 - 0xfdaf407c is load17a
0xfdaf407c - 0xfdaf8000 is load17b
0xfdaf8000 - 0xfdaf8278 is load18a
0xfdaf8278 - 0xfdafc000 is load18b
0xfdafc000 - 0xfdafc23c is load19a
0xfdafc23c - 0xfdb10000 is load19b
0xfdb10000 - 0xfdb10120 is load20a
0xfdb10120 - 0xfdb24000 is load20b
0xfdb24000 - 0xfdb240a0 is load21a
0xfdb240a0 - 0xfdb38000 is load21b
0xfdb38000 - 0xfdb3b170 is load22a
0xfdb3b170 - 0xfdb4c000 is load22b
0xfdb4c000 - 0xfdb4c7b0 is load23a
0xfdb4c7b0 - 0xfdb58000 is load23b
0xfdb58000 - 0xfdb580e4 is load24a
0xfdb580e4 - 0xfdb6c000 is load24b
0xfdb6c000 - 0xfdb6c17c is load25a
0xfdb6c17c - 0xfdb78000 is load25b
0xfdb78000 - 0xfdb78384 is load26a
0xfdb78384 - 0xfdb84000 is load26b
0xfdb85000 - 0xfdb86000 is load27
0xfdb86000 - 0xfdb8f000 is load28
0xfdb8f000 - 0xfdb8fcd4 is load29a
0xfdb8fcd4 - 0xfdb90000 is load29b
0xfdb90000 - 0xfdb90008 is load30a
0xfdb90008 - 0xfdba0000 is load30b
0xfdba0000 - 0xfdba44b0 is load31a
0xfdba44b0 - 0xfdbb4000 is load31b
0xfdbb5000 - 0xfdbb6b24 is load32a
0xfdbb6b24 - 0xfdbc0000 is load32b
0xfdbc0000 - 0xfdbf9000 is load33
0xfdbf9000 - 0xfdc09000 is load34
0xfdc09000 - 0xfdc0b3bc is load35a
0xfdc0b3bc - 0xfdc0c000 is load35b
0xfdc0c000 - 0xfdc0c4e0 is load36a
0xfdc0c4e0 - 0xfdc10000 is load36b
0xfdc10000 - 0xfde4d000 is load37
0xfde4d000 - 0xfde5c000 is load38
0xfde5c000 - 0xfde6cfe8 is load39a
0xfde6cfe8 - 0xfde6d000 is load39b
0xfde6d000 - 0xfde6d100 is load40a
0xfde6d100 - 0xfde70000 is load40b
0xfde70000 - 0xfde79a04 is load41a
0xfde79a04 - 0xfde7d000 is load41b
0xfde7d000 - 0xfde7da74 is load42a
0xfde7da74 - 0xfde87000 is load42b
0xfde87000 - 0xfde889a0 is load43a
0xfde889a0 - 0xfde89000 is load43b
0xfde8c000 - 0xfde8c238 is load44a
0xfde8c238 - 0xfde90000 is load44b
0xfde90000 - 0xfde9f000 is load45
0xfde9f000 - 0xfdeae000 is load46
0xfdeae000 - 0xfdeaeac8 is load47a
0xfdeaeac8 - 0xfdeaf000 is load47b
0xfdeb0000 - 0xfdec7000 is load48
0xfdec7000 - 0xfded7000 is load49
0xfded7000 - 0xfded7fc4 is load50a
0xfded7fc4 - 0xfded8000 is load50b
0xfded8000 - 0xfded8844 is load51a
0xfded8844 - 0xfded9000 is load51b
0xfdeda000 - 0xfdedad5c is load52a
0xfdedad5c - 0xfdedc000 is load52b
0xfdedc000 - 0xfdedc1f4 is load53a
0xfdedc1f4 - 0xfdee0000 is load53b
0xfdee0000 - 0xfdef5000 is load54
0xfdef5000 - 0xfdef5698 is load55a
0xfdef5698 - 0xfdef6000 is load55b
0xfdef6000 - 0xfdefdc00 is load56a
0xfdefdc00 - 0xfdefe000 is load56b
0xfdefe000 - 0xfdeff000 is load57
--Type <RET> for more, q to quit, c to continue without paging--
0xfdeff000 - 0xfdfff000 is load58
0xfdfff000 - 0xfe000000 is load59
0xfe000000 - 0xfffa0000 is load60
0xfffa0000 - 0xfffae000 is load61
0xfffae000 - 0xfffff000 is load62
While running this, GDB does not access memory from...
Local exec file:
`/usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/build/bootstrap/debug/bootstrap', file type elf32-powerpc.
Entry point: 0xa1f30
0x00000154 - 0x0000016b is .interp
0x0000016c - 0x00000184 is .note.netbsd.ident
0x00000184 - 0x00000198 is .note.netbsd.pax
0x00000198 - 0x00000624 is .hash
0x00000624 - 0x00001004 is .dynsym
0x00001004 - 0x00001826 is .dynstr
0x00001826 - 0x00001962 is .gnu.version
0x00001964 - 0x000019a4 is .gnu.version_r
0x000019a4 - 0x000a1808 is .rela.dyn
0x000a1808 - 0x000a1f04 is .rela.plt
0x000a1f04 - 0x000a1f24 is .init
0x000a1f30 - 0x00c22000 is .text
0x00c22000 - 0x00c22020 is .fini
0x00c22040 - 0x00cd0275 is .rodata
0x00cd0275 - 0x00cd0297 is .debug_gdb_scripts
0x00cd0298 - 0x00d371dc is .eh_frame_hdr
0x00d371dc - 0x00e951f4 is .eh_frame
0x00e951f4 - 0x00f18200 is .gcc_except_table
0x00f31964 - 0x00f3196c is .ctors
0x00f3196c - 0x00f31974 is .dtors
0x00f31974 - 0x00f31978 is .jcr
0x00f31978 - 0x00f7590c is .data.rel.ro
0x00f7590c - 0x00f8fca8 is .got2
0x00f8fca8 - 0x00f8fda0 is .dynamic
0x00f8fda0 - 0x00f8fdac is .got
0x00f8fdac - 0x00f90000 is .plt
0x00f90000 - 0x00f901e0 is .data
0x00f901e0 - 0x00f901f2 is .sdata
0x00f901f8 - 0x00f90204 is .sbss
0x00f90208 - 0x00f903c8 is .bss
(gdb) x/i 0xfdc52444
=> 0xfdc52444: Cannot access memory at address 0xfdc52444
(gdb)
As I read the "i target" output, the program counter should be
covered by this entry:
0xfdc10000 - 0xfde4d000 is load37
So why isn't that memory address accessible?!?
NetBSD/i386 9.3 isn't much better:
: {86} gdb /usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/build/bootstrap/debug/bootstrap work/rustc-1.73.0-src/bootstrap.core
GNU gdb (GDB) 8.3
...
Reading symbols from /usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/build/bootstrap/debug/bootstrap...
[New process 1]
warning: Error reading shared library list entry at 0xc00000e1
warning: Error reading shared library list entry at 0xc00000d1
Core was generated by `bootstrap'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0xbb508632 in ?? ()
warning: Unsupported auto-load script at offset 0 in section .debug_gdb_scripts
of file /usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/build/bootstrap/debug/bootstrap.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb)
(gdb) i reg
eax 0x0 0
ecx 0x0 0
edx 0x0 0
ebx 0xbb692000 -1150738432
esp 0xbf7d5490 0xbf7d5490
ebp 0x1 0x1
esi 0x0 0
edi 0xbb49d1e8 -1152790040
eip 0xbb508632 0xbb508632
eflags 0x10202 [ IF RF ]
cs 0x17 23
ss 0x1f 31
ds 0x1f 31
es 0x1f 31
fs 0xab 171
gs 0xb3 179
(gdb)
(gdb) i target
Symbols from "/usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/build/bootstrap/debug/bootstrap".
Local core dump file:
`/usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/bootstrap.core',
file type elf32-i386.
0x00001000 - 0x00001000 is load0
0x010c7000 - 0x010fe000 is load1
0x010fe000 - 0x010fe344 is load2a
0x010fe344 - 0x010fe344 is load2b
0xbb000000 - 0xbb0043fc is load3a
0xbb0043fc - 0xbb0043fc is load3b
0xbb006000 - 0xbb0080d8 is load4a
0xbb0080d8 - 0xbb0080d8 is load4b
0xbb00b000 - 0xbb00b258 is load5a
0xbb00b258 - 0xbb00b258 is load5b
0xbb010000 - 0xbb010000 is load6
0xbb3ef000 - 0xbb3ef000 is load7
0xbb403000 - 0xbb4042dc is load8a
0xbb4042dc - 0xbb4042dc is load8b
0xbb414000 - 0xbb41541c is load9a
0xbb41541c - 0xbb41541c is load9b
0xbb417000 - 0xbb41734c is load10a
0xbb41734c - 0xbb41734c is load10b
0xbb428000 - 0xbb42a5c0 is load11a
0xbb42a5c0 - 0xbb42a5c0 is load11b
0xbb42e000 - 0xbb42f1b4 is load12a
0xbb42f1b4 - 0xbb42f1b4 is load12b
0xbb43b000 - 0xbb43c2e0 is load13a
0xbb43c2e0 - 0xbb43c2e0 is load13b
0xbb440000 - 0xbb44014c is load14a
0xbb44014c - 0xbb44014c is load14b
0xbb447000 - 0xbb44a23c is load15a
0xbb44a23c - 0xbb44a23c is load15b
0xbb44f000 - 0xbb44f120 is load16a
0xbb44f120 - 0xbb44f120 is load16b
0xbb454000 - 0xbb4540a0 is load17a
0xbb4540a0 - 0xbb4540a0 is load17b
0xbb459000 - 0xbb45c170 is load18a
0xbb45c170 - 0xbb45c170 is load18b
0xbb45e000 - 0xbb45e7b0 is load19a
0xbb45e7b0 - 0xbb45e7b0 is load19b
0xbb461000 - 0xbb4610e4 is load20a
0xbb4610e4 - 0xbb4610e4 is load20b
0xbb466000 - 0xbb46617c is load21a
0xbb46617c - 0xbb46617c is load21b
0xbb469000 - 0xbb46a384 is load22a
0xbb46a384 - 0xbb46a384 is load22b
0xbb46d000 - 0xbb46d238 is load23a
0xbb46d238 - 0xbb46d238 is load23b
0xbb46e000 - 0xbb46e000 is load24
0xbb46f000 - 0xbb46f000 is load25
0xbb478000 - 0xbb478ff0 is load26a
0xbb478ff0 - 0xbb478ff0 is load26b
0xbb47f000 - 0xbb48077c is load27a
0xbb48077c - 0xbb48077c is load27b
0xbb485000 - 0xbb485bbc is load28a
0xbb485bbc - 0xbb485bbc is load28b
0xbb488000 - 0xbb4882fc is load29a
0xbb4882fc - 0xbb4882fc is load29b
0xbb48b000 - 0xbb48b004 is load30a
0xbb48b004 - 0xbb48b004 is load30b
0xbb49b000 - 0xbb49bfa0 is load31a
0xbb49bfa0 - 0xbb49bfa0 is load31b
0xbb49d000 - 0xbb4a0e30 is load32a
0xbb4a0e30 - 0xbb4a0e30 is load32b
0xbb4a5000 - 0xbb4a69bc is load33a
0xbb4a69bc - 0xbb4a69bc is load33b
0xbb4b0000 - 0xbb4b0000 is load34
0xbb4d9000 - 0xbb4da000 is load35
0xbb4da000 - 0xbb4da3e8 is load36a
0xbb4da3e8 - 0xbb4da3e8 is load36b
0xbb4db000 - 0xbb4db000 is load37
0xbb68b000 - 0xbb691ff0 is load38a
0xbb691ff0 - 0xbb691ff0 is load38b
0xbb692000 - 0xbb695fe4 is load39a
0xbb695fe4 - 0xbb695fe4 is load39b
0xbb696000 - 0xbb696000 is load40
0xbb698000 - 0xbb69a19c is load41a
0xbb69a19c - 0xbb69a19c is load41b
0xbb69d000 - 0xbb69dd6c is load42a
0xbb69dd6c - 0xbb69dd6c is load42b
0xbb6a4000 - 0xbb6ad144 is load43a
0xbb6ad144 - 0xbb6ad144 is load43b
0xbb6b1000 - 0xbb6b1408 is load44a
0xbb6b1408 - 0xbb6b1408 is load44b
0xbb6b2000 - 0xbb6b2000 is load45
0xbb6cc000 - 0xbb6cd000 is load46
0xbb6cd000 - 0xbb6cd2c0 is load47a
0xbb6cd2c0 - 0xbb6cd2c0 is load47b
0xbb6ce000 - 0xbb6ce000 is load48
0xbb6df000 - 0xbb6e0000 is load49
0xbb6e0000 - 0xbb6e0fc4 is load50a
0xbb6e0fc4 - 0xbb6e0fc4 is load50b
0xbb6e1000 - 0xbb6e9c00 is load51a
0xbb6e9c00 - 0xbb6e9c00 is load51b
0xbb6ea000 - 0xbb6ea000 is load52
0xbb6eb000 - 0xbb6eb000 is load53
0xbb6fd000 - 0xbb6fe000 is load54
0xbb6fe000 - 0xbb6fe598 is load55a
0xbb6fe598 - 0xbb6fe598 is load55b
0xbb6ff000 - 0xbb6ff000 is load56
0xbbfff000 - 0xbbfff000 is load57
0xbc000000 - 0xbc000000 is load58
0xbf7a0000 - 0xbf7a0000 is load59
0xbf7af000 - 0xbf7ff000 is load60
Local exec file:
`/usr/pkgsrc/wip/rust/work/rustc-1.73.0-src/build/bootstrap/debug/bootstrap', file type elf32-i386.
Entry point: 0x2d100
0x00000154 - 0x0000016b is .interp
0x0000016c - 0x00000184 is .note.netbsd.ident
--Type <RET> for more, q to quit, c to continue without paging--
0x00000184 - 0x00000198 is .note.netbsd.pax
0x00000198 - 0x000005fc is .hash
0x000005fc - 0x00000f3c is .dynsym
0x00000f3c - 0x000016f5 is .dynstr
0x000016f6 - 0x0000181e is .gnu.version
0x00001820 - 0x00001860 is .gnu.version_r
0x00001860 - 0x0002c400 is .rel.dyn
0x0002c400 - 0x0002c840 is .rel.plt
0x0002c840 - 0x0002c84a is .init
0x0002c850 - 0x0002d0e0 is .plt
0x0002d0e0 - 0x0002d100 is .plt.got
0x0002d100 - 0x00d48744 is .text
0x00d48750 - 0x00d4875a is .fini
0x00d48780 - 0x00ddbfcb is .rodata
0x00ddbfcb - 0x00ddbfed is .debug_gdb_scripts
0x00ddbff0 - 0x00e3ad44 is .eh_frame_hdr
0x00e3ad44 - 0x01045184 is .eh_frame
0x01045184 - 0x010c55a8 is .gcc_except_table
0x010c6dcc - 0x010c6dd4 is .ctors
0x010c6dd4 - 0x010c6ddc is .dtors
0x010c6ddc - 0x010c6de0 is .jcr
0x010c6de0 - 0x010fbd0c is .data.rel.ro
0x010fbd0c - 0x010fbdfc is .dynamic
0x010fbdfc - 0x010fd000 is .got
0x010fd000 - 0x010fd1b0 is .data
0x010fd1c0 - 0x010fd344 is .bss
(gdb)
(gdb) x/i 0xbb508632
=> 0xbb508632: Cannot access memory at address 0xbb508632
(gdb)
However, in this case, 0xbb508632 doesn't appear to be covered by
any of the "load" entries in "i target".
And ... "of course" it is hard to figure out the exact
environment which is required to actually run this process from
within gdb -- the rust build process does not exactly make this
easy. One thing is to extract MAKE_ENV from pkgsrc, that part is
easy, but it also apparently depends on additional tweaks
performed by the rust build itself, and untangling what that is
is not exactly straight-forward.
So ... what gives?
Any and all assistance appreciated.
Oh, yes, of course a backtrace is more or less useless as well.
macppc:
(gdb) where
#0 0xfdc52444 in ?? ()
#1 0xfdc52414 in ?? ()
#2 0x00be2b18 in alloc::collections::btree::node::BalancingContext<K,V>::bulk_steal_right ()
#3 0x00000021 in ?? ()
#4 0x00000021 in ?? ()
#5 0x001da508 in bootstrap::compile::add_to_sysroot () at compile.rs:1723
#6 0x001da2f0 in bootstrap::compile::{impl#12}::run () at compile.rs:1570
#7 0xfdb38354 in ?? ()
(gdb)
and on i386:
(gdb) where
#0 0xbb508632 in ?? ()
#1 0x010fcdfc in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)
Regards,
- Havard
Home |
Main Index |
Thread Index |
Old Index