Skip to content

Segfault in safe code that spawns a thread with an infinite loop when optimized #39753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shepmaster opened this issue Feb 12, 2017 · 14 comments
Closed

Comments

@shepmaster
Copy link
Member

shepmaster commented Feb 12, 2017

Summary

  • macOS: Segfaults with Rust bae454e
  • Linux: Panics and Valgrind reports errors with Rust ba7cf7c

Complete original report

Originally reported on Stack Overflow.

use std::thread;

fn main() {
    thread::spawn(|| {
        let a = 2;
        loop {
            a*a;
        }
    }).join();
}
$ rustc -O inf.rs
warning: unused result which must be used, #[warn(unused_must_use)] on by default
 --> inf.rs:4:5
  |
4 |       thread::spawn(|| {
  |  _____^ starting here...
5 | |         let a = 2;
6 | |         loop {
7 | |             a*a;
8 | |         }
9 | |     }).join();
  | |______________^ ...ending here

$ ./inf
Segmentation fault: 11
$ rustc --version --verbose
rustc 1.15.1 (021bd294c 2017-02-08)
binary: rustc
commit-hash: 021bd294c039bd54aa5c4aa85bcdffb0d24bc892
commit-date: 2017-02-08
host: x86_64-apple-darwin
release: 1.15.1
LLVM version: 3.9

Adding an unwrap() does not change the behavior.

@shepmaster
Copy link
Member Author

The original poster there also had this backtrace:

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 0, message: "Success" } }', src/libcore/result.rs:837
stack backtrace:
1:     0x5650bd0acada - std::sys::imp::backtrace::tracing::imp::write::h917062bce4ff48c3
                        at /build/rustc-1.14.0+dfsg1/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
2:     0x5650bd0b068f - std::panicking::default_hook::{{closure}}::h0bacac31b5ed1870
                        at /build/rustc-1.14.0+dfsg1/src/libstd/panicking.rs:247
3:     0x5650bd0aee7c - std::panicking::default_hook::h5897799da33ece67
                        at /build/rustc-1.14.0+dfsg1/src/libstd/panicking.rs:263
4:     0x5650bd0af4d7 - std::panicking::rust_panic_with_hook::h109e116a3a861224
                        at /build/rustc-1.14.0+dfsg1/src/libstd/panicking.rs:451
5:     0x5650bd0af364 - std::panicking::begin_panic::hbb38be1379e09df0
                        at /build/rustc-1.14.0+dfsg1/src/libstd/panicking.rs:413
6:     0x5650bd0af289 - std::panicking::begin_panic_fmt::h26713cea9bce3ab0
                        at /build/rustc-1.14.0+dfsg1/src/libstd/panicking.rs:397
7:     0x5650bd0af217 - rust_begin_unwind
                        at /build/rustc-1.14.0+dfsg1/src/libstd/panicking.rs:373
8:     0x5650bd0e2f3d - core::panicking::panic_fmt::hcfbb59eeb7f27f75
                        at /build/rustc-1.14.0+dfsg1/src/libcore/panicking.rs:69
9:     0x5650bd0a6e84 - core::result::unwrap_failed::h15a0fc826f4081f4
10:     0x5650bd0b7ffa - __rust_maybe_catch_panic
                        at /build/rustc-1.14.0+dfsg1/src/libpanic_unwind/lib.rs:97
11:     0x5650bd0a6fc1 - <F as alloc::boxed::FnBox<A>>::call_box::he32a93ebea7bc7ad
12:     0x5650bd0ae6c4 - std::sys::imp::thread::Thread::new::thread_start::ha102a6120fc52763
                        at /build/rustc-1.14.0+dfsg1/src/liballoc/boxed.rs:605
                        at /build/rustc-1.14.0+dfsg1/src/libstd/sys_common/thread.rs:21
                        at /build/rustc-1.14.0+dfsg1/src/libstd/sys/unix/thread.rs:84
13:     0x7fc2d0042423 - start_thread
14:     0x7fc2cfb6e9be - __clone
15:                0x0 - <unknown>

@shepmaster
Copy link
Member Author

LLDB (without debugging symbols) says:

* thread #2: tid = 0x20e634, 0x0000000100008598 inf`std::panicking::rust_begin_panic + 8 at panicking.rs:472, stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
  * frame #0: 0x0000000100008598 inf`std::panicking::rust_begin_panic + 8 at panicking.rs:472 [opt]
    frame #1: 0x000000010002a871 inf`core::panicking::panic_fmt + 129 at panicking.rs:69 [opt]
    frame #2: 0x0000000100001449 inf`core::result::unwrap_failed::h2eef2e2eb04ac564 + 153

