|
From: | Andrew Cagney |
Subject: | Re: segmentation fault only when in debug mode |
Date: | Sun, 29 Jul 2001 11:34:06 -0400 |
User-agent: | Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.2) Gecko/20010717 |
I have a big problem useing gdb: in a very simple (hello world style) program, where I just open a file and the close it: filename = fopen("toto.txt","r"); fclose(filename); the program runs ok, doing nothing as expected. But when using gdb, fopen() returns an address ONLY when file is toto.txt. When I change it say to toto2.txt, it returns NO address and fclose makes a segmentation fault.... gdb msg: Program received signal SIGSEGV, Segmentation fault. _IO_feof (fp=0x0) at feof.c:36 36 feof.c: Aucun fichier ou répertoire de ce type. using gdb 4.18, or 5.0 same result
Could I suggest downloading a current GDB snapshot and seeing if the problem sill occures. See http://sources.redhat.com/gdb/#download
on an almost identical machine, it works....
It may not be GDB but also the kernel or something else again. For anyone to have a guess as to what is going wrong a lot more information will be needed. As you noted, an almost identical machine works, perhaphs start by eliminating those differences.
Andrew
[Prev in Thread] | Current Thread | [Next in Thread] |