Skip to content

Crash in program compiled with nightly #49275

New issue

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

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

Already on GitHub? # to your account

Closed
palango opened this issue Mar 22, 2018 · 3 comments
Closed

Crash in program compiled with nightly #49275

palango opened this issue Mar 22, 2018 · 3 comments
Labels
C-bug Category: This is a bug. I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness

Comments

@palango
Copy link
Contributor

palango commented Mar 22, 2018

This seems like a regression in the compiler.

Let's create a checkout of the glium crate.

git clone git@github.com:glium/glium.git
cd glium

Now, when running the tutorial-02 example with stable, it works fine and it shows a window with some gl output.

RUST_BACKTRACE=1 cargo run --example tutorial-02                                                             15:26:49
   Compiling glium v0.20.0 (file:///Users/paul/Projects/rust/repos/glium)
    Finished dev [unoptimized + debuginfo] target(s) in 5.93 secs
     Running `target/debug/examples/tutorial-02`

When running with rustc 1.26.0-nightly (75af15ee6 2018-03-20) The program crashes while running.

RUST_BACKTRACE=1 rustup run nightly cargo run --example tutorial-02                                          15:27:01
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/examples/tutorial-02`
thread 'main' panicked at '~~~weak dyld: malformed executable '%s', skipping indirect symbol to %s
dyld: interp', /Users/paul/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/winit-0.10.0/src/platform/macos/window.rs:348:13
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:207
   3: std::panicking::default_hook
             at libstd/panicking.rs:223
   4: std::panicking::begin_panic
             at libstd/panicking.rs:402
   5: std::panicking::try::do_call
             at libstd/panicking.rs:349
   6: winit::platform::platform::window::Window2::new
             at /Users/paul/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/winit-0.10.0/src/platform/macos/window.rs:348
   7: winit::platform::platform::Window::new
             at /Users/paul/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/winit-0.10.0/src/platform/macos/mod.rs:32
   8: <T as core::convert::From<T>>::from
             at /Users/paul/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/winit-0.10.0/src/window.rs:119
   9: glutin::platform::platform::Context::new
             at /Users/paul/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/glutin-0.12.2/src/platform/macos/mod.rs:48
  10: <T as core::convert::From<T>>::from
             at /Users/paul/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/glutin-0.12.2/src/lib.rs:313
  11: core::num::ptr_try_from_impls::<impl core::convert::TryFrom<usize> for u32>::try_from
             at src/backend/glutin/mod.rs:70
  12: tutorial_02::main
             at examples/tutorial-02.rs:10
  13: std::rt::lang_start::{{closure}}
             at /Users/travis/build/rust-lang/rust/src/libstd/rt.rs:74
  14: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:306
  15: panic_unwind::dwarf::eh::read_encoded_pointer
             at libpanic_unwind/lib.rs:102
  16: std::io::Write::write_all
             at libstd/panicking.rs:285
             at libstd/panic.rs:361
             at libstd/rt.rs:58
  17: std::rt::lang_start
             at /Users/travis/build/rust-lang/rust/src/libstd/rt.rs:74
  18: <tutorial_02::main::Vertex as glium::vertex::Vertex>::build_bindings
[1]    78750 segmentation fault  RUST_BACKTRACE=1 rustup run nightly cargo run --example tutorial-02
@Centril Centril added I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness C-bug Category: This is a bug. labels Mar 24, 2018
@uberjay
Copy link

uberjay commented Apr 9, 2018

I bisected this and am pretty sure this came in with 9b15ddb, which was the majority of the changes (5ebf748) for #47630 (Stabilise feature(never_type). Introduce feature(exhaustive_patterns)).

The commit prior to that merge (521d91c) is fine.

Hope that's helpful -- I don't (yet?) know enough about the compiler (or Rust for that matter :) to know what might be going on here...

@uberjay
Copy link

uberjay commented Apr 9, 2018

Ah, it looks like this has been resolve in the winit crate already - rust-windowing/winit@559681b

(both of the changes are in unsafe blocks which made assumptions about inference, so perhaps this can be closed!)

@palango
Copy link
Contributor Author

palango commented Apr 9, 2018

This was a problem in the winitcrate.

@palango palango closed this as completed Apr 9, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
Projects
None yet
Development

No branches or pull requests

3 participants