Bug with MySQL 5 and newlisp 8.9.0?

Started by methodic, July 22, 2006, 03:29:28 PM

Previous topic - Next topic

methodic

I am running OpenSUSE 10.1 with MySQL 5.0.18-16 and newlisp 8.9.0



If I load the mysql5.lsp in the base distribution of newlisp and try to connect to my local database, newlisp crashes on me. Anyone having this problem with the latest newlisp and mysql5?



> (MySQL:connect "localhost" "user" "p4ssw0rd" "db")

*** glibc detected *** newlisp: double free or corruption (!prev): 0x08076008 ***

======= Backtrace: =========

/lib/libc.so.6[0xb7d94911]

/lib/libc.so.6(__libc_free+0x84)[0xb7d95f84]

/usr/lib/libmysqlclient.so.15.0.0(my_no_flags_free+0x21)[0xb7bb8351]

/usr/lib/libmysqlclient.so.15.0.0(net_end+0x25)[0xb7be0ba5]

/usr/lib/libmysqlclient.so.15.0.0(end_server+0x4d)[0xb7bdb36d]

/usr/lib/libmysqlclient.so.15.0.0(mysql_real_connect+0x36c)[0xb7bdcf9c]

newlisp[0x8064b5e]

newlisp[0x8064d9e]

newlisp[0x804e3f3]

newlisp[0x8057ea4]

newlisp[0x8057fb9]

newlisp[0x804e3c2]

newlisp[0x804eb51]

newlisp[0x804e3c2]

newlisp[0x8051eb8]

newlisp[0x804e36c]

newlisp[0x80521fb]

newlisp[0x8052917]

newlisp[0x8052e04]

/lib/libc.so.6(__libc_start_main+0xdc)[0xb7d4687c]

newlisp[0x804a1e1]

======= Memory map: ========

08048000-08074000 r-xp 00000000 03:03 572872     /usr/bin/newlisp

08074000-08076000 rw-p 0002c000 03:03 572872     /usr/bin/newlisp

08076000-080bb000 rw-p 08076000 00:00 0          [heap]

b7a00000-b7a21000 rw-p b7a00000 00:00 0

b7a21000-b7b00000 ---p b7a21000 00:00 0

b7b35000-b7b3f000 r-xp 00000000 03:03 2567376    /lib/libgcc_s.so.1

b7b3f000-b7b40000 rw-p 00009000 03:03 2567376    /lib/libgcc_s.so.1

b7b40000-b7b51000 r-xp 00000000 03:03 2567345    /lib/libnsl-2.4.so

b7b51000-b7b53000 rw-p 00010000 03:03 2567345    /lib/libnsl-2.4.so

b7b53000-b7b55000 rw-p b7b53000 00:00 0

b7b55000-b7b5e000 r-xp 00000000 03:03 2567338    /lib/libcrypt-2.4.so

b7b5e000-b7b61000 rw-p 00008000 03:03 2567338    /lib/libcrypt-2.4.so

b7b61000-b7b88000 rw-p b7b61000 00:00 0

b7ba3000-b7cb1000 r-xp 00000000 03:03 1510871    /usr/lib/libmysqlclient.so.15.0.0

b7cb1000-b7cdc000 rw-p 0010e000 03:03 1510871    /usr/lib/libmysqlclient.so.15.0.0

b7cdc000-b7d0f000 r--p 00000000 03:03 1603995    /usr/lib/locale/en_US.utf8/LC_CTYPE

b7d0f000-b7d31000 rw-p b7d0f000 00:00 0

b7d31000-b7e4a000 r-xp 00000000 03:03 2567334    /lib/libc-2.4.so

b7e4a000-b7e4c000 r--p 00118000 03:03 2567334    /lib/libc-2.4.so

b7e4c000-b7e4e000 rw-p 0011a000 03:03 2567334    /lib/libc-2.4.so

b7e4e000-b7e52000 rw-p b7e4e000 00:00 0

b7e52000-b7e8d000 r-xp 00000000 03:03 2567382    /lib/libncurses.so.5.5

b7e8d000-b7e98000 rw-p 0003a000 03:03 2567382    /lib/libncurses.so.5.5

b7e98000-b7e99000 rw-p b7e98000 00:00 0

b7e99000-b7ec3000 r-xp 00000000 03:03 2567392    /lib/libreadline.so.5.1

b7ec3000-b7ec7000 rw-p 0002a000 03:03 2567392    /lib/libreadline.so.5.1

b7ec7000-b7ec8000 rw-p b7ec7000 00:00 0

b7ec8000-b7eca000 r-xp 00000000 03:03 2567340    /lib/libdl-2.4.so

b7eca000-b7ecc000 rw-p 00001000 03:03 2567340    /lib/libdl-2.4.so

b7ecc000-b7eef000 r-xp 00000000 03:03 2567342    /lib/libm-2.4.so

b7eef000-b7ef1000 rw-p 00022000 03:03 2567342    /lib/libm-2.4.so

b7ef2000-b7f03000 r-xp 00000000 03:03 2567386    /lib/libz.so.1.2.3

b7f03000-b7f04000 rw-p 00010000 03:03 2567386    /lib/libz.so.1.2.3

b7f04000-b7f0b000 r--s 00000000 03:03 1587225    /usr/lib/gconv/gconv-modules.cache

b7f0b000-b7f0d000 rw-p b7f0b000 00:00 0

b7f0d000-b7f27000 r-xp 00000000 03:03 2567327    /lib/ld-2.4.so

b7f27000-b7f29000 rw-p 00019000 03:03 2567327    /lib/ld-2.4.so

bff96000-bffad000 rw-p bff96000 00:00 0          [stack]

ffffe000-fffff000 ---p 00000000 00:00 0          [vdso]

Aborted

Lutz

#1
I only can report about MySQL v.5.0.19 on Mac OS X 10.4.7 and on OpenBSD 3.8 (in a MySQL cluster configuration), both run fine using libmysqlclient.15.dylib and libmysqlclient.15.so.



No experience here on SUSE or any other Linux. What kind of hardware are you running on?



Lutz

methodic

#2
The more I write code the more I think it's a SuSE quirk... I know they have their little app-armor thing, and I think something is interferring with newlisp when it comes to outside libraries and memory usage. I'll try to re-run the tests as root to see if I still get the same behavior. If that doesn't work still, I will try on another distribution and if it works I will be re-installing Slackware.

methodic

#3
I grabbed the latest newlisp and compiled with gdb symbols. Here is the stack trace from gdb:


> (MySQL:connect)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210972496 (LWP 9087)]
0xb7bb5e2e in my_stat () from /usr/lib/libmysqlclient_r.so.15.0.0
(gdb) bt
#0  0xb7bb5e2e in my_stat () from /usr/lib/libmysqlclient_r.so.15.0.0
#1  0xb7bac45c in get_defaults_options () from /usr/lib/libmysqlclient_r.so.15.0.0
#2  0xb7bacd69 in get_defaults_options () from /usr/lib/libmysqlclient_r.so.15.0.0
#3  0xb7bacf5e in my_search_option_files () from /usr/lib/libmysqlclient_r.so.15.0.0
#4  0xb7bad1e5 in load_defaults () from /usr/lib/libmysqlclient_r.so.15.0.0
#5  0xb7bcbf1a in mysql_read_default_options () from /usr/lib/libmysqlclient_r.so.15.0.0
#6  0xb7bcc3a8 in mysql_real_connect () from /usr/lib/libmysqlclient_r.so.15.0.0
#7  0x08064b5e in cdeclFunction (fAddress=3082601280, args=0xb7e3cff4, count=0) at nl-import.c:208
#8  0x08064d9e in executeLibfunction (pCell=0x8077518, params=0x8076008) at nl-import.c:171
#9  0x0804e3f3 in evaluateExpression (cell=0x8077a68) at newlisp.c:1081
#10 0x08057ea4 in compareOp (params=0x8077a68, op=5) at nl-math.c:500
#11 0x08057fb9 in p_equal (params=0x8077a68) at nl-math.c:491
#12 0x0804e3c2 in evaluateExpression (cell=0x8077a48) at newlisp.c:1101
#13 0x0804eb51 in p_not (params=0x8077a48) at newlisp.c:4558
#14 0x0804e3c2 in evaluateExpression (cell=0x8077aa8) at newlisp.c:1101
#15 0x08051eb8 in evaluateLambda (localLst=0x8077ac8, arg=<value optimized out>, newContext=0x80a9f40) at newlisp.c:1320
#16 0x0804e36c in evaluateExpression (cell=0x80772f8) at newlisp.c:1060
#17 0x080521fb in evaluateStream (stream=0xbfa554a8, outDevice=2, flag=0) at newlisp.c:884
#18 0x08052917 in executeCommandLine (command=0x80a9f28 "(MySQL:connect)", outDevice=2, cmdStream=0xbfa55600) at newlisp.c:862
#19 0x08052e04 in main (argc=1, argv=0xbfa556c4) at newlisp.c:690

Lutz

#4
It crashes occurs in my_stat() inside libmysqlclient_r.so.



Did you do a (MySQL:init) before doing the MySQL:connect ?



Perhaps you also could try to recompile libmysqlclient, does this library come from a binary install, or is it compiled on your box?



Can you post a 'uname -a' to look at the hardware you are running?



Are you running an AMD64 CPU, and don't have 32bit version installed for libmysqlclient?



Lutz

methodic

#5
Its a regular install of x86-32 SuSE 10.1... although I think the problem was I forgot to do a (MySQL:init) first.... I put that in the start of the function and I am inserting into my DB no problem.