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

internal compiler error when running tarpaulin #100

Closed
AmarOk1412 opened this issue Apr 15, 2018 · 10 comments
Closed

internal compiler error when running tarpaulin #100

AmarOk1412 opened this issue Apr 15, 2018 · 10 comments

Comments

@AmarOk1412
Copy link

AmarOk1412 commented Apr 15, 2018

A description of the problem

I try to run tarpaulin on my project. And cargo tarpaulin -v doesn't like it.

Tarpaulin output

Running Tarpaulin
Cleaning project
Building project
   Compiling siphasher v0.2.2
   Compiling itoa v0.4.1
   Compiling gcc v0.3.54
   Compiling dtoa v0.4.2
   Compiling regex v0.2.10
   Compiling unicode-normalization v0.1.5
   Compiling take v0.1.0
   Compiling ucd-util v0.1.1
   Compiling lazy_static v1.0.0
   Compiling route-recognizer v0.1.12
   Compiling build_const v0.2.0
   Compiling cc v1.0.9
   Compiling safemem v0.2.0
   Compiling termcolor v0.3.6
   Compiling lazycell v0.6.0
   Compiling lazy_static v0.2.11
   Compiling cpython v0.2.0
   Compiling futures v0.1.21
   Compiling unicode-xid v0.1.0
   Compiling bitflags v0.9.1
   Compiling cfg-if v0.1.2
   Compiling quick-error v1.2.1
   Compiling num-traits v0.2.2
   Compiling matches v0.1.6
   Compiling openssl-probe v0.1.2
   Compiling typeable v0.1.2
   Compiling scopeguard v0.3.3
   Compiling libc v0.2.40
   Compiling memoffset v0.2.1
   Compiling itoa v0.3.4
   Compiling pkg-config v0.3.9
   Compiling percent-encoding v1.0.1
   Compiling bitflags v1.0.1
   Compiling byteorder v1.2.2
   Compiling modifier v0.1.0
   Compiling slab v0.4.0
   Compiling linked-hash-map v0.4.2
   Compiling antidote v1.0.0
   Compiling slab v0.3.0
   Compiling smallvec v0.2.1
   Compiling version_check v0.1.3
   Compiling openssl v0.9.24
   Compiling serde v1.0.37
   Compiling adler32 v1.0.2
   Compiling utf8-ranges v1.0.0
   Compiling httparse v1.2.4
   Compiling language-tags v0.2.2
   Compiling void v1.0.2
   Compiling scoped-tls v0.1.1
   Compiling nodrop v0.1.12
   Compiling traitobject v0.1.0
   Compiling foreign-types-shared v0.1.1
   Compiling regex-syntax v0.5.3
   Compiling crc v1.7.0
   Compiling proc-macro2 v0.3.6
   Compiling log v0.4.1
   Compiling crossbeam-utils v0.2.2
   Compiling encoding_rs v0.7.2
   Compiling crossbeam-utils v0.3.2
   Compiling humantime v1.1.1
   Compiling unicode-bidi v0.3.4
   Compiling libdbus-sys v0.1.3
   Compiling ncurses v5.91.0
   Compiling libsqlite3-sys v0.9.1
   Compiling openssl-sys v0.9.28
   Compiling net2 v0.2.32
   Compiling iovec v0.1.2
   Compiling rand v0.4.2
   Compiling time v0.1.39
   Compiling memchr v2.0.1
   Compiling atty v0.2.8
   Compiling num_cpus v1.8.0
   Compiling base64 v0.9.0
   Compiling base64 v0.6.0
   Compiling lru-cache v0.1.1
   Compiling unicase v2.1.0
   Compiling unicase v1.4.2
   Compiling num-traits v0.1.43
   Compiling unreachable v1.0.0
   Compiling arrayvec v0.4.7
   Compiling tokio-service v0.1.0
   Compiling relay v0.1.1
   Compiling tokio-executor v0.1.2
   Compiling foreign-types v0.3.2
   Compiling unsafe-any v0.4.2
   Compiling log v0.3.9
   Compiling idna v0.1.4
   Compiling quote v0.5.1
   Compiling bytes v0.4.6
   Compiling mio v0.6.14
   Compiling aho-corasick v0.6.4
   Compiling futures-cpupool v0.1.8
   Compiling rand v0.3.22
   Compiling thread_local v0.3.5
   Compiling typemap v0.3.3
   Compiling tokio-timer v0.2.1
   Compiling crossbeam-epoch v0.4.1
   Compiling mime v0.2.6
   Compiling uuid v0.5.1
   Compiling syn v0.13.1
   Compiling tokio-io v0.1.6
   Compiling dbus v0.6.1
   Compiling libflate v0.1.14
   Compiling plugin v0.2.6
   Compiling url v1.7.0
   Compiling serde_json v1.0.13
   Compiling rusqlite v0.13.0
error: internal compiler error: /checkout/src/librustc/ty/subst.rs:424: Region parameter out of range when substituting in region 'a (root type=Some(unsafe fn(*mut <Self as foreign_types::ForeignTypeRef>::CType) -> &'a mut Self {<Self as foreign_types::ForeignTypeRef>::from_ptr_mut::<'a>})) (index=1)

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.24.0 (4d90ac38c 2018-02-12) running on x86_64-unknown-linux-gnu

thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:451:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: Could not compile `openssl`.
warning: build failed, waiting for other jobs to finish...
Error: failed to compile: build failed
Error during run

The rust project you ran Tarpaulin on

https://github.com/AmarOk1412/rori_core

Your linux distro and version (output of uname -a is sufficient)

Tested on various distros Linux tars3 4.15.7-300.fc27.x86_64

Version of rustc used

$ rustc --version
rustc 1.24.0 (4d90ac38c 2018-02-12)

Have a nice day!

@AmarOk1412 AmarOk1412 changed the title Building project fails internal compiler error when running tarpaulin Apr 15, 2018
@xd009642
Copy link
Owner

Hi thanks for the issue, I'll have a look into this after work but in the meantime as the error is inside rustc it'll be worthwhile raising the issue there as well.

@AmarOk1412
Copy link
Author

I just did it here because cargo build with the same rustc version is working well. So I don't think this is rustc related.

@xd009642
Copy link
Owner

Cargo builds the test binaries with passing additional flags to rustc so they can be instrumented for coverage and it triggered an internal compiler error so it is an issue in rustc. However, the issue might be you missing dependencies. Have you got the development packages for ssl installed? On Ubuntu/Debian it's libssl-dev on fedora/RHEL/Centos it's openssl-devel (iirc).

I'm just downloading your project to test it myself right now

@xd009642
Copy link
Owner

xd009642 commented Apr 16, 2018

Also, rust 1.24 is pretty old, you might want to update to latest stable, and also provide a backtrace for the panic please?

@AmarOk1412
Copy link
Author

AmarOk1412 commented Apr 16, 2018

Yeah I got openssl-devel (openssl-devel-1:1.1.0h-3.fc27.x86_64) But I use it in several projects with different libssl providers so I'll check asap which one is used.

For rustc it was on this device but on rust stable and nightly from travis, the error is the same.

@AmarOk1412
Copy link
Author

AmarOk1412 commented Apr 16, 2018

Yup same error

error: internal compiler error: librustc/ty/subst.rs:424: Region parameter out of range when substituting in region 'a (root type=Some(unsafe fn(*mut <Self as foreign_types::ForeignTypeRef>::CType) -> &'a mut Self {<Self as foreign_types::ForeignTypeRef>::from_ptr_mut::<'a>})) (index=1)

thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:482:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.25.0 (84203cac6 2018-03-25) running on x86_64-unknown-linux-gnu

error: Could not compile `openssl`.
warning: build failed, waiting for other jobs to finish...
Error: failed to compile: build failed
Error during run
 ldd target/debug/rori
	libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007f7bed95e000)
	libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007f7bed4d6000)

And it comes from the correct libs, not my versions

rpm -qf /lib64/libssl.so*   
openssl-devel-1.1.0h-3.fc27.x86_64
compat-openssl10-1.0.2o-1.fc27.x86_64
compat-openssl10-1.0.2o-1.fc27.x86_64
openssl-libs-1.1.0h-3.fc27.x86_64
openssl-libs-1.1.0h-3.fc27.x86_64

When I'll have the time to dig, I'll try to replicate with less code and submit a bug on the rustc repo

@xd009642
Copy link
Owner

I believe I've found the error responsible for this rust-lang/rust#47309 closed march 16th so that might have been too late to make it into 1.26 stable. If you try on the latest nightly it may work.

It's caused by linking dead code when building with openssl, unfortunately tarpaulin needs to link dead code as dead code makes up a subset of uncovered code.

@AmarOk1412
Copy link
Author

Nice catch. I'll try this.

@AmarOk1412
Copy link
Author

@xd009642 I close this. It works with nightly.

Coverage Results
src/main.rs: 0/112
src/rori/account.rs: 5/7
src/rori/api.rs: 30/41
src/rori/database.rs: 89/89
src/rori/interaction.rs: 6/8
src/rori/manager.rs: 102/203
src/rori/module.rs: 17/18
src/rori/modulemanager.rs: 22/23
src/rori/server.rs: 247/283
src/rori/user.rs: 8/8
tests/mocks/mod.rs: 44/52
tests/test_api.rs: 43/47
tests/test_database.rs: 142/143
tests/test_manager.rs: 78/82
tests/test_server.rs: 393/421
tests/tests_modules.rs: 102/106

80.83% coverage, 1328/1643 lines covered
Tarpaulin finished

Thx!

@xd009642
Copy link
Owner

No problem glad I could help 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants