murarth / rusti

REPL for the Rust programming language
Other
1.32k stars 58 forks source link

Assertion failed (crash) on Windows #88

Open akavel opened 8 years ago

akavel commented 8 years ago
C:\prog\rusti>cargo run -v
       Fresh winapi-build v0.1.1
       Fresh assert_matches v1.0.1
       Fresh regex-syntax v0.3.4
       Fresh getopts v0.2.14
       Fresh cfg-if v0.1.0
       Fresh winapi v0.2.8
       Fresh log v0.3.6
       Fresh utf8-ranges v0.1.3
       Fresh void v1.0.2
       Fresh ole32-sys v0.2.0
       Fresh kernel32-sys v0.2.2
       Fresh bitflags v0.4.0
       Fresh semver v0.1.20
       Fresh libc v0.2.15
       Fresh rustc_version v0.1.7
       Fresh memchr v0.1.11
       Fresh thread-id v2.0.0
       Fresh rand v0.3.14
       Fresh shell32-sys v0.1.1
       Fresh thread_local v0.2.6
       Fresh tempfile v1.1.3
       Fresh aho-corasick v0.5.2
       Fresh regex v0.1.73
       Fresh nix v0.6.0
       Fresh env_logger v0.3.4
       Fresh linefeed v0.1.0
       Fresh rusti v0.0.1 (file:///C:/prog/rusti)
    Finished debug [unoptimized + debuginfo] target(s) in 0.23 secs
     Running `target\debug\rusti.exe`
rusti=> println!("Helo");
Assertion failed!

Program: C:\prog\rusti\target\debug\rusti.exe
File: C:/bot/slave/nightly-dist-rustc-win-gnu-64/build/src/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp, Line 198

Expression: M->getDataLayout() == getDataLayout() && "DataLayout Mismatch"

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
error: Process didn't exit successfully: `target\debug\rusti.exe` (exit code: 3)

See also: https://github.com/murarth/rusti/issues/39#issuecomment-241894475 — my environment is still the same, with newest rusti (f9a5ded292a30dc93059f9baec89dcbcc8299719).

murarth commented 8 years ago

What's the output of rustc -vV?

akavel commented 8 years ago
C:\prog\rusti>rustc -vV
rustc 1.12.0-nightly (7333c4ac2 2016-07-31)
binary: rustc
commit-hash: 7333c4ac25648e831fb2033ee77fbbdc62ae492a
commit-date: 2016-07-31
host: x86_64-pc-windows-gnu
release: 1.12.0-nightly

Also, the same crash happens in nightly-2016-07-29, while the earlier ones seem not to compile. The -msvc nightly has the same message, but it shows in a popup window, so it's harder to paste.

murarth commented 8 years ago

You'll have to check out an older revision of rusti to compile with an older nightly. Look for commit messages containing "Fix for nightly".

When you find a nightly build that works, let me know and I'll add a note to the README about it. It's too late to fix any of this in the Rust compiler because it's no longer supported.

akavel commented 8 years ago

I went back as far as I could without merge conflicts while rebasing the linefeed-adding patches (excluding README.md and Cargo.lock). This way, I managed to reach rust nightly-2016-05-10 (rusti commit 4d0b3a68db3e925d3d6a9132ec3c40c71cf1083c) — but unfortunately I still encountered exactly the same crash message. (I don't know if it's important, but I had to delete Cargo.lock each time, otherwise I got weird cargo conflict on libc version 0.2.4.) I can't rebase any deeper because of merge conflicts.

murarth commented 8 years ago

Strange. I don't know how this error could be happening. Up until about 2016-08-01, there were still ExecutionEngine tests in the Rust compiler, which must have been passing on supported Windows platforms.

akavel commented 8 years ago

Doesn't the commit message in https://github.com/rust-lang/rust/pull/35174/commits/81df89fc2d6ba1b55ab20b0615b8523a6e90963f explicitly claim "the code has no tests"?

murarth commented 8 years ago

The test had been removed just a few days prior: https://github.com/rust-lang/rust/pull/34743/commits/5fa55781bd77f7a9fbdb3af8fa4e1b0cd0b1cf06

The test was skipped on -msvc Windows builds, but it should still have been passing on -gnu builds.