Skip to content

Instantly share code, notes, and snippets.

@swgillespie
Created July 30, 2015 19:56
Show Gist options
  • Save swgillespie/f893fcf507b763535313 to your computer and use it in GitHub Desktop.
Save swgillespie/f893fcf507b763535313 to your computer and use it in GitHub Desktop.
[sean ~/Documents/workspace/rust/playground]
$ rustc -O test.rs -o test
test.rs:2:1: 4:2 warning: function cannot return without recurring, #[warn(unconditional_recursion)] on by default
test.rs:2 fn infinite_box() -> Box<i32> {
test.rs:3 infinite_box()
test.rs:4 }
test.rs:3:5: 3:19 note: recursive call site
test.rs:3 infinite_box()
^~~~~~~~~~~~~~
test.rs:2:1: 4:2 help: a `loop` may express intention better if this is on purpose
[sean ~/Documents/workspace/rust/playground]
$ ./test
Illegal instruction (core dumped)
[sean ~/Documents/workspace/rust/playground]
$ rust-gdb ./test
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/sean/Documents/workspace/rust/playground/test...done.
(gdb) run
Starting program: /home/sean/Documents/workspace/rust/playground/./test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x000055555558c1fa in fmt::num::i32.fmt..Display::fmt::h8ba6859d53938253j8M ()
(gdb) bt
#0 0x000055555558c1fa in fmt::num::i32.fmt..Display::fmt::h8ba6859d53938253j8M ()
#1 0x000055555558c856 in fmt::write::h7452e69a2e443c14KfO ()
#2 0x000055555555bb69 in io::stdio::Stdout.Write::write_fmt::hee79b296251b6be0p0g ()
#3 0x000055555555c5a9 in io::stdio::_print::h6873906f04819a7de6g ()
#4 0x0000555555558a5f in main::hdefed3b0bf7dec05laa ()
#5 0x000055555555fae0 in __rust_try_inner ()
#6 0x000055555555fb1b in __rust_try ()
#7 0x0000555555561e98 in rt::lang_start::hfb6a2064aefbb754Bix ()
#8 0x00007ffff71f4de5 in __libc_start_main (main=0x555555558a70 <main>, argc=1,
ubp_av=0x7fffffffe1f8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffe1e8) at libc-start.c:260
#9 0x00005555555588f9 in _start ()
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment