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

Integer literals >= 2^64 cause an ICE #5544

Closed
dotdash opened this issue Mar 25, 2013 · 3 comments
Closed

Integer literals >= 2^64 cause an ICE #5544

dotdash opened this issue Mar 25, 2013 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@dotdash
Copy link
Contributor

dotdash commented Mar 25, 2013

Compiling the following code causes an ICE.

fn main() {
    18446744073709551616; // 2^64
}
rust: task failed at 'option::get none', /home/doener/src/rust/src/libcore/option.rs:120
/home/doener/rust/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x4b)[0x7fc8fa1b184b]
/home/doener/rust/bin/../lib/librustrt.so(+0x30319)[0x7fc8fa1c2319]
/home/doener/rust/bin/../lib/librustrt.so(upcall_fail+0x190)[0x7fc8fa1b3690]
/home/doener/rust/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x10a1ab)[0x7fc8f9dcd1ab]
/home/doener/rust/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x10a152)[0x7fc8f9dcd152]
/home/doener/rust/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(_ZN3sys12begin_unwind16_701b8ec61f97ead3_06E+0x71)[0x7fc8f9d15841]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(+0x10cf25)[0x7fc8f971ef25]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(+0x102c55)[0x7fc8f9714c55]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(_ZN5parse5lexer14__extensions__10meth_1681410next_token17_46ecd451e4b6361c3_06E+0xba)[0x7fc8f971697a]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(_ZN5parse6parser14__extensions__10meth_174734bump17_cc8cd713cfdf7f6c3_06E+0x132)[0x7fc8f972bb32]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(+0x15b1e7)[0x7fc8f976d1e7]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(_ZN5parse6parser14__extensions__10meth_1841613parse_fn_decl16_847e1cb35da7f3f3_06E+0x15a)[0x7fc8f976ce1a]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(_ZN5parse6parser14__extensions__10meth_1855213parse_item_fn17_cb56601fe7e684633_06E+0x95)[0x7fc8f976ed05]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(_ZN5parse6parser14__extensions__10meth_1828923parse_item_or_view_item17_b7112d89c177a06a3_06E+0x1354)[0x7fc8f975f6c4]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(+0x2b08ac)[0x7fc8f98c28ac]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(_ZN5parse6parser14__extensions__10meth_1832926parse_items_and_view_items17_4cf5a4d3b7d634203_06E+0x836)[0x7fc8f97690d6]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(_ZN5parse6parser14__extensions__10meth_1868315parse_mod_items16_3aa5bd39291b4d43_06E+0x103)[0x7fc8f9777093]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(_ZN5parse6parser14__extensions__10meth_1901115parse_crate_mod16_4138d84126fc07b3_06E+0x19d)[0x7fc8f978d28d]
/home/doener/rust/bin/../lib/libsyntax-84efebcb12c867a2-0.6.so(_ZN5parse21parse_crate_from_file17_38b21f4bf6f75f523_06E+0x2b5)[0x7fc8f97b08b5]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6driver6driver11parse_input17_a3fbdc6919cc6b433_06E+0x12a)[0x7fc8f933c3aa]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(+0x876272)[0x7fc8f9343272]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(+0x874cbd)[0x7fc8f9341cbd]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6driver6driver12compile_upto15_21520a9e080fd23_06E+0xb8)[0x7fc8f9342ec8]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8b4a84)[0x7fc8f9381a84]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6driver6driver13compile_input15_ae4c33c633a6213_06E+0xca)[0x7fc8f934335a]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN12run_compiler16_9519af6f87b57e43_06E+0x2141)[0x7fc8f9372e41]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8b2551)[0x7fc8f937f551]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8aed2c)[0x7fc8f937bd2c]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8b4a84)[0x7fc8f9381a84]
/home/doener/rust/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xd3f8e)[0x7fc8f9d96f8e]
/home/doener/rust/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x152760)[0x7fc8f9e15760]
/home/doener/rust/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7fc8fa1b2094]
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=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /home/doener/src/rust/src/librustc/rustc.rc:359
/home/doener/rust/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x4b)[0x7fc8fa1b184b]
/home/doener/rust/bin/../lib/librustrt.so(+0x30319)[0x7fc8fa1c2319]
/home/doener/rust/bin/../lib/librustrt.so(upcall_fail+0x190)[0x7fc8fa1b3690]
/home/doener/rust/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x10a1ab)[0x7fc8f9dcd1ab]
/home/doener/rust/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x10a152)[0x7fc8f9dcd152]
/home/doener/rust/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(_ZN3sys12begin_unwind16_701b8ec61f97ead3_06E+0x71)[0x7fc8f9d15841]
/home/doener/rust/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x152760)[0x7fc8f9e15760]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN7monitor15_916fc337c0fcac3_06E+0x1627)[0x7fc8f93754d7]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8b4a84)[0x7fc8f9381a84]
/home/doener/rust/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN4main16_706f4ee7413ae583_06E+0x7e)[0x7fc8f938169e]
/home/doener/rust/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7fc8fa1b2094]
rust: domain main @0xf933c0 root task failed
@Kimundi
Copy link
Member

Kimundi commented Mar 26, 2013

Might be because the number parser detected an overflow and returned None

@huonw
Copy link
Member

huonw commented Apr 6, 2013

Strangely, it doesn't fail for some literals, e.g. a hex literal that is a repeat of a single digit, like 0xfffff...fff where there can be any number of fs.

huonw added a commit to huonw/rust that referenced this issue Apr 8, 2013
bors added a commit that referenced this issue Apr 8, 2013
…nger

Addresses #5544 and #5770, as well as a comment left in the documentation of `from_str_bytes_common`, so that there is now an option to ignore underscores.
@huonw
Copy link
Member

huonw commented Apr 8, 2013

This can be closed now that #5776 has landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants