Skip to content

SIGSEGV compiling num-integer for asmjs-unknown-emscripten #66308

Closed
@cuviper

Description

@cuviper

On current num-integer master (commit f0e329af1195), rustc nightly and beta both crash when targeting asmjs-unknown-emscripten. Stable is fine.

   stable-x86_64-unknown-linux-gnu - rustc 1.39.0 (4560ea788 2019-11-04)
     beta-x86_64-unknown-linux-gnu - rustc 1.40.0-beta.1 (76b40532a 2019-11-05)
  nightly-x86_64-unknown-linux-gnu - rustc 1.40.0-nightly (3fc30d884 2019-11-10)
$ cargo +stable build --target asmjs-unknown-emscripten
   Compiling autocfg v0.1.7
   Compiling num-traits v0.2.8
   Compiling num-integer v0.1.41 (/home/jistone/rust/num/integer)
    Finished dev [unoptimized + debuginfo] target(s) in 2.60s
$ cargo +beta build --target asmjs-unknown-emscripten
   Compiling num-integer v0.1.41 (/home/jistone/rust/num/integer)
warning: `#[inline]` is ignored on function prototypes
   --> src/lib.rs:260:5
    |
260 |     #[inline]
    |     ^^^^^^^^^
    |
    = note: `#[warn(unused_attributes)]` on by default

Referencing function in another module!
  call void <badref>(i8* %40), !dbg !50
; ModuleID = '39eosbi6n9pwhhcp'
void (i8*)* <badref>
; ModuleID = '
error: could not compile `num-integer`.

Caused by:
  process didn't exit successfully: `rustc --crate-name num_integer src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=795c310a63594098 -C extra-filename=-795c310a63594098 --out-dir /home/jistone/rust/num/integer/target/asmjs-unknown-emscripten/debug/deps --target asmjs-unknown-emscripten -C incremental=/home/jistone/rust/num/integer/target/asmjs-unknown-emscripten/debug/incremental -L dependency=/home/jistone/rust/num/integer/target/asmjs-unknown-emscripten/debug/deps -L dependency=/home/jistone/rust/num/integer/target/debug/deps --extern num_traits=/home/jistone/rust/num/integer/target/asmjs-unknown-emscripten/debug/deps/libnum_traits-2f98a4660a35fd13.rmeta --cfg has_i128` (signal: 11, SIGSEGV: invalid memory reference)
$ cargo +nightly build --target asmjs-unknown-emscripten
   Compiling num-integer v0.1.41 (/home/jistone/rust/num/integer)
warning: `#[inline]` is ignored on function prototypes
   --> src/lib.rs:260:5
    |
260 |     #[inline]
    |     ^^^^^^^^^
    |
    = note: `#[warn(unused_attributes)]` on by default

Referencing function in another module!
  call void <badref>(i8* %40), !dbg !50
; ModuleID = '4z4jvx7urdbbg8j3'
void (i8*)* <badref>
; ModuleID = '
error: could not compile `num-integer`.

Caused by:
  process didn't exit successfully: `rustc --crate-name num_integer src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=947cae8a7fd914b6 -C extra-filename=-947cae8a7fd914b6 --out-dir /home/jistone/rust/num/integer/target/asmjs-unknown-emscripten/debug/deps --target asmjs-unknown-emscripten -C incremental=/home/jistone/rust/num/integer/target/asmjs-unknown-emscripten/debug/incremental -L dependency=/home/jistone/rust/num/integer/target/asmjs-unknown-emscripten/debug/deps -L dependency=/home/jistone/rust/num/integer/target/debug/deps --extern num_traits=/home/jistone/rust/num/integer/target/asmjs-unknown-emscripten/debug/deps/libnum_traits-1f95a1b3834a3c5f.rmeta --cfg has_i128` (signal: 11, SIGSEGV: invalid memory reference)

(The inline attribute warning is irrelevant to success/failure, but I'll clean that up separately.)

cc @mashedcode rust-num/num-integer#28

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-asmjsTarget: asm.js - http://asmjs.org/O-emscriptenTarget: 50% off wasm32-unknown-musl. the savings come out of stdio.h, but hey, you get SDL!P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions