Re: Segfault on long memo fields

"Alex Hunsaker" <[email protected]> Thu, 24 Jul 2008 17:27:13 -0600
Newsgroups gmane.comp.db.mdb-tools.devel
Message-ID <[email protected]>
On Thu, Jul 24, 2008 at 8:14 AM, Brett Hutley <[email protected]> wrote:
> I've attached a patch for data.c that should fix the problem. It increases
> the size of the "text" buffer if the memo is larger than MDB_BIND_SIZE
> bytes. I was wondering why the function always seems to allocate
> MDB_BIND_SIZE bytes though? It seems as though a little later in the
> function we actually read the size of the memo field, and we can then just
> allocate the right number of bytes directly. (Although I guess there is
> potentially a bit mask encoded in the length, which you'd need to mask out
> in order to get the actual length).

Sweet this patch also happens to fix this segfault I was getting (not
related to memo fields just a text column).

Thanks a lot Brett!

*** glibc detected *** mdb-export: munmap_chunk(): invalid pointer:
0x0000000000883f00 ***
======= Backtrace: =========
/lib/libc.so.6[0x7ffd8e87bff8]
/usr/local/lib/libmdb.so.1(mdb_col_to_string+0x201)[0x7ffd8ee25521]
/usr/local/lib/libmdb.so.1[0x7ffd8ee25bd8]
/usr/local/lib/libmdb.so.1(mdb_read_row+0x1cb)[0x7ffd8ee25eab]
/usr/local/lib/libmdb.so.1(mdb_fetch_row+0x81)[0x7ffd8ee25f81]
mdb-export[0x401538]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7ffd8e8263f6]
mdb-export[0x400dd9]

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/