Skip to content
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

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

Open
takurx opened this issue Sep 27, 2019 · 4 comments

Comments

@takurx
Copy link
Contributor

takurx commented Sep 27, 2019

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
@andresv
Copy link
Member

andresv commented Sep 27, 2019

Could you try again, I just updated a lot of dependencies.

@takurx
Copy link
Contributor Author

takurx commented Sep 30, 2019

I have reproduced it.

pi@raspberry:~/demod $ cargo build --release
    Updating crates.io index
    Updating git repository `https://github.com/cubehub/rust-liquid-dsp.git`
  Downloaded clap v2.33.0
  Downloaded libc v0.2.62
  Downloaded num v0.2.0
  Downloaded ansi_term v0.11.0
  Downloaded bitflags v1.2.0
  Downloaded unicode-width v0.1.6
  Downloaded atty v0.2.13
  Downloaded vec_map v0.8.1
  Downloaded strsim v0.8.0
  Downloaded textwrap v0.11.0
  Downloaded num-rational v0.2.2
  Downloaded num-bigint v0.2.3
  Downloaded num-integer v0.1.41
  Downloaded num-iter v0.1.39
  Downloaded num-complex v0.2.3
  Downloaded num-traits v0.2.8
  Downloaded autocfg v0.1.6
   Compiling autocfg v0.1.6
   Compiling libc v0.2.62
   Compiling bitflags v1.2.0
   Compiling unicode-width v0.1.6
   Compiling strsim v0.8.0
error: Could not compile `libc`.

Caused by:
  process didn't exit successfully: `rustc --crate-name build_script_build /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.62/build.rs --color always --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=b79e3ef31fa8c249 -C extra-filename=-b79e3ef31fa8c249 --out-dir /home/pi/demod/target/release/build/libc-b79e3ef31fa8c249 -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...
double free or corruption (out)
error: Could not compile `bitflags`.

Caused by:
  process didn't exit successfully: `rustc --crate-name build_script_build /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.2.0/build.rs --color always --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' -C metadata=b8f67689abe13aac -C extra-filename=-b8f67689abe13aac --out-dir /home/pi/demod/target/release/build/bitflags-b8f67689abe13aac -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...
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 0, error_len: Some(1) }', src/libcore/result.rs:1084:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
thread '<unnamed>' panicked at 'src/librustc_codegen_ssa/back/write.rs:1545: worker thread panicked', src/librustc/util/bug.rs:37:26
munmap_chunk(): invalid pointer
error: Could not compile `autocfg`.

Caused by:
  process didn't exit successfully: `rustc --crate-name autocfg /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/autocfg-0.1.6/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=3b7b41b4cb553f95 -C extra-filename=-3b7b41b4cb553f95 --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 `strsim`.

Caused by:
  process didn't exit successfully: `rustc --crate-name strsim /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/strsim-0.8.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=f897199e27a3f25a -C extra-filename=-f897199e27a3f25a --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)
pi@raspberry:~/demod $ cargo build
   Compiling autocfg v0.1.6
   Compiling libc v0.2.62
   Compiling bitflags v1.2.0
   Compiling unicode-width v0.1.6
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.1
   Compiling strsim v0.8.0
   Compiling textwrap v0.11.0
   Compiling num-traits v0.2.8
   Compiling num-integer v0.1.41
   Compiling num-bigint v0.2.3
   Compiling num-rational v0.2.2
   Compiling num-complex v0.2.3
   Compiling num-iter v0.1.39
   Compiling atty v0.2.13
   Compiling clap v2.33.0
   Compiling num v0.2.0
   Compiling liquid_dsp v0.3.0 (https://github.com/cubehub/rust-liquid-dsp.git#343bf9bd)
   Compiling demod v0.9.8 (/home/pi/demod)
    Finished dev [unoptimized + debuginfo] target(s) in 2m 08s

@andresv
Copy link
Member

andresv commented Sep 30, 2019

I should try it on RPi.

@takurx
Copy link
Contributor Author

takurx commented Oct 1, 2019

Surely. Excuse me, it is specific RPi's problem. I have checked no problem on laptop PC (Ubuntu 18.04.2 LTS, intel core i7). Thanks.

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

2 participants