https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285873

            Bug ID: 285873
           Summary: rust intermittently segfaults on FreeBSD 13.5
           Product: Base System
           Version: 13.5-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: b...@freebsd.org
          Reporter: asom...@freebsd.org

Ever since FreeBSD 13.5 came out, my Rust projects have frequently failed in CI
with segfaults.  I can reproduce it in a local stable/13 VM, too.  I never saw
it with FreeBSD 13.3 (I didn't use 13.4 in CI very much).  I can't reproduce it
using lang/rust 1.86.0 from ports.  But I can reproduce the problem using Rust
installed via rustup.  With 1.70.0 I can crash in just a few seconds.  Later
versions of the compiler take minutes to crash, but every version I've tested
eventually does crash.
The crashing component is usually rustc, which to my frustration doesn't leave
a core file behind.  But occasionally cargo or even rustup will crash.  I have
one usable core file, which shows a stack trace like this, suggesting a problem
in rtld or maybe OpenSSL:

#0  0x000028fc58a0f247 in __crt_free (cp=cp@entry=0xd89aeef12c8) at
/usr/home/somers/src/freebsd.org/src/libexec/rtld-elf/rtld_malloc.c:249
#1  0x000028fc58a0bc3d in free (cp=0xd89aeef12c8) at
/usr/home/somers/src/freebsd.org/src/libexec/rtld-elf/rtld.c:6465
#2  load_object (name=name@entry=0xd89b1d7a060 "/home/somers/.cargo/bin/cargo",
fd_u=fd_u@entry=-1, refobj=refobj@entry=0xd89aeef0008, flags=flags@entry=2)
    at /usr/home/somers/src/freebsd.org/src/libexec/rtld-elf/rtld.c:2863
#3  0x000028fc58a0ac3b in dlopen_object (name=name@entry=0xd89b1d7a060
"/home/somers/.cargo/bin/cargo", fd=fd@entry=-1, refobj=0xd89aeef0008,
lo_flags=2, mode=mode@entry=2, 
    lockstate=0xd89ae40d9c8, lockstate@entry=0x0) at
/usr/home/somers/src/freebsd.org/src/libexec/rtld-elf/rtld.c:3841
#4  0x000028fc58a07cf3 in rtld_dlopen (name=0xd89b1d7a060
"/home/somers/.cargo/bin/cargo", fd=-1, mode=<optimized out>) at
/usr/home/somers/src/freebsd.org/src/libexec/rtld-elf/rtld.c:3802
#5  0x00000d818debf2ea in dlfcn_load ()
#6  0x00000d818dd92f57 in DSO_load ()
#7  0x00000d818dd932a6 in DSO_dsobyaddr ()
#8  0x00000d818ddcc7f6 in ossl_init_load_crypto_nodelete_ossl_ ()
#9  0x00000d89b00163c3 in _thr_once (once_control=0xd818e3f0550
<load_crypto_nodelete>, init_routine=0xd818ddcc7d0
<ossl_init_load_crypto_nodelete_ossl_>)
    at /usr/home/somers/src/freebsd.org/src/lib/libthr/thread/thr_once.c:95
#10 0x00000d818ddd9239 in CRYPTO_THREAD_run_once ()
#11 0x00000d818ddcc379 in OPENSSL_init_crypto ()
#12 0x00000d818dd252e3 in OPENSSL_init_ssl ()
#13 0x00000d818dcf4000 in ossl_init ()
#14 0x00000d818dcc9e0c in curl_global_init ()
#15 0x00000d818d67f47a in std::sync::poison::once::Once::call_once::{{closure}}
()
#16 0x00000d818d525b2a in std::sys::sync::once::futex::Once::call ()
#17 0x00000d818d67f3f4 in curl::INIT_CTOR::init_ctor ()
#18 0x000028fc58a06cfd in objlist_call_init (list=list@entry=0xd89ae40f138,
lockstate=lockstate@entry=0xd89ae40ef30) at
/usr/home/somers/src/freebsd.org/src/libexec/rtld-elf/rtld.c:3194
#19 0x000028fc58a058b9 in _rtld (sp=<optimized out>, exit_proc=0xd89ae40f1b0,
objp=0xd89ae40f1b8) at
/usr/home/somers/src/freebsd.org/src/libexec/rtld-elf/rtld.c:990
#20 0x000028fc58a02669 in rtld_start () at
/usr/home/somers/src/freebsd.org/src/libexec/rtld-elf/amd64/rtld_start.S:37
#21 0x0000000000000000 in ?? ()

Steps to Reproduce
==================
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default 1.70.0
git clone https://github.com/asomers/tokio-file.git
cd tokio-file
while true; do cargo clean && cargo test || break; done

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to