Skip to content

Instantly share code, notes, and snippets.

@mariash
Last active August 29, 2015 14:02
Show Gist options
  • Save mariash/2a5d6203be5ff22ec971 to your computer and use it in GitHub Desktop.
Save mariash/2a5d6203be5ff22ec971 to your computer and use it in GitHub Desktop.
Debugging stuck ruby process with GDB
(gdb) call (void) close(1)
(gdb) call (void) close(2)
(gdb) shell tty
/dev/pts/1
(gdb) call (int) open("/dev/pts/1", 2, 0)
(gdb) call (int) open("/dev/pts/1", 2, 0)
(gdb) call (void)rb_backtrace()
(gdb) call rb_raise((int)rb_eException, "Raised a special exception with GDB")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment