Re: [patch/rfc/testsuite] Test GDB on not-so-little core files

Michael Elizabeth Chastain
2004-01-14T03:11:11Z

First something trivial:

likely that the variable will occure early in the core file (an
^^^^^^ typo

I checked Single Unix Spec v3 on rlimit:

http://www.opengroup.org/onlinepubs/007904975/functions/getrlimit.html

There is an RLIMIT_AS which applies as well, so you might as well
maximize that.

I ran this on native hppa2.0w-hp-hpux11.11 on spe191.testdrive.hp.com.
This machine has a data limit of 1 gigabyte, as you can see in the log.
The gdb.log is appended.

Michael C

===

Test Run By chastain on Tue Jan 13 21:56:05 2004
Native configuration is hppa2.0w-hp-hpux11.11

=== gdb tests ===

Schedule of variations:
unix

Running target unix
Using /tmp/chastain/install/hppa2.0w-hp-hpux11.11/vanilla/host/dejagnu-1.4.3/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /tmp/chastain/install/hppa2.0w-hp-hpux11.11/vanilla/host/dejagnu-1.4.3/share/dejagnu/config/unix.exp as generic interface file for target.
Using /house/chastain/gdb/s1/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
Running /house/chastain/gdb/s1/gdb/testsuite/gdb.base/bigcore.exp ...
Executing on host: gcc /house/chastain/gdb/s1/gdb/testsuite/gdb.base/bigcore.c -g -lm -o /house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc-none/gdb/testsuite/gdb.base/bigcore (timeout = 300)
Executing on build: mv /house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc-none/gdb/testsuite/gdb.base/coredir.14619/core /house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc-none/gdb/testsuite/gdb.base/bigcore.corefile (timeout = 300)
Executing on build: rmdir /house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc-none/gdb/testsuite/gdb.base/coredir.14619 (timeout = 300)
GNU gdb 2004-01-13-cvs
Copyright 2004 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 "hppa2.0w-hp-hpux11.11".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /house/chastain/gdb/s1/gdb/testsuite/gdb.base
Source directories searched: /house/chastain/gdb/s1/gdb/testsuite/gdb.base:$cdir:$cwd
(gdb) file /house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc-none/gdb \r/testsuite/gdb.base/bigcore
Reading symbols from /house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc-none/gdb/testsuite/gdb.base/bigcore...done.
(gdb) set print sevenbit-strings
(gdb) PASS: gdb.base/bigcore.exp: set print sevenbit-strings; bigcore
set width 0
(gdb) PASS: gdb.base/bigcore.exp: set width 0; bigcore
delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x3230: file /house/chastain/gdb/s1/gdb/testsuite/gdb.base/bigcore.c, line 114.
(gdb) run
Starting program: /house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc-none/gdb/testsuite/gdb.base/bigcore

Breakpoint 1, main () at /house/chastain/gdb/s1/gdb/testsuite/gdb.base/bigcore.c:114
114 print_string ("Maximize resource limits ...\n");
(gdb) list bigcore.c:1,1
1 /* This testcase is part of GDB, the GNU debugger.
(gdb) search Dump core
179 print_string ("Dump core ....\n");
(gdb) tbreak 179
Breakpoint 2 at 0x340c: file /house/chastain/gdb/s1/gdb/testsuite/gdb.base/bigcore.c, line 179.
(gdb) PASS: gdb.base/bigcore.exp: tbreak 179
continue
Continuing.
Maximize resource limits ...
core: cur=0x7ffffffe max=0x7fffffff -> cur=0x7fffffff max=0x7fffffff
data: cur=0x40000000 max=0x40000000 -> cur=0x40000000 max=0x40000000
stack: cur=0x8000000 max=0x8000000 -> cur=0x8000000 max=0x8000000
Alocating the entire heap ...
536870912 bytes @ 0x40003388
268435456 bytes @ 0x60003390
67108864 bytes @ 0x70003398
33554432 bytes @ 0x740033a0
16777216 bytes @ 0x760033a8
8388608 bytes @ 0x770033b0
4194304 bytes @ 0x778033b8
2097152 bytes @ 0x77c033c0
262144 bytes @ 0x77e033c8
32768 bytes @ 0x77e433d0
16384 bytes @ 0x77e4b3d8
2048 bytes @ 0x77e4f3e0
1024 bytes @ 0x77e4fbe8
8 bytes @ 0x77e4fff0
main () at /house/chastain/gdb/s1/gdb/testsuite/gdb.base/bigcore.c:179
179 print_string ("Dump core ....\n");
(gdb) PASS: gdb.base/bigcore.exp: continue
next
Dump core ....
180 *(char*)0 = 0;
(gdb) PASS: gdb.base/bigcore.exp: next
print heap
$1 = (struct list *) 0x77e4fff0
(gdb) print $.next
$2 = (struct list *) 0x77e4fbe8
(gdb) print $.next
$3 = (struct list *) 0x77e4f3e0
(gdb) print $.next
$4 = (struct list *) 0x77e4b3d8
(gdb) print $.next
$5 = (struct list *) 0x77e433d0
(gdb) print $.next
$6 = (struct list *) 0x77e033c8
(gdb) print $.next
$7 = (struct list *) 0x77c033c0
(gdb) print $.next
$8 = (struct list *) 0x778033b8
(gdb) print $.next
$9 = (struct list *) 0x770033b0
(gdb) print $.next
$10 = (struct list *) 0x760033a8
(gdb) print $.next
$11 = (struct list *) 0x740033a0
(gdb) print $.next
$12 = (struct list *) 0x70003398
(gdb) print $.next
$13 = (struct list *) 0x60003390
(gdb) print $.next
$14 = (struct list *) 0x40003388
(gdb) print $.next
$15 = (struct list *) 0x0
(gdb) PASS: gdb.base/bigcore.exp: extract heap
core /house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc-none/gdb \r/testsuite/gdb.base/bigcore.corefile
A program is being debugged already. Kill it? (y or n) y
Core was generated by `bigcore'.
Program terminated with signal 10, Bus error.
warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program.

#0 main () at /house/chastain/gdb/s1/gdb/testsuite/gdb.base/bigcore.c:180
180 *(char*)0 = 0;
(gdb) PASS: gdb.base/bigcore.exp: load corefile
print heap
$16 = (struct list *) 0x77fbffe0
(gdb) FAIL: gdb.base/bigcore.exp: check heap (address 0x77e4fff0)
testcase /house/chastain/gdb/s1/gdb/testsuite/gdb.base/bigcore.exp completed in 183 seconds

=== gdb Summary ===

# of expected passes 7
# of unexpected failures 1
Executing on host: /house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc-none/gdb/testsuite/../../gdb/gdb -nw --command gdb_cmd (timeout = 300)
GNU gdb 2004-01-13-cvs
Copyright 2004 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 "hppa2.0w-hp-hpux11.11".
/house/chastain/gdb/build/hppa2.0w-hp-hpux11.11/s1-blank-gcc-none/gdb/testsuite/../../gdb/gdb version 2004-01-13-cvs -nx

runtest completed at Tue Jan 13 21:59:08 2004