Entrance

toni magni - interoperability infrastructure actor

2010-W21-1
2010-05-24 Monday

mdbtools

I'm trying to get mdbtools to work on OS X 10.6 and/or amd64 linux. It's so strange how its distributed by debian and macports, compiles fine, however gives obnoxious runtime errors.

The errors i get are the following:

$ mdb-ver file.mdb
JET3
$ mdb-tables -1 file.mdb
Segmentation fault
$ mdb-export file.mdb table
Segmentation fault

At the beginning i thought it had to do with OS X, however, when i ran into the same symptoms on Linux 2.6.18-6-amd64, i started thinking it could have been a 64bit issue. When Brian Bruns first wrote it, he probably didn't prepare the code for 64bit architecture, making common assumptions such as an int is as big as a long or pointer.

I found some help here:

Splint

Splint is a utility that will check code for specific issues. In this case, i could use it to make sure that the size of long integers and pointers is 64 bits and the size of plain integers is 32 bits. When using splint, i found these flags to work (i put them in the .splintrc, since that was really the only thing i was using splint for):

-preproc
+posixlib
-I /opt/local/include/glib-1.2/
-I /opt/local/lib/glib/include/
-I ~/tmp/mdbtools_debug_attempt/mdbtools-0.6pre1/include

gdb

I played with gdb and libgmalloc, but not sure if i logged the work i did. When i run it now on linux, i get:

(gdb) run -1 OMS.MDB
Starting program: /usr/bin/mdb-tables -1 OMS.MDB
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 47589690023856 (LWP 14731)]
(no debugging symbols found)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47589690023856 (LWP 14731)]
0x00002b48564e1fa4 in __gconv_get_alias_db () from /lib/libc.so.6
(gdb) cont
Continuing.
Cannot find user-level thread for LWP 14731: generic error
(gdb) cont
Continuing.
Cannot fetch general-purpose registers for thread 47589690023856: generic error
(gdb) cont
Cannot fetch general-purpose registers for thread 47589690023856: generic error
...

Addressbook
Articles
Contacts
Education
Family
Guestbook
Members
Music
Projects
Resume
Sitelife