bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GDBM-1.8.0 Segmentation Fault with small block_size.


From: Pierre Dupre TTI
Subject: GDBM-1.8.0 Segmentation Fault with small block_size.
Date: Thu, 7 Feb 2002 10:01:06 +0000 (GMT)

                Bonjour,

    I am using GDBM (gdbm-1.8.0),  on Solaris systems, and I got some
crash (Segmentation Fault(coredump)), if on gdbm_open() I use a small
 block_size.
    I have done the tests with the program 'testgdbm' found in the
gdbm-1.8.0.tar.gz file.


1) On solaris2.6
        gcc --version
        2.8.1

        CC="gcc -g" ; export CC
        ./configure --disable-shared
        make
        make testgdbm
        testgdbm -n <exemple_testgdbm
                ...
        com -> There are 62093 items in the database.
        com -> This is GDBM version 1.8.0, as of May 19, 1999.

        ls -l junk.gdbm exemple_testgdbm
        -rw-r--r--   1 user   group 7943065 Feb  7 08:35 exemple_testgdbm
        -rw-r--r--   1 user   group 11641027 Feb  7 08:36 junk.gdbm

  The file exemple_testgdbm who containt all the store command look like:
        s
        a_inmarsat_4000000000001:A:
        ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
        s
        0:AI:
        ABCDEFGHIJKLMNOPQRSTUVWXYZA
                ...
                ...
        c
        V
        q


   We make a new test for testgdbm with a block_size 1024:
        testgdbm -n -b 1024  <exemple_testgdbm
        Segmentation Fault(coredump)

   We the gdb debugger we got:
        gdb testgdbm core
        GNU gdb 4.17
                ...
        (gdb) bt
        #0  0xef745d50 in _malloc_unlocked ()
        #1  0xef745b38 in malloc ()
        #2  0x14028 in _gdbm_split_bucket (dbf=0x26fe8, next_insert=537920015)
            at bucket.c:204
        #3  0x13320 in gdbm_store (dbf=0x26fe8, key={
              dptr = 0xefffec08 "HUKA10EGRR:T:", dsize = 14}, content={
              dptr = 0xefffe820 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP
                    QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP
                    QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP
                    QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQR"..., 
              dsize = 204}, flags=1) at gdbmstore.c:133
        #4  0x120f4 in main (argc=158720, argv=0x16000) at testgdbm.c:345



   We rebuild the libgdbm.a and testgdbm with the /opt/SUNWspro4.2/bin/cc
compiler. We got also a Segmentation Fault:
        testgdbm -n -b 1024  <exemple_testgdbm
        Segmentation Fault(coredump)

        /opt/SUNWspro4.2/bin/dbx testgdbm core
        (/opt/SUNWspro4.2/bin/dbx) where
          [1] _malloc_unlocked(0x2000, 0x4e4800, 0x4abd0, 0x2e810, 0x0,
                0xef7a3180), at 0xef745d50
          [2] malloc(0x2000, 0x2000, 0xb, 0x398, 0x0, 0x20), at 0xef745b30
        =>[3] _gdbm_split_bucket(dbf = ???, next_insert = ???) (optimized),
             at 0x14ae8 (line ~131) in "bucket.c"
          [4] gdbm_store(dbf = ???, key = RECORD, content = RECORD,
                flags = ???) (optimized), at 0x13bbc (line ~55) in "gdbmstore.c"
          [5] main(argc = ???, argv = ???) (optimized), at 0x126ec (line ~162)
                in "testgdbm.c"

   We rebuild the libgdbm.a and testgdbm with the /opt/SUNWspro5.0/bin/cc
compiler. We got also a Segmentation Fault.



2) On solaris2.8
        gcc --version
        2.95.2
        
        testgdbm -n -b 1024 -g /tmp/junk.gdbm <exemple_testgdbm
        Segmentation Fault(coredump)

3) HP-UX 10.20
        CC="cc -Aa -D_HPUX_SOURCE -g"

        testgdbm -n -g /tmp/junk.gdbm <exemple_testgdbm
                ...
        com -> There are 62093 items in the database.
        com -> This is GDBM version 1.8.0, as of May 19, 1999.

        ls -l /tmp/junk.gdbm
        -rw-rw-r--   1 user group     11641027 fÅvr  7 09:40 /tmp/junk.gdbm


    When we make the test with a block_size of 1024, we don't crash the
program, but the result is false:
        testgdbm -n -b 1024 -g /tmp/junk.gdbm <exemple_testgdbm
                ...
        com -> There are 16917 items in the database.
        com -> This is GDBM version 1.8.0, as of May 19, 1999.

        ls -l /tmp/junk.gdbm
        -rw-rw-r--   1 user group     1073750778 fÅvr  7 09:41 /tmp/junk.gdbm

   The count 16917 is false, and the file size is more than one gigas bytes !



Regards,
Pierre.Dupré

P.S. I have not put my file exemple_testgdbm in this mail. The gzip size is:
        -rw-r--r--   1 user   group  231834 Feb  7 09:55 exemple_testgdbm.gz
-- 
|--------------------------------------------------------------------|
|  Pierre Dupre                   E-mail:     address@hidden  |
|  Meteo France                                                      |
|  Service SCEM/TTI/DEV           Telephone:       05 61 07 81 33    |
|                                 International: 33 5 61 07 81 33    |
|  42 avenue Gustave Coriolis     Fax:             05 61 07 81 09    |
|  31057 Toulouse Cedex                                              |
|  FRANCE                                                            |
|--------------------------------------------------------------------|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]