@shepmaster
Copy link
Member Author

Setting a breakpoint on unwrap_failed gets this better backtrace:

* thread #2: tid = 0x2107e7, 0x00000001000013b4 inf`core::result::unwrap_failed<std::io::error::Error>(msg=<unavailable>, error=<unavailable>) + 4 at result.rs:836, stop reason = breakpoint 1.1
  * frame #0: 0x00000001000013b4 inf`core::result::unwrap_failed<std::io::error::Error>(msg=<unavailable>, error=<unavailable>) + 4 at result.rs:836 [opt]
    frame #1: 0x0000700007049e30
    frame #2: 0x000000010000a4bb inf`panic_unwind::__rust_maybe_catch_panic + 27 at lib.rs:98 [opt]
    frame #3: 0x0000000100001640 inf`alloc::boxed::{{impl}}::call_box<(),closure> + 40 at panicking.rs:434 [opt]
    frame #4: 0x0000000100001618 inf`alloc::boxed::{{impl}}::call_box<(),closure> [inlined] std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure>,()> at panic.rs:351 [opt]
    frame #5: 0x0000000100001618 inf`alloc::boxed::{{impl}}::call_box<(),closure> [inlined] std::thread::{{impl}}::spawn::{{closure}}<closure,()> + 53 at mod.rs:301 [opt]
    frame #6: 0x00000001000015e3 inf`alloc::boxed::{{impl}}::call_box<(),closure>(self=0x0000000100620000, args=<unavailable>) + 35 at boxed.rs:605 [opt]
    frame #7: 0x0000000100007bc5 inf`std::sys::imp::thread::{{impl}}::new::thread_start [inlined] alloc::boxed::{{impl}}::call_once<(),()> + 37 at boxed.rs:615 [opt]
    frame #8: 0x0000000100007bbf inf`std::sys::imp::thread::{{impl}}::new::thread_start [inlined] std::sys_common::thread::start_thread + 15 at thread.rs:21 [opt]
    frame #9: 0x0000000100007bb0 inf`std::sys::imp::thread::{{impl}}::new::thread_start + 16 at thread.rs:84 [opt]
    frame #10: 0x00007fffadccbaab libsystem_pthread.dylib`_pthread_body + 180
    frame #11: 0x00007fffadccb9f7 libsystem_pthread.dylib`_pthread_start + 286
    frame #12: 0x00007fffadccb1fd libsystem_pthread.dylib`thread_start + 13

@hanna-kruppe
Copy link
Contributor

Might be #39432? There's no nightly with #39721 in it yet, making it hard to try if that fixed it.

@shepmaster
Copy link
Member Author

@rkruppe certainly seems related, but there's no ! here AFAICS. If the same, could mean the other issue has a larger scope than it appears.

@shepmaster
Copy link
Member Author

However, I've got a fresh build going, so I can check in a little bit.

@shepmaster
Copy link
Member Author

I updated to ba7cf7c which contains ca92c51, but the issue still appears

@shepmaster
Copy link
Member Author

Some disassembly:

rust_begin_unwind:
    0x100007e70 <+0>: pushq  %rbp
    0x100007e71 <+1>: movq   %rsp, %rbp
    0x100007e74 <+4>: subq   $0x50, %rsp
    0x100007e78 <+8>: movaps 0x10(%rbp), %xmm0

The EXC_BAD_ACCESS / EXC_I386_GPFLT occurs on the 4th instruction there.

The registers:

(lldb) register read --all
General Purpose Registers:
       rax = 0x000000010002fb20  inf`str.7a
       rbx = 0x0000000000000000
       rcx = 0x000000000000002f
       rdx = 0x0000000000000364
       rdi = 0x000000010002fb20  inf`str.7a
       rsi = 0x000000000000002f
       rbp = 0x00007000082b3cd8
       rsp = 0x00007000082b3c88
        r8 = 0x0000000000000018
        r9 = 0x0000000100200370
       r10 = 0x00000000fe000000
       r11 = 0x0000000000000206
       r12 = 0x0000000100007470  inf`std::sys::imp::thread::Thread::new::thread_start::h0a238f531cd955b4
       r13 = 0x0000000000000d03
       r14 = 0x00007000082b3e58
       r15 = 0x00007000082b3e60
       rip = 0x0000000100007e78  inf`rust_begin_unwind + 8
    rflags = 0x0000000000000206
        cs = 0x000000000000002b
        fs = 0x0000000000000000
        gs = 0x0000000000000000
       eax = 0x0002fb20
       ebx = 0x00000000
       ecx = 0x0000002f
       edx = 0x00000364
       edi = 0x0002fb20
       esi = 0x0000002f
       ebp = 0x082b3cd8
       esp = 0x082b3c88
       r8d = 0x00000018
       r9d = 0x00200370
      r10d = 0xfe000000
      r11d = 0x00000206
      r12d = 0x00007470
      r13d = 0x00000d03
      r14d = 0x082b3e58
      r15d = 0x082b3e60
        ax = 0xfb20
        bx = 0x0000
        cx = 0x002f
        dx = 0x0364
        di = 0xfb20
        si = 0x002f
        bp = 0x3cd8
        sp = 0x3c88
       r8w = 0x0018
       r9w = 0x0370
      r10w = 0x0000
      r11w = 0x0206
      r12w = 0x7470
      r13w = 0x0d03
      r14w = 0x3e58
      r15w = 0x3e60
        ah = 0xfb
        bh = 0x00
        ch = 0x00
        dh = 0x03
        al = 0x20
        bl = 0x00
        cl = 0x2f
        dl = 0x64
       dil = 0x20
       sil = 0x2f
       bpl = 0xd8
       spl = 0x88
       r8l = 0x18
       r9l = 0x70
      r10l = 0x00
      r11l = 0x06
      r12l = 0x70
      r13l = 0x03
      r14l = 0x58
      r15l = 0x60

Floating Point Registers:
     fctrl = 0x037f
     fstat = 0x0000
      ftag = 0x00
       fop = 0x0000
     fioff = 0x00000000
     fiseg = 0x0000
     fooff = 0x00000000
     foseg = 0x0000
     mxcsr = 0x00001f80
  mxcsrmask = 0x0000ffff
     stmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff}
     stmm1 = {0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff}
     stmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     stmm3 = {0x15 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff}
     stmm4 = {0x00 0x91 0xe3 0xff 0x00 0x00 0x00 0x00 0xff 0xff}
     stmm5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     stmm6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     stmm7 = {0x7c 0x3d 0xd2 0x87 0x00 0x00 0x00 0x00 0xff 0xff}
      ymm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      ymm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      ymm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      ymm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      ymm4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      ymm5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      ymm6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      ymm7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      ymm8 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      ymm9 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     ymm10 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     ymm11 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     ymm12 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     ymm13 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     ymm14 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     ymm15 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm8 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm9 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm10 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm11 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm12 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm13 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm14 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm15 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}

Exception State Registers:
    trapno = 0x00000001
       err = 0x00000000
  faultvaddr = 0x0000244251e97000

@shepmaster
Copy link
Member Author

shepmaster commented Feb 12, 2017

Valgrind output (code compiled with Rust 1.15.1):

valgrind ./inf
==8821== Memcheck, a memory error detector
==8821== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==8821== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==8821== Command: ./inf
==8821==
==8821== Thread 2:
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x110504: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:506)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==8821==    by 0x10DF01: _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hd0e958eef64c8c8a (in /tmp/inf)
==8821==    by 0x1153B4: call_once<(),()> (boxed.rs:615)
==8821==    by 0x1153B4: start_thread (thread.rs:21)
==8821==    by 0x1153B4: std::sys::imp::thread::Thread::new::thread_start::he018521f53b24939 (thread.rs:84)
==8821==
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x110508: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:506)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==8821==    by 0x10DF01: _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hd0e958eef64c8c8a (in /tmp/inf)
==8821==    by 0x1153B4: call_once<(),()> (boxed.rs:615)
==8821==    by 0x1153B4: start_thread (thread.rs:21)
==8821==    by 0x1153B4: std::sys::imp::thread::Thread::new::thread_start::he018521f53b24939 (thread.rs:84)
==8821==
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x13E721: core::fmt::num::_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$::fmt::hd5ff6057022eb859 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x1105AE: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:507)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x13E78F: core::fmt::num::_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$::fmt::hd5ff6057022eb859 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x1105AE: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:507)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x13E7BD: core::fmt::num::_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$::fmt::hd5ff6057022eb859 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x1105AE: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:507)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x13D4CE: core::fmt::Formatter::pad_integral::h395315be99f81a5c (mod.rs:913)
==8821==    by 0x13E80A: core::fmt::num::_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$::fmt::hd5ff6057022eb859 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x1105AE: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:507)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x5703A09: strerror_r (_strerror.c:39)
==8821==    by 0x57176D9: __xpg_strerror_r (xpg-strerror.c:29)
==8821==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==8821==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x5703A11: strerror_r (_strerror.c:39)
==8821==    by 0x57176D9: __xpg_strerror_r (xpg-strerror.c:29)
==8821==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==8821==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==
==8821== Use of uninitialised value of size 8
==8821==    at 0x5703A1E: strerror_r (_strerror.c:40)
==8821==    by 0x57176D9: __xpg_strerror_r (xpg-strerror.c:29)
==8821==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==8821==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x57176E5: __xpg_strerror_r (xpg-strerror.c:42)
==8821==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==8821==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==8821==
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x57176F1: __xpg_strerror_r (xpg-strerror.c:42)
==8821==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==8821==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==8821==
==8821== Use of uninitialised value of size 8
==8821==    at 0x5717701: __xpg_strerror_r (xpg-strerror.c:42)
==8821==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==8821==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x13C9C5: write_fmt (mod.rs:1136)
==8821==    by 0x13C9C5: {{closure}} (builders.rs:91)
==8821==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==8821==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==8821==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==8821==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==8821==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==8821==
thread '<unnamed>' panicked at '==8821== Syscall param write(buf) points to uninitialised byte(s)
==8821==    at 0x52564BD: ??? (syscall-template.S:84)
==8821==    by 0x1109AF: write (fd.rs:79)
==8821==    by 0x1109AF: write (stdio.rs:57)
==8821==    by 0x1109AF: write (stdio.rs:72)
==8821==    by 0x1109AF: std::io::Write::write_all::h7c10a51290981adc (mod.rs:944)
==8821==    by 0x110D29: _$LT$std..io..Write..write_fmt..Adaptor$LT$$u27$a$C$$u20$T$GT$$u20$as$u20$core..fmt..Write$GT$::write_str::hded10b9de53cb4d5 (mod.rs:1004)
==8821==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==8821==    by 0x110B42: std::io::Write::write_fmt::h0e5dfdfaa54059a4 (mod.rs:1015)
==8821==    by 0x11096E: std::io::impls::_$LT$impl$u20$std..io..Write$u20$for$u20$$RF$$u27$a$u20$mut$u20$W$GT$::write_fmt::h2b1de262c2db72a4 (impls.rs:56)
==8821==    by 0x115F02: std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::h6385b6959a2dd25b (panicking.rs:339)
==8821==    by 0x115B6E: std::panicking::default_hook::he4f3b61755d7fa95 (panicking.rs:365)
==8821==    by 0x1163B7: std::panicking::rust_panic_with_hook::hf00b8130f73095ec (panicking.rs:553)
==8821==    by 0x1161F4: std::panicking::begin_panic::h6227f62cb2cdaeb4 (panicking.rs:515)
==8821==    by 0x116169: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:499)
==8821==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==8821==  Address 0x6414046 is in a rw- anonymous segment
==8821==
called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 0, message: "Success" } }', /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs:837
note: Run with `RUST_BACKTRACE=1` for a backtrace.
==8821== Conditional jump or move depends on uninitialised value(s)
==8821==    at 0x10DDCC: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==8821==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==8821==    by 0x10DF01: _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hd0e958eef64c8c8a (in /tmp/inf)
==8821==    by 0x1153B4: call_once<(),()> (boxed.rs:615)
==8821==    by 0x1153B4: start_thread (thread.rs:21)
==8821==    by 0x1153B4: std::sys::imp::thread::Thread::new::thread_start::he018521f53b24939 (thread.rs:84)
==8821==    by 0x524D6B9: start_thread (pthread_create.c:333)
==8821==    by 0x577F82C: clone (clone.S:109)
==8821==

@shepmaster
Copy link
Member Author

but there's no ! here AFAICS

Oh, right, loop {} is diverging. However, I still get the segfault on macOS with the commit that is marked as fixing it. I'm (slowly) building master in a Linux VM to get up-to-date Valgrind output.

@laurence6
Copy link

A shorter version also crashes:

use std::thread;

fn main() {
    thread::spawn(|| {
        loop {}
    }).join();
}

But, it works well if I add println!("123") in the loop:

use std::thread;

fn main() {
    thread::spawn(|| {
        loop {
            println!("123");
        }
    }).join();
}

@shepmaster
Copy link
Member Author

In Linux, against ba7cf7c, the code no longer segfaults, but it does panic:

$ RUST_BACKTRACE=1 ./inf
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 0, message: "Success" } }', /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs:837
stack backtrace:
   1:     0x5620c17327ca - std::sys::imp::backtrace::tracing::imp::write::h3188f035833a2635
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
   2:     0x5620c1734f6f - std::panicking::default_hook::{{closure}}::h6385b6959a2dd25b
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:349
   3:     0x5620c1734b6e - std::panicking::default_hook::he4f3b61755d7fa95
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:365
   4:     0x5620c17353b7 - std::panicking::rust_panic_with_hook::hf00b8130f73095ec
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:553
   5:     0x5620c17351f4 - std::panicking::begin_panic::h6227f62cb2cdaeb4
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:515
   6:     0x5620c1735169 - std::panicking::begin_panic_fmt::h173eadd80ae64bec
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:499
   7:     0x5620c17350f7 - rust_begin_unwind
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/panicking.rs:475
   8:     0x5620c175b11d - core::panicking::panic_fmt::h3b2d1e30090844ff
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/panicking.rs:69
   9:     0x5620c172cdc4 - core::result::unwrap_failed::h822856a25f2ebc35
  10:     0x5620c173cf0a - __rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libpanic_unwind/lib.rs:98
  11:     0x5620c172cf01 - <F as alloc::boxed::FnBox<A>>::call_box::hd0e958eef64c8c8a
  12:     0x5620c17343b4 - std::sys::imp::thread::Thread::new::thread_start::he018521f53b24939
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/liballoc/boxed.rs:615
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/sys_common/thread.rs:21
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/sys/unix/thread.rs:84
  13:     0x7f32984a66b9 - start_thread
  14:     0x7f3297fc682c - clone
  15:                0x0 - <unknown>

And Valgrind is still unhappy about it:

==15546== Memcheck, a memory error detector
==15546== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==15546== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==15546== Command: ./inf
==15546==
==15546== Thread 2:
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x110504: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:506)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==15546==    by 0x10DF01: _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hd0e958eef64c8c8a (in /tmp/inf)
==15546==    by 0x1153B4: call_once<(),()> (boxed.rs:615)
==15546==    by 0x1153B4: start_thread (thread.rs:21)
==15546==    by 0x1153B4: std::sys::imp::thread::Thread::new::thread_start::he018521f53b24939 (thread.rs:84)
==15546==
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x110508: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:506)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==15546==    by 0x10DF01: _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hd0e958eef64c8c8a (in /tmp/inf)
==15546==    by 0x1153B4: call_once<(),()> (boxed.rs:615)
==15546==    by 0x1153B4: start_thread (thread.rs:21)
==15546==    by 0x1153B4: std::sys::imp::thread::Thread::new::thread_start::he018521f53b24939 (thread.rs:84)
==15546==
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x13E721: core::fmt::num::_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$::fmt::hd5ff6057022eb859 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x1105AE: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:507)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x13E78F: core::fmt::num::_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$::fmt::hd5ff6057022eb859 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x1105AE: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:507)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x13E7BD: core::fmt::num::_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$::fmt::hd5ff6057022eb859 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x1105AE: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:507)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x13D4CE: core::fmt::Formatter::pad_integral::h395315be99f81a5c (mod.rs:913)
==15546==    by 0x13E80A: core::fmt::num::_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$::fmt::hd5ff6057022eb859 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x1105AE: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:507)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x5703A09: strerror_r (_strerror.c:39)
==15546==    by 0x57176D9: __xpg_strerror_r (xpg-strerror.c:29)
==15546==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==15546==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x5703A11: strerror_r (_strerror.c:39)
==15546==    by 0x57176D9: __xpg_strerror_r (xpg-strerror.c:29)
==15546==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==15546==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==
==15546== Use of uninitialised value of size 8
==15546==    at 0x5703A1E: strerror_r (_strerror.c:40)
==15546==    by 0x57176D9: __xpg_strerror_r (xpg-strerror.c:29)
==15546==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==15546==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x57176E5: __xpg_strerror_r (xpg-strerror.c:42)
==15546==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==15546==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==15546==
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x57176F1: __xpg_strerror_r (xpg-strerror.c:42)
==15546==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==15546==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==15546==
==15546== Use of uninitialised value of size 8
==15546==    at 0x5717701: __xpg_strerror_r (xpg-strerror.c:42)
==15546==    by 0x11480D: std::sys::imp::os::error_string::h0e47a1bf8fcf955d (os.rs:97)
==15546==    by 0x1105C0: _$LT$std..io..error..Repr$u20$as$u20$core..fmt..Debug$GT$::fmt::h48cfe87c853aa8b2 (error.rs:508)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x13C9C5: write_fmt (mod.rs:1136)
==15546==    by 0x13C9C5: {{closure}} (builders.rs:91)
==15546==    by 0x13C9C5: and_then<(),core::fmt::Error,(),closure> (result.rs:601)
==15546==    by 0x13C9C5: core::fmt::builders::DebugStruct::field::h0cdc6f07946244db (builders.rs:79)
==15546==    by 0x116D58: _$LT$std..io..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::h474831f315b88964 (in /tmp/inf)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x11614D: write_fmt<collections::string::String> (mod.rs:130)
==15546==    by 0x11614D: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:498)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==    by 0x13C11D: core::panicking::panic_fmt::h3b2d1e30090844ff (panicking.rs:69)
==15546==    by 0x10DDC4: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==15546==
thread '<unnamed>' panicked at '==15546== Syscall param write(buf) points to uninitialised byte(s)
==15546==    at 0x52564BD: ??? (syscall-template.S:84)
==15546==    by 0x1109AF: write (fd.rs:79)
==15546==    by 0x1109AF: write (stdio.rs:57)
==15546==    by 0x1109AF: write (stdio.rs:72)
==15546==    by 0x1109AF: std::io::Write::write_all::h7c10a51290981adc (mod.rs:944)
==15546==    by 0x110D29: _$LT$std..io..Write..write_fmt..Adaptor$LT$$u27$a$C$$u20$T$GT$$u20$as$u20$core..fmt..Write$GT$::write_str::hded10b9de53cb4d5 (mod.rs:1004)
==15546==    by 0x13D415: core::fmt::write::ha410d2e3733df97b (mod.rs:831)
==15546==    by 0x110B42: std::io::Write::write_fmt::h0e5dfdfaa54059a4 (mod.rs:1015)
==15546==    by 0x11096E: std::io::impls::_$LT$impl$u20$std..io..Write$u20$for$u20$$RF$$u27$a$u20$mut$u20$W$GT$::write_fmt::h2b1de262c2db72a4 (impls.rs:56)
==15546==    by 0x115F02: std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::h6385b6959a2dd25b (panicking.rs:339)
==15546==    by 0x115B6E: std::panicking::default_hook::he4f3b61755d7fa95 (panicking.rs:365)
==15546==    by 0x1163B7: std::panicking::rust_panic_with_hook::hf00b8130f73095ec (panicking.rs:553)
==15546==    by 0x1161F4: std::panicking::begin_panic::h6227f62cb2cdaeb4 (panicking.rs:515)
==15546==    by 0x116169: std::panicking::begin_panic_fmt::h173eadd80ae64bec (panicking.rs:499)
==15546==    by 0x1160F7: rust_begin_unwind (panicking.rs:475)
==15546==  Address 0x6414046 is in a rw- anonymous segment
==15546==
called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 0, message: "Success" } }', /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs:837
note: Run with `RUST_BACKTRACE=1` for a backtrace.
==15546== Conditional jump or move depends on uninitialised value(s)
==15546==    at 0x10DDCC: core::result::unwrap_failed::h822856a25f2ebc35 (in /tmp/inf)
==15546==    by 0x11DF0A: __rust_maybe_catch_panic (lib.rs:98)
==15546==    by 0x10DF01: _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hd0e958eef64c8c8a (in /tmp/inf)
==15546==    by 0x1153B4: call_once<(),()> (boxed.rs:615)
==15546==    by 0x1153B4: start_thread (thread.rs:21)
==15546==    by 0x1153B4: std::sys::imp::thread::Thread::new::thread_start::he018521f53b24939 (thread.rs:84)
==15546==    by 0x524D6B9: start_thread (pthread_create.c:333)
==15546==    by 0x577F82C: clone (clone.S:109)
==15546==

@sfackler
Copy link
Member

Dup of #28728

@shepmaster
Copy link
Member Author

Dup of #28728

Agreed. The LLVM IR has the same telltale sign:

; Function Attrs: norecurse noreturn nounwind readnone uwtable
define internal void @_ZN3std9panicking3try7do_call17hf7fda4c0bc0de239E(i8* nocapture) unnamed_addr #1 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
entry-block:
  unreachable
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants