libmdb memory corruption (double free)

Alex Mayrhofer <[email protected]> Fri, 25 Mar 2011 10:37:43 +0100
Newsgroups gmane.comp.db.mdb-tools.devel
Message-ID <[email protected]>
Hello,

I'm using mdbtools to export an Access database on a Linux machine. 
Unfortunately, mdb-export crashes with memory corruption when processing 
the database (after a couple of rows). A trace is included below - 
unfortunately my gdb knowledge is not good enough to get around the heap 
corruption, however, glibc provided a reasonable backtrace (included below).

The problem seems to occur in mdb_col_to_string() - i've included what i 
have below.

I can't post the mdb file itself to the list due to copyright issues, 
but i think i can email it to someone privately. I really appreciate any 
help, since this is a show-stopper for me at the moment - i'm very 
willing to debug more..

thanks,

Alex Mayrhofer

Backtrace:

*** glibc detected *** mdb-export: double free or corruption (out): 
0x09d8cac8 ***
======= Backtrace: =========
/lib/i686/cmov/libc.so.6[0xb75d5764]
/lib/i686/cmov/libc.so.6(cfree+0x96)[0xb75d7966]
/usr/lib/libglib-2.0.so.0(g_free+0x36)[0xb7704446]
/usr/lib/libmdb.so.1(mdb_col_to_string+0x1ef)[0xb777e52f]
/usr/lib/libmdb.so.1[0xb777ebda]
/usr/lib/libmdb.so.1(mdb_read_row+0x228)[0xb777eef8]
/usr/lib/libmdb.so.1(mdb_fetch_row+0x9d)[0xb777efed]
mdb-export[0x8049207]
/lib/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb757d455]
mdb-export[0x8048a61]
======= Memory map: ========
08048000-0804a000 r-xp 00000000 08:01 95513      /usr/bin/mdb-export
0804a000-0804b000 rw-p 00001000 08:01 95513      /usr/bin/mdb-export
09d7e000-09d9f000 rw-p 09d7e000 00:00 0          [heap]
b6700000-b6721000 rw-p b6700000 00:00 0
b6721000-b6800000 ---p b6721000 00:00 0
b68e9000-b68f5000 r-xp 00000000 08:01 32451      /lib/libgcc_s.so.1
b68f5000-b68f6000 rw-p 0000b000 08:01 32451      /lib/libgcc_s.so.1
b68fd000-b753e000 rw-p b68fd000 00:00 0
b753e000-b7566000 r-xp 00000000 08:01 93844      /usr/lib/libpcre.so.3.12.1
b7566000-b7567000 rw-p 00027000 08:01 93844      /usr/lib/libpcre.so.3.12.1
b7567000-b76bc000 r-xp 00000000 08:01 41015      /lib/i686/cmov/libc-2.7.so
b76bc000-b76bd000 r--p 00155000 08:01 41015      /lib/i686/cmov/libc-2.7.so
b76bd000-b76bf000 rw-p 00156000 08:01 41015      /lib/i686/cmov/libc-2.7.so
b76bf000-b76c3000 rw-p b76bf000 00:00 0
b76c3000-b7777000 r-xp 00000000 08:01 96016 
/usr/lib/libglib-2.0.so.0.1600.6
b7777000-b7778000 rw-p 000b4000 08:01 96016 
/usr/lib/libglib-2.0.so.0.1600.6
b7778000-b7787000 r-xp 00000000 08:01 89764      /usr/lib/libmdb.so.1.0.0
b7787000-b7788000 rw-p 0000e000 08:01 89764      /usr/lib/libmdb.so.1.0.0
b778e000-b7791000 rw-p b778e000 00:00 0
b7791000-b7792000 r-xp b7791000 00:00 0          [vdso]
b7792000-b77ac000 r-xp 00000000 08:01 35153      /lib/ld-2.7.so
b77ac000-b77ae000 rw-p 0001a000 08:01 35153      /lib/ld-2.7.so
bfe66000-bfe7b000 rw-p bffea000 00:00 0          [stack]
Aborted


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar