- Thread Starter
- #26
That is strange. If you just dox/i $pc?
(gdb) x/4i $pc
=> 0x3abd41e970b8: Cannot access memory at address 0x3abd41e970b8
That is strange. If you just dox/i $pc?
(gdb) x/4i $pc
=> 0x3abd41e970b8: Cannot access memory at address 0x3abd41e970b8
Thanks. It seems the dump doesn't have .text segments in,
Could be. It's not necessary to have the actual binary when analyzing dump (.text can be included in dump) but it wouldn't hurt to test with it too.It would probably help to call gdb with the executable as the first argument.
gdb /usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1/bin/rustc /path/to/core?Could be. It's not necessary to have the actual binary when analyzing dump (.text can be included in dump) but it wouldn't hurt to test with it too.
Rob215x please could try it to execute gdb withgdb /usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1/bin/rustc /path/to/core?
And then do the gdb commands. It could be that text segment is not included in core dump.
# gdb /usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1/bin/rustc rustc.core
GNU gdb (GDB) 15.1 [GDB v15.1 for FreeBSD]
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd13.5".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1/bin/rustc...
[New LWP 158801]
[New LWP 117833]
[New LWP 158414]
[New LWP 158415]
[New LWP 158417]
[New LWP 158521]
[New LWP 158522]
[New LWP 158802]
warning: Could not load shared library symbols for [vdso].
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1/bin/rustc --crate'.
Program terminated with signal SIGILL, Illegal instruction.
Privileged opcode.
#0 0x00003abd41e970b8 in llvm::SelectionDAG::getVTList(llvm::EVT) ()
from /usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1/lib/librustc_driver-44d6690783209a73.so
[Current thread is 1 (LWP 158801)]
You are using it correctly; yes, it's better to use binary (first argument) if available, I didn't pick on it. cracauer@ is helping you make it work, I was just curious to see why it failed.Idk if that background helps any or not. Like I said, I've never used gdb before
see my updated reply. I just cd into the directory and put rustc.core. I think there's some new info I haven't seen?You are using it correctly; yes, it's better to use binary (first argument) if available, I didn't pick on it. cracauer@ is helping you make it work, I was just curious to see why it failed.
So far I was not able to reproduce it; got few different errors during buid but not this (I'm not a rust user).
When using gdb generally you want to use two arguments: first the binary (executable that failed) and core dump. You are missing actual core dump in your second argument. I specified it as /path/to/corefile because I didn't know where your rustc.core was.
(gdb) disass $pc-0x30, $pc+0x30
Dump of assembler code from 0x3abd41e97088 to 0x3abd41e970e8:
0x00003abd41e97088 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+248>: mov 0x49000000(%rax),%eax
0x00003abd41e9708e <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+254>: mov (%rsi),%esi
0x00003abd41e97090 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+256>: mov 0x88(%rbx),%rdi
0x00003abd41e97097 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+263>: call 0x3abd3fefd250 <_ZNSt3__127__tree_balance_after_insertB8sn190107IPNS_16__tree_node_baseIPvEEEEvT_S5_>
0x00003abd41e9709c <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+268>: incq 0x90(%rbx)
0x00003abd41e970a3 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+275>: mov %r15,%rax
0x00003abd41e970a6 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+278>: add $0x20,%rax
0x00003abd41e970aa <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+282>: mov $0x1,%edx
0x00003abd41e970af <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+287>: pop %rbx
0x00003abd41e970b0 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+288>: pop %r12
0x00003abd41e970b2 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+290>: pop %r14
0x00003abd41e970b4 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+292>: pop %r15
0x00003abd41e970b6 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+294>: pop %rbp
0x00003abd41e970b7 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+295>: ret
=> 0x00003abd41e970b8 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+296>: ud2
0x00003abd41e970ba <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+298>: lea 0x5317467(%rip),%rdi # 0x3abd471ae528 <_ZGVZN4llvm6SDNode16getValueTypeListENS_3MVTEE13SimpleVTArray>
0x00003abd41e970c1 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+305>: mov %esi,%ebx
0x00003abd41e970c3 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+307>: call 0x3abd46c4a380 <__cxa_guard_acquire@plt>
0x00003abd41e970c8 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+312>: mov %ebx,%esi
0x00003abd41e970ca <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+314>: test %eax,%eax
0x00003abd41e970cc <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+316>: je 0x3abd41e96faf <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+31>
0x00003abd41e970d2 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+322>: call 0x3abd41ed41c0 <_ZN12_GLOBAL__N_18EVTArrayC2Ev>
0x00003abd41e970d7 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+327>: lea 0x3d292(%rip),%rdi # 0x3abd41ed4370 <_ZN12_GLOBAL__N_18EVTArrayD2Ev>
0x00003abd41e970de <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+334>: lea 0x531742b(%rip),%rsi # 0x3abd471ae510 <_ZZN4llvm6SDNode16getValueTypeListENS_3MVTEE13SimpleVTArray>
0x00003abd41e970e5 <_ZN4llvm12SelectionDAG9getVTListENS_3EVTE+341>: lea 0x52aef24(%rip),%rdx # 0x3abd47146010 <__dso_handle>
End of assembler dump.
llvm::SelectionDAG::getVTListp ). If this jump was on purpose or not (e.g. did it deliberately jump here to ud2 instruction), that's another story./usr/ports/lang/rust/work/rustc-1.91.1-src/cargo.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/rustc.core
cargo build command most likely executed few commands. It could be that one ended in sigsegv and the other in sigill. Can you execute file, e.g.
file /usr/ports/lang/rust/work/rustc-1.91.1-src/cargo.core
# file /usr/ports/lang/rust/work/rustc-1.91.1-src/cargo.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/cargo.core: ELF 64-bit LSB core file, x86-64, version 1 (FreeBSD), FreeBSD-style, from '/usr/ports/lang/rust/work/bootstrap/bin/cargo build --target x86_64-unknown-free', pid=4918
# file /usr/ports/lang/rust/work/rustc-1.91.1-src/rustc.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/rustc.core: ELF 64-bit LSB core file, x86-64, version 1 (FreeBSD), FreeBSD-style, from '/usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1/bin/rustc --crate', pid=75997
I have not. I've been using this machine since July 2021. Obviously memory can go bad but isn't that kind of rare?random inexplicable segfaults building large programs can be caused by bad RAM. have you done a full overnight memtest?
I have not. I've been using this machine since July 2021. Obviously memory can go bad but isn't that kind of rare?
The next question is... wouldn't I have to kill all the applications to run memtest?
It doesn't matter if ASLR is in place or not. ASLR is just virtual address randomization. You can map the same pfn into different vaddr.especially when some kind of ASLR
Yes, just a possibility, but depending on how much dummy space is added on start address for randomization, extra one (possibly more? depending on implementation) pages would be needed additionally. Increasing memory pages could increase possibility of faulted memory cell is allocated.It doesn't matter if ASLR is in place or not. ASLR is just virtual address randomization. You can map the same pfn into different vaddr.
I don't agree. vaddr will be different, yes. That means different pagedir entry (index) will be used (page translation will land into different entry). But it will be the same amount of physical memory and it will still be the same pfn, i.e. same physical address., extra one (possibly more? depending on implementation) pages would be needed additionally.
Another place to compare between affected and sane computers would be /usr/local/lib/compat/pkg. If there are more ones in affected computer, moving the additional ones into different place that libraries are NOT looked for and try again.In my opinion the best next step is testing this /usr/local and /var/db/pkg on the backup machine that currently works and see whether the same tree is broken over there, too.
I have not cleared the work directory between builds. How would I do that?Well bad hardware (including bad RAM) could've caused corruption in a library needed byrustc. The error would be reproducible if that's the case.
I agree with cracauer@ that the likely culprit is a corrupt file. Have you tried cleaning out the work directory between builds?