解决Mac上During startup program terminated with signal SIG113, Real-time event 113.问题

在使用gdb调试过程中,run的时候遇到一个问题:

During startup program terminated with signal SIG113, Real-time event 113.

过程

编译:

gcc -g -Wall ideone_FVcyY0.c -o hello

执行报错:

(gdb) run
Starting program: /Users/ancongcong/Downloads/hello
During startup program terminated with signal SIG113, Real-time event 113.

解决

退出gdb后,在当前用户下,新增.gdbinit文件,内容如下:

set startup-with-shell off

顺利执行:

ancongcongdeMacBook-Pro:Downloads ancongcong$ sudo gdb hello
Password:
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 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-apple-darwin16.0.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello...Reading symbols from /Users/ancongcong/Downloads/hello.dSYM/Contents/Resources/DWARF/hello...done.
done.
(gdb) r
Starting program: /Users/ancongcong/Downloads/hello
warning: unhandled dyld version (15)
the position of 1 is 1
the position of 2 is 2
the position of 3 is 3
the position of 4 is 4
the position of 5 is 5
the position of 6 is 6
the position of 7 is 7
the position of 8 is 8
the position of 9 is 9
the position of 10 is 0

Program received signal SIGSEGV, Segmentation fault.
0x0000000100000cdd in printNode (l=0x1001002f0) at ideone_FVcyY0.c:135
135         printf("the position of %d is %d\n", i, p->data);
(gdb) bt
#0  0x0000000100000cdd in printNode (l=0x1001002f0) at ideone_FVcyY0.c:135
#1  0x0000000100000baa in main () at ideone_FVcyY0.c:29
0条留言