Portupgrade Building Rust stopped with signal: 11 (SIGSEGV) (core dumped)

Hi, I'm on FreeBSD 13.5-RELEASE-p6 GENERIC

I have 32G RAM

I've never seen this before and so I'm wondering how to handle it. Portupgrade had already updated a bunch of things and I guess it got to upgrading libimagequant, which I guess requires cargo, which requires rust. Correct me if I'm wrong on that. But it just stopped (details below). I opened htop in another terminal and it shows I was using 27.5G/31.9G Memory.

Should I try building rust first outside of Portupgrade? Can I prevent a build from using up all my RAM?

Thanks!

Code:
GO_DEFAULT_LIB_METADATA="stable1.91.1" "/usr/ports/lang/rust/work/bootstrap/bin/cargo" "build" "--target" "x86_64-unknown-freebsd" "-Zbinary-dep-depinfo" "-j" "12" "-Zroot-dir=/usr/ports/lang/rust/work/rustc-1.91.1-src" "-v" "-v" "--frozen" "--release" "--manifest-path" "/usr/ports/lang/rust/work/rustc-1.91.1-src/src/tools/cargo/Cargo.toml" "--message-format" "json-render-diagnostics" (failure_mode=Exit)
expected success, got: signal: 11 (SIGSEGV) (core dumped)
Traceback (most recent call last):
  File "/usr/ports/lang/rust/work/rustc-1.91.1-src/x.py", line 53, in <module>
    bootstrap.main()
  File "/usr/ports/lang/rust/work/rustc-1.91.1-src/src/bootstrap/bootstrap.py", line 1389, in main
    bootstrap(args)
  File "/usr/ports/lang/rust/work/rustc-1.91.1-src/src/bootstrap/bootstrap.py", line 1364, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/usr/ports/lang/rust/work/rustc-1.91.1-src/src/bootstrap/bootstrap.py", line 237, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /usr/ports/lang/rust/work/_build/bootstrap/debug/bootstrap dist --jobs=12
*** Error code 1


Stop.
make[3]: stopped in /usr/ports/lang/rust
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/lang/rust
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/cargo-c
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/libimagequant
 
ok gdb is installed but I did a search for core files and I have no idea which one to backtrace...

Code:
# find / -name "*.core"
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/altmain.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/gcore/linux-i386.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/gcore/linux-x86_64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-neon.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-pac.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-sve-fpsimd.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-sve-full.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-arm.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-fpr_sse_i386.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-fpr_sse_x86_64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-i386.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64le.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-riscv64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-s390x.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/linux-x86_64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/thread_crash/linux-i386.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/elf-core/thread_crash/linux-x86_64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.aarch64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.amd64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/functionalities/unwind/noreturn/module-end/test.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/API/tools/lldb-dap/coreFile/linux-x86_64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/ObjectFile/ELF/Inputs/netbsd-amd64.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/aarch64-freebsd-multithread.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd-multithread.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-32-linux-multithread.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-32-linux.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd-multithread.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd-multithread.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-64-linux-multithread.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-64-linux.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd-multithread.core
/usr/ports/devel/llvm19/work-default/llvm-project-19.1.7.src/lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/commands/target/stop-hooks/on-core-load/linux-x86_64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/expr/linux-x86_64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/gcore/linux-x86_64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/gcore/linux-i386.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/thread_crash/linux-x86_64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/thread_crash/linux-i386.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/altmain2.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-x86_64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-fpr_sse_x86_64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-loongarch64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-i386.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-fpr_sse_i386.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-pac.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-sve-fpsimd.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64le.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-sve-full.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-arm.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/altmain.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-neon.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-riscv64.gpr_fpr.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-s390x.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/elf-core/linux-riscv64.gpr_only.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.amd64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.amd64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_t2_SIGSEGV.aarch64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/netbsd-core/1lwp_SIGSEGV.aarch64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.aarch64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/functionalities/unwind/noreturn/module-end/test.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/API/tools/lldb-dap/coreFile/linux-x86_64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/ObjectFile/ELF/Inputs/netbsd-amd64.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd-multithread.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd-multithread.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/aarch64-freebsd-multithread.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd-multithread.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd-multithread.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-32-linux-multithread.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-64-linux-multithread.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-64-linux-tkill.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-32-linux.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/src/llvm-project/lldb/test/Shell/Register/Core/Inputs/x86-64-linux.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/cargo.core
/usr/ports/lang/rust/work/rustc-1.91.1-src/rustc.core
 
UPDATE:
I rebooted the machine and instead of running Portupgrade, I just
Code:
# cd /usr/ports/lang/rust
# make

After only 20 minutes, I got:
Code:
RUST_TEST_THREADS="12" SYSROOT="/usr/ports/lang/rust/work/_build/x86_64-unknown-freebsd/stage1" __CARGO_DEFAULT_LIB_METADATA="stabletool-rustc1.91.1" "/usr/ports/lang/rust/work/bootstrap/bin/cargo" "build" "--target" "x86_64-unknown-freebsd" "-Zbinary-dep-depinfo" "-j" "12" "-Zroot-dir=/usr/ports/lang/rust/work/rustc-1.91.1-src" "-v" "-v" "--frozen" "--release" "--manifest-path" "/usr/ports/lang/rust/work/rustc-1.91.1-src/src/tools/rustfmt/Cargo.toml" "--message-format" "json-render-diagnostics" (failure_mode=Exit)
expected success, got: signal: 11 (SIGSEGV) (core dumped)
Traceback (most recent call last):
  File "/usr/ports/lang/rust/work/rustc-1.91.1-src/x.py", line 53, in <module>
    bootstrap.main()
  File "/usr/ports/lang/rust/work/rustc-1.91.1-src/src/bootstrap/bootstrap.py", line 1389, in main
    bootstrap(args)
  File "/usr/ports/lang/rust/work/rustc-1.91.1-src/src/bootstrap/bootstrap.py", line 1364, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/usr/ports/lang/rust/work/rustc-1.91.1-src/src/bootstrap/bootstrap.py", line 237, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /usr/ports/lang/rust/work/_build/bootstrap/debug/bootstrap dist --jobs=12
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/rust
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust

htop showed it was only using 13.7G/31.9G mem so I didn't run out of memory this time.

Next I did this:

Code:
# cd /usr/ports/lang/rust//work/rustc-1.91.1-src
# gdb - 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"...
-: No such file or directory.
[New LWP 158801]
[New LWP 117833]
[New LWP 158414]
[New LWP 158415]
[New LWP 158417]
[New LWP 158521]
[New LWP 158522]
[New LWP 158802]
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 ?? ()
[Current thread is 1 (LWP 158801)]
(gdb) bt
#0  0x00003abd41e970b8 in ?? ()
#1  0x00003abdad9a5800 in ?? ()
#2  0x0000000080000008 in ?? ()
#3  0x00003abdad9a5800 in ?? ()
#4  0x00003abda5b2e230 in ?? ()
#5  0x00003abda5b2de50 in ?? ()
#6  0x00003abd41e9c8c2 in ?? ()
#7  0x00003abd00000001 in ?? ()
#8  0x0000000000000000 in ?? ()

I don't know what to do next
 
cracauer@ I found this thread from a couple of weeks ago: https://forums.freebsd.org/threads/rust-does-not-build-anymore.100023/

I saw you mentioned that rust was using different directories so here's more info:


Code:
# df -a
Filesystem   1K-blocks     Used     Avail Capacity  Mounted on
/dev/ada0s1a   8106716   465720   6992460     6%    /
devfs                1        0         1     0%    /dev
/dev/ada0s1d  64995324 27868852  31926848    47%    /var
/dev/ada0s1e   1015324    13264    920836     1%    /tmp
/dev/ada0s1f 863809596 96544488 698160344    12%    /usr
 
Code:
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.

I don't know what to do next

Privileged opcode. I am afraid I don't know what that means in a Rust context. In C++ code sequences with those are sometimes inserted to mark error code paths. I also don't know why there is a segfault but the corefile is from a SIGILL.

At least it is reproducible. So it's not an unstable machine.

It can't be from running out of memory, that would be a different error. I would ask the Rust in FreeBSD maintainers about the SIGILL.
 
What's weird is, I have an older machine and I just updated everything on it 5 days ago. Rust took about 3 hours to make but there were no errors. I used Portupgrade the same way as the newer machine with the error. The older machine has 64G RAM.

On the newer machine I had to install my necessary programs from packages. I did pkg install rust and it gave me v1.89.0_1 instead of v1.91.1.
 
On the newer machine I had to install my necessary programs from packages. I did pkg install rust and it gave me v1.89.0_1 instead of v1.91.1.

That change is quite a few days old. Looks like the 13 packages are a bit behind.

One brutal way to fix this would be to reinstall all of /usr/local. Maybe you have a bad file somewhere.
 
That change is quite a few days old. Looks like the 13 packages are a bit behind.

One brutal way to fix this would be to reinstall all of /usr/local. Maybe you have a bad file somewhere.
Thanks, I appreciate the help. The server seems to be running fine at the moment. I'm gonna wait a bit and do a little more digging. I compared the installed versions of everything on both servers and they are almost identical.

I'll have to look back through my notes. I know I've done a complete reinstall at least once.
 
Back
Top