This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/1554: gdb internal error on fopen


>Number:         1554
>Category:       gdb
>Synopsis:       gdb internal error on fopen
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 16 05:38:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     maw@pobox.com
>Release:        unknown-1.0
>Organization:
>Environment:
SuSE 9.0 professional, using the gdb shipped by them (gdb-5.3.92-10) as well as gdb-6.0 and gdb+dejagnu-20040216 built by me
>Description:
gdb hits an internal error leading either to a segfault or an internal error ("dwarf2-frame.c:550: internal-error: Unknown CFA rule.  A problem internal to GDB has been detected, further debugging may prove unreliable.").  

A few points, which I hope may be useful:
- I've only seen gdb bomb out on a fopen line
- I've only managed to get this to happen running gdb inside
  of emacs
- It sometimes takes several iterations of running my
  program, making changes, rebuilding, and restarting to get
  gdb to error.  In other words, although its internal error
  occurs at the same place in my code, I can't get it to
  happen reliably.  

>How-To-Repeat:
Start with this trivial program:

#include <stdio.h>
int
main(int argc, char **argv)
{
    int x;
    while (1) {
        x++;
        fopen("gdb-killer.c", "r");
    }
}

Build it: gcc -g gdb-killer.c -o gdb-killer

In emacs, M-x gdb RET gdb gdb-killer RET

Inside gdb (which is inside of emacs):
  r
  b main
  n 
Hit n several times.

Now, make some minor change in gdb-killer.c, such as changing x++ to x--.  Rebuild.

Back in gdb, 
  r
  n
Hit n several more times.

gdb hits an error at the fopen line sometimes.  I've had it
segfault ("Debugger segmentation fault (core dumped)") and
also catch an internal error ("dwarf2-frame.c:550: 
internal-error: Unknown CFA rule.  A problem internal to GDB
has been detected, further debugging may prove unreliable.
Quit this debugging session? (y or n)")

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c; name="gdb-killer.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gdb-killer.c"

I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQKbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpCnsKICAg
IGludCB4OwogICAgd2hpbGUgKDEpIHsKICAgICAgICB4Kys7CiAgICAgICAgZm9wZW4oImdkYi1r
aWxsZXIuYyIsICJyIik7CiAgICB9CiAgICAqKGludCAqKSBOVUxMID0gODsKfQo=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]