Skip to content

optimize error? (cargo release build is failed, cargo debug build is successed) #7

@takurx

Description

@takurx

It's strange. Is it might be depend to be update library, crates.io? Thanks.

  • cargo release build is failed
pi@raspberry:~/demod $ cargo build --release
   Compiling libc v0.2.39
   Compiling num-traits v0.2.1
   Compiling rustc-serialize v0.3.24
   Compiling unicode-width v0.1.4
   Compiling vec_map v0.8.0
   Compiling strsim v0.7.0
error: Could not compile `libc`.

Caused by:
  process didn't exit successfully: `rustc --crate-name libc /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.39/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="use_std"' -C metadata=caac43181e7a38c2 -C extra-filename=-caac43181e7a38c2 --out-dir /home/pi/demod/target/release/deps -L dependency=/home/pi/demod/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
thread '<unnamed>' panicked at 'src/librustc_codegen_ssa/back/write.rs:1545: worker thread panicked', src/librustc/util/bug.rs:37:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: failed to parse bitcode for LTO module: file doesn't start with bitcode header

error: aborting due to previous error

free(): invalid next size (fast)
error: Could not compile `strsim`.

Caused by:
  process didn't exit successfully: `rustc --crate-name strsim /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/strsim-0.7.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=e69152eb05c2cfdc -C extra-filename=-e69152eb05c2cfdc --out-dir /home/pi/demod/target/release/deps -L dependency=/home/pi/demod/target/release/deps --cap-lints allow` (signal: 6, SIGABRT: process abort signal)
warning: build failed, waiting for other jobs to finish...
error: Could not compile `num-traits`.

Caused by:
  process didn't exit successfully: `rustc --crate-name num_traits /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/num-traits-0.2.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=ba597cbdaa1cf83d -C extra-filename=-ba597cbdaa1cf83d --out-dir /home/pi/demod/target/release/deps -L dependency=/home/pi/demod/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: Could not compile `rustc-serialize`.

Caused by:
  process didn't exit successfully: `rustc --crate-name rustc_serialize /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.24/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=bdf678104c710bcc -C extra-filename=-bdf678104c710bcc --out-dir /home/pi/demod/target/release/deps -L dependency=/home/pi/demod/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
  • cargo debug build is successed
pi@raspberry:~/demod $ cargo build
   Compiling libc v0.2.39
   Compiling num-traits v0.2.1
   Compiling rustc-serialize v0.3.24
   Compiling unicode-width v0.1.4
   Compiling vec_map v0.8.0
   Compiling bitflags v1.0.1
   Compiling ansi_term v0.11.0
   Compiling strsim v0.7.0
   Compiling textwrap v0.9.0
   Compiling rand v0.4.2
   Compiling atty v0.2.8
   Compiling num-integer v0.1.36
   Compiling clap v2.31.1
   Compiling num-iter v0.1.35
   Compiling num-bigint v0.1.43
   Compiling num-complex v0.1.43
   Compiling num-rational v0.1.42
   Compiling num v0.1.42
   Compiling liquid_dsp v0.3.0 (https://github.com/cubehub/rust-liquid-dsp.git#343bf9bd)
   Compiling demod v0.9.7 (/home/pi/demod)
    Finished dev [unoptimized + debuginfo] target(s) in 1m 42s

I append Cargo.toml, release build option.

  • Cargo.toml
[profile.release]
opt-level = 0

It can build unoptimize release build.

pi@raspberry:~/demod $ cargo build --release
   Compiling libc v0.2.39
   Compiling num-traits v0.2.1
   Compiling rustc-serialize v0.3.24
   Compiling unicode-width v0.1.4
   Compiling vec_map v0.8.0
   Compiling strsim v0.7.0
   Compiling bitflags v1.0.1
   Compiling ansi_term v0.11.0
   Compiling textwrap v0.9.0
   Compiling rand v0.4.2
   Compiling atty v0.2.8
   Compiling num-integer v0.1.36
   Compiling clap v2.31.1
   Compiling num-iter v0.1.35
   Compiling num-bigint v0.1.43
   Compiling num-complex v0.1.43
   Compiling num-rational v0.1.42
   Compiling num v0.1.42
   Compiling liquid_dsp v0.3.0 (https://github.com/cubehub/rust-liquid-dsp.git#343bf9bd)
   Compiling demod v0.9.7 (/home/pi/demod)
    Finished release [unoptimized] target(s) in 1m 27s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions