<p dir="auto">The problem occurs under OpenBSD (x86_64-unknown-openbsd).<br>
The building of <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/f174bcabcb8c9c707481c834766894d984eb089f/hovercard" href="https://github.com/rust-lang/rust/commit/f174bcabcb8c9c707481c834766894d984eb089f"><tt>f174bca</tt></a> fail with <code class="notranslate">SIGBUS</code>, when compiling libstd using stage1/rustc. The last known to work build was ba2efe9 (~10 commits before).</p>
<p dir="auto">Here the backtrace under gdb:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type &quot;show copying&quot; to see the conditions.
There is absolutely no warranty for GDB.  Type &quot;show warranty&quot; for details.
This GDB was configured as &quot;amd64-unknown-openbsd5.7&quot;...(no debugging symbols found)

(gdb) r
Starting program: /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/bin/rustc --cfg stage1 -Z print-link-args -O --cfg rtopt --cfg debug --sysroot x86_64-unknown-openbsd/stage1 -C prefer-dynamic --target=x86_64-unknown-openbsd -D warnings -L x86_64-unknown-openbsd/rt -L /opt/llvm-32c27dda3ae2318b6897f00795009cd6f42ac4b3/lib -L '' --out-dir x86_64-unknown-openbsd/stage1/lib/rustlib/x86_64-unknown-openbsd/lib -C extra-filename=-4e7c5e5c /root/build/openbsd-master/src/libcore/lib.rs

Program received signal SIGBUS, Bus error.
[Switching to thread 1002137]
0x000005d798729cf0 in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::h6743774523963745181 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
(gdb) bt
#0  0x000005d798729cf0 in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::h6743774523963745181 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#1  0x000005d79871593b in fold::noop_fold_item::h10734865051070155566 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#2  0x000005d798728157 in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::closure.20907 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#3  0x000005d798727f0d in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::h17973506744433351220 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#4  0x000005d798727298 in vec::Vec$LT$T$GT$.FromIterator$LT$T$GT$::from_iter::h11853285780444493736 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#5  0x000005d79871376c in fold::noop_fold_item::h10734865051070155566 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#6  0x000005d798728157 in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::closure.20907 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#7  0x000005d798727f0d in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::h17973506744433351220 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#8  0x000005d798727298 in vec::Vec$LT$T$GT$.FromIterator$LT$T$GT$::from_iter::h11853285780444493736 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#9  0x000005d79871376c in fold::noop_fold_item::h10734865051070155566 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#10 0x000005d7987109d5 in driver::assign_node_ids_and_map::closure.20285 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#11 0x000005d7986ce543 in driver::assign_node_ids_and_map::h6bc19e47b471dcd8hDa ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#12 0x000005d7986be7c1 in driver::compile_input::h8dcb5e309d83154fEba ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#13 0x000005d79876e26f in run_compiler::h0831f82d312bd846jbc ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#14 0x000005d79876bd21 in thunk::F.Invoke$LT$A$C$$u{20}R$GT$::invoke::h15181002208922494184 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#15 0x000005d79876b042 in rt::unwind::try::try_fn::h10368191240528705449 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#16 0x000005d7dcbf35a9 in rust_try_inner () from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/libstd-4e7c5e5c.so
#17 0x000005d7dcbf3596 in rust_try () from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/libstd-4e7c5e5c.so
#18 0x000005d79876b61f in thunk::F.Invoke$LT$A$C$$u{20}R$GT$::invoke::h12343021353288682298 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#19 0x000005d7dcbb00ce in sys::thread::thread_start::hd53a9aab8f83598fqHE ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/libstd-4e7c5e5c.so
#20 0x000005d71b0e898e in _rthread_start (v=Variable &quot;v&quot; is not available.
) at /usr/src/lib/librthread/rthread.c:145
#21 0x000005d7eb2c059b in __tfork_thread () at /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:75
#22 0x0000000000000000 in ?? ()
(gdb) "><pre class="notranslate"><code class="notranslate">GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd5.7"...(no debugging symbols found)

(gdb) r
Starting program: /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/bin/rustc --cfg stage1 -Z print-link-args -O --cfg rtopt --cfg debug --sysroot x86_64-unknown-openbsd/stage1 -C prefer-dynamic --target=x86_64-unknown-openbsd -D warnings -L x86_64-unknown-openbsd/rt -L /opt/llvm-32c27dda3ae2318b6897f00795009cd6f42ac4b3/lib -L '' --out-dir x86_64-unknown-openbsd/stage1/lib/rustlib/x86_64-unknown-openbsd/lib -C extra-filename=-4e7c5e5c /root/build/openbsd-master/src/libcore/lib.rs

Program received signal SIGBUS, Bus error.
[Switching to thread 1002137]
0x000005d798729cf0 in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::h6743774523963745181 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
(gdb) bt
#0  0x000005d798729cf0 in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::h6743774523963745181 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#1  0x000005d79871593b in fold::noop_fold_item::h10734865051070155566 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#2  0x000005d798728157 in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::closure.20907 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#3  0x000005d798727f0d in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::h17973506744433351220 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#4  0x000005d798727298 in vec::Vec$LT$T$GT$.FromIterator$LT$T$GT$::from_iter::h11853285780444493736 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#5  0x000005d79871376c in fold::noop_fold_item::h10734865051070155566 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#6  0x000005d798728157 in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::closure.20907 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#7  0x000005d798727f0d in iter::FlatMap$LT$I$C$$u{20}U$C$$u{20}F$GT$.Iterator::next::h17973506744433351220 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#8  0x000005d798727298 in vec::Vec$LT$T$GT$.FromIterator$LT$T$GT$::from_iter::h11853285780444493736 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#9  0x000005d79871376c in fold::noop_fold_item::h10734865051070155566 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#10 0x000005d7987109d5 in driver::assign_node_ids_and_map::closure.20285 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#11 0x000005d7986ce543 in driver::assign_node_ids_and_map::h6bc19e47b471dcd8hDa ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#12 0x000005d7986be7c1 in driver::compile_input::h8dcb5e309d83154fEba ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#13 0x000005d79876e26f in run_compiler::h0831f82d312bd846jbc ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#14 0x000005d79876bd21 in thunk::F.Invoke$LT$A$C$$u{20}R$GT$::invoke::h15181002208922494184 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#15 0x000005d79876b042 in rt::unwind::try::try_fn::h10368191240528705449 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#16 0x000005d7dcbf35a9 in rust_try_inner () from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/libstd-4e7c5e5c.so
#17 0x000005d7dcbf3596 in rust_try () from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/libstd-4e7c5e5c.so
#18 0x000005d79876b61f in thunk::F.Invoke$LT$A$C$$u{20}R$GT$::invoke::h12343021353288682298 ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/librustc_driver-4e7c5e5c.so
#19 0x000005d7dcbb00ce in sys::thread::thread_start::hd53a9aab8f83598fqHE ()
   from /root/build/openbsd-master/build/x86_64-unknown-openbsd/stage1/lib/libstd-4e7c5e5c.so
#20 0x000005d71b0e898e in _rthread_start (v=Variable "v" is not available.
) at /usr/src/lib/librthread/rthread.c:145
#21 0x000005d7eb2c059b in __tfork_thread () at /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:75
#22 0x0000000000000000 in ?? ()
(gdb) 
</code></pre></div>
<p dir="auto">The builds are without jemalloc.</p>
<p dir="auto">Configuring with <code class="notranslate">../configure --disable-docs --enable-ccache --disable-jemalloc</code> causes the build to fail with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
Illegal instruction (core dumped)"><pre class="notranslate"><code class="notranslate">x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
Illegal instruction (core dumped)
</code></pre></div>
<p dir="auto">Usually it is <code class="notranslate">Illegal instruction</code> however sometimes a bad or double free is reported.</p>
<p dir="auto">Building with jemalloc enabled (<code class="notranslate">../configure --disable-docs --enable-ccache</code>) has no problem.</p>