Skip to content

Tweaked trait example from tutorial fails in rustc/back/rpath.rs #3720

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

Closed
orpheuslummis opened this issue Oct 11, 2012 · 3 comments
Closed

Comments

@orpheuslummis
Copy link
Contributor

Code taken nearly as-is from tutorial, commit 39acb06.

trait Printable {
    fn print();
}

impl int: Printable {
    fn print() { io::println(fmt!("%d", self)); }
}

fn main() {
    10.print();
}

/*
rust: task failed at 'Assertion abs1.is_absolute failed', /home/o/src/rust/src/rustc/back/rpath.rs:118
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x5d)[0x7f9171936fdd]
/usr/local/bin/../lib/librustrt.so(+0x3325d)[0x7f917194f25d]
/usr/local/bin/../lib/librustrt.so(upcall_fail+0x1d0)[0x7f9171939930]
/usr/local/bin/../lib/librustc-c84825241471686d-0.4.so(+0x60f552)[0x7f917218e552]
/usr/local/bin/../lib/librustc-c84825241471686d-0.4.so(+0x60e7f6)[0x7f917218d7f6]
/usr/local/bin/../lib/librustc-c84825241471686d-0.4.so(_ZN4back5rpath15get_rpath_flags16_4b1763706b4aec33_04E+0xad3)[0x7f91721885d3]
/usr/local/bin/../lib/librustc-c84825241471686d-0.4.so(_ZN4back4link11link_binary16_8218abf33e87eed3_04E+0x34fe)[0x7f9172185fae]
/usr/local/bin/../lib/librustc-c84825241471686d-0.4.so(+0x665288)[0x7f91721e4288]
/usr/local/bin/../lib/librustc-c84825241471686d-0.4.so(_ZN6driver6driver12compile_upto17_8998633a7f2bbf783_04E+0x2707)[0x7f91721e2cc7]
/usr/local/bin/../lib/librustc-c84825241471686d-0.4.so(+0x68da10)[0x7f917220ca10]
/usr/local/bin/../lib/librustc-c84825241471686d-0.4.so(_ZN6driver6driver13compile_input16_d0f3f55082b28f63_04E+0xbd)[0x7f91721e4f0d]
rustc[0x408ea7]
rustc[0x412204]
rustc[0x40e683]
rustc[0x40d33c]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x757af)[0x7f9172f267af]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(+0xb5490)[0x7f9172f66490]
/usr/local/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7f9171937784]
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /home/o/src/rust/src/rustc/driver/rustc.rs:275
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x5d)[0x7f9171936fdd]
/usr/local/bin/../lib/librustrt.so(+0x3325d)[0x7f917194f25d]
/usr/local/bin/../lib/librustrt.so(upcall_fail+0x1d0)[0x7f9171939930]
rustc(_rust_main+0x838)[0x411a18]
rustc[0x412204]
/usr/local/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7f9171937784]
rust: domain main @0xcf5200 root task failed
rust: task failed at 'killed', /home/o/src/rust/src/libcore/task.rs:663
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x5d)[0x7f9171936fdd]
/usr/local/bin/../lib/librustrt.so(+0x3325d)[0x7f917194f25d]
/usr/local/bin/../lib/librustrt.so(upcall_fail+0x1d0)[0x7f9171939930]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(_ZN4task5yield16_9531951b4f79f8b3_04E+0xbd)[0x7f9172f0fd7d]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x90636)[0x7f9172f41636]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(_ZN7private11weaken_task16_c475fd76fb075e83_04E+0xd2)[0x7f9172f41472]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x9036b)[0x7f9172f4136b]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(+0xb5490)[0x7f9172f66490]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x8f6c0)[0x7f9172f406c0]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x8f05e)[0x7f9172f4005e]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x8e6c6)[0x7f9172f3f6c6]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x757af)[0x7f9172f267af]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.4.so(+0xb5490)[0x7f9172f66490]
/usr/local/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7f9171937784]
*/
@nikomatsakis
Copy link
Contributor

What operating system are you using?

@nikomatsakis
Copy link
Contributor

Hmm, linux I guess, based on the output.

@orpheuslummis
Copy link
Contributor Author

After re-installing Rust, I'm now failing to replicate the crash. The problem was almost certainly an "old library lurking around mucking things up". Closing.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Jul 14, 2024
Fix libc::read shim: make it write to a buffer correct amount of bytes. Add tests for new behavior

libc::read shim had a bug: if underlying real call libc::read(fd, buf, N) returns M, then
libc::read shim writes N bytes to buf instead of M. Remaining N - M bytes are filled with zeros.
This commit fixes this bug and adds tests for new behavior
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