Bug 59400

Summary: gdb internal error detected when debuggin xosview
Product: [Retired] Red Hat Linux Reporter: George France <france>
Component: gdbAssignee: Beth Uptagrafft <bhu>
Status: CLOSED WORKSFORME QA Contact: Beth Uptagrafft <bhu>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: teg
Target Milestone: ---   
Target Release: ---   
Hardware: alpha   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-04-29 21:47:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description George France 2002-02-06 23:28:50 UTC
Description of Problem:

gdb has an internal error when debuggin xosview

Version-Release number of selected component (if applicable):

gdb-5.1-1
xosview-1.7.3-7.src.rpm

How Reproducible:

Always.

Steps to Reproduce:

1. rpm -i xosview-1.7.3-7.src.rpm 
2. cd /usr/src/redhat/SPECS
3. rpm -ba xosview.spec
4. cd /usr/src/redhat/BUILD/
5. Apply the following patch to xosview-1.7.3:

--- xosview-1.7.3-orig/linux/cpumeter.cc	Wed Feb 24 17:16:20 1999
+++ xosview-1.7.3/linux/cpumeter.cciew-1Wed Feb  6 18:24:21 2002 xosview-1.7.3/li
@@ -87,9 +87,9 @@
   }
 
   int line = -1;
-  char buf[1024];
+  char buf[8192];
   while (!stats.eof()){
-    stats.getline(buf, 1024);
+    stats.getline(buf, sizeof(buf));
     if (!stats.eof()){
       line++;
       if (!strncmp(cpuID, buf, strlen(cpuID)) && buf[strlen(cpuID)] == ' ')
@@ -112,9 +112,9 @@
   }
 
   int cpuCount = 0;
-  char buf[1024];
+  char buf[8192];
   while (!stats.eof()){
-    stats.getline(buf, 1024);
+    stats.getline(buf, sizeof(buf));
     if (!stats.eof()){
       if (!strncmp(buf, "cpu", 3) && buf[3] != ' ')
           cpuCount++;

6. cd to BUILD/xosview-1.7.3 directory
7. rebuild xosview with '-g' 
8. gdb ./xosview
9  set verbose on
10.set annotate 1
11.r

Actual Results:

(gdb) set verbose on
(gdb) set annotate 1
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/src/redhat/BUILD/xosview-1.7.3/./xosview 
Reading symbols from /usr/X11R6/lib/libXpm.so.4...done.
Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
Reading symbols from /usr/lib/libstdc++-libc6.2-2.so.3...done.
Reading symbols from /lib/libm.so.6.1...done.
Reading symbols from /lib/libc.so.6.1...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading in symbols for dl-debug.c...done.
Reading in symbols for rtld.c...done.
Reading in symbols for dl-init.c...done.
Reading in symbols for malloc.c...done.

Program received signal SIGSEGV, Segmentation fault.
ui-out.c:115: gdb-internal-error: push_level: Assertion `uiout->level >= 0 &&
uiout->level < MAX_UI_OUT_LEVELS' failed.
An internal GDB error was detected.  This may make further
debugging unreliable.  Continue this debugging session? (y or n)

Comment 1 Trond Eivind Glomsrxd 2002-02-06 23:41:38 UTC
Assigned to the one responsible for the alpha project.

Comment 2 Tom Tromey 2002-02-08 20:22:47 UTC
I looked into this a bit.
I can't reproduce it.  For me, gdb doesn't crash but instead xosview does:

[ ... ]
Reading in symbols for dl-init.c...done.
Reading symbols from /lib/libnss_files.so.2...done.
Reading in symbols for malloc.c...done.

Program received signal SIGSEGV, Segmentation fault.
0x2000034dae4 in chunk_free (ar_ptr=0x20000424ac0, p=0x120047900)
    at malloc.c:3228
3228    malloc.c: No such file or directory.
        in malloc.c
Current language:  auto; currently c

Could you perhaps debug gdb with itself and get a stack trace of the crash?
That might help.  Thanks.

Comment 3 George France 2002-04-29 21:47:08 UTC
I can not reproduce this problem, please close this item.

--George