Re: db mess
On Sun, Jun 06, 1999 at 12:36:09AM +0200, Marcus Brinkmann wrote:
>
> If you leave out O_TRUNC, it will proceed and segfault later. All very
> strange.
It may proceed in both cases. Obviously, the output of gdb can't be trusted.
It just doesn't proceed in single step, as the following log shows (this
time without O_TRUNC). I should really update gdb...
Script started on Sun Jun 6 01:04:51 1999
hurd:/testdb# gdb ./aha
GNU gdb 4.17.m68k.objc.threads.hwwp.fpu.gnat
Copyright 1998 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 "i386-gnu"...
(gdb) break main
Breakpoint 1 at 0x804a187: file aha.c, line 39.
(gdb) run
Starting program: /testdb/./aha
[Switching to thread 96.3]
[Switching to thread 96.5]
Breakpoint 1, main () at aha.c:39
39 printf ("%p\n",btree_flopen("/tmp/index",O_CREAT|O_RDWR, 0644));
(gdb) s
btree_flopen (filename=0x8090864 "/tmp/index", flags=19, mode=420) at aha.c:18
18 b.flags = 0; /* R_DUP */
(gdb)
20 b.cachesize = 0; /* default size */
(gdb)
21 b.maxkeypage = 0; /* default */
(gdb)
22 b.minkeypage = 0; /* default */
(gdb)
23 b.psize = 0; /* default page size (2048?) */
(gdb)
24 b.compare = NULL; /* builtin compare() function */
(gdb)
25 b.prefix = NULL; /* builtin function */
(gdb)
26 b.lorder = 0; /* byte order of host */
(gdb)
29 dbf = NULL;
(gdb)
30 lock_failed = 1;
(gdb)
32 dbf = dbopen(filename, flags, mode, DB_BTREE, &b);
(gdb)
dbopen (file=0x8090864 "/tmp/index", oflags=19, mode=420, type=0,
openinfo=0x1019bc0) at /usr/src/db-2.4.14/db185/db185.c:54
54 if ((db185p = (DB185 *)__db_calloc(1, sizeof(DB185))) == NULL)
(gdb)
__db_calloc (num=1, size=40) at /usr/src/db-2.4.14/os/os_alloc.c:68
68 size *= num;
(gdb)
69 if ((p = __db_jump.j_malloc(size == 0 ? 1 : size)) != NULL)
(gdb)
Program received signal EXC_BAD_ACCESS, Could not access memory.
0x10a3dac in ?? () from /lib/libc.so.0.2
(gdb) bt
#0 0x10a3dac in ?? () from /lib/libc.so.0.2
#1 0x807abe0 in __bam_setmeta (dbp=0x8096170, t=0x80af348)
at /usr/src/db-2.4.14/btree/bt_open.c:292
#2 0x807a8b9 in __bam_open (dbp=0x8096170, type=DB_BTREE, dbinfo=0x1019b48)
at /usr/src/db-2.4.14/btree/bt_open.c:166
#3 0x804c131 in db_open (fname=0x8090864 "/tmp/index", type=DB_BTREE,
flags=65536, mode=420, dbenv=0x0, dbinfo=0x1019b48, dbpp=0x1019b8c)
at /usr/src/db-2.4.14/db/db.c:635
#4 0x804a573 in dbopen (file=0x8090864 "/tmp/index", oflags=19, mode=420,
type=DB_BTREE, openinfo=0x1019bc0) at /usr/src/db-2.4.14/db185/db185.c:197
#5 0x804a173 in btree_flopen (filename=0x8090864 "/tmp/index", flags=19,
mode=420) at aha.c:32
#6 0x804a198 in main () at aha.c:39
#7 0x105a8ef in ?? () from /lib/libc.so.0.2
(gdb) quit
The program is running. Exit anyway? (y or n) y
hurd:/testdb# exit
exit
Script done on Sun Jun 6 01:05:14 1999
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org finger brinkmd@
Marcus Brinkmann GNU http://www.gnu.org master.debian.org
Marcus.Brinkmann@ruhr-uni-bochum.de for public PGP Key
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/ PGP Key ID 36E7CD09
Reply to:
- References:
- db mess
- From: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
- Re: db mess
- From: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>