यदि प्रोग्राम एसआईजीएसईजीवी का पता लगाता है, तो भी जीडीबी को इसे पहले प्राप्त करना चाहिए और आपको कार्यक्रम को डीबग करने का अवसर देना चाहिए। क्या आपने
handle SIGSEGV nostop
जीडीबी में कुछ किया है? यदि ऐसा है तो ऐसा क्यों हो सकता है कि यह रोक नहीं रहा है।
क्या आप वाकई एक segfault वास्तव में हो रहा है? क्या आप इस व्यवहार को किसी अन्य प्रोग्राम के साथ डुप्लिकेट कर सकते हैं, या जानबूझकर सेगमेंटेशन उल्लंघन का कारण बन सकते हैं?
उदाहरण के लिए:
$ cat sig.c
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
void handle(int n)
{
puts("Bail");
exit(1);
}
int main()
{
signal(SIGSEGV, handle);
int *pi = 0;
*pi = 10;
return 0;
}
$ gcc -g sig.c
$ ./a.out
Bail
$ gdb ./a.out
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program: /home/elcapaldo/a.out
Program received signal SIGSEGV, Segmentation fault.
0x08048421 in main() at sig.c:15
15 *pi = 10;
(gdb) where
#0 0x08048421 in main() at sig.c:15
(gdb) c
Continuing.
Bail
Program exited with code 01.
(gdb) q
स्रोत
2010-08-05 13:10:24
आप सही हैं। निश्चित रूप से, मुझे बाल प्रक्रिया 'त्रुटि पकड़ा जाना चाहिए। धन्यवाद। – Blad
मैंने आपके सुझाव के अनुसार कोशिश की, लेकिन एक और समस्या ऐप को निरस्त कर देती है: "खोल-इनिट: वर्तमान निर्देशिका को पुनर्प्राप्त करने में त्रुटि: getcwd: मूल निर्देशिका तक नहीं पहुंच सकता: ऐसी कोई फ़ाइल या निर्देशिका नहीं है"। कोई उपाय? – Blad