Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 239519 - dev-lisp/clisp - clisp segfaults when trying ffi bindings for mysql
Summary: dev-lisp/clisp - clisp segfaults when trying ffi bindings for mysql
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Common Lisp Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-04 09:52 UTC by Dmitry Petrov
Modified: 2009-01-05 20:10 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch which removes my_alloc and my_realloc from lisp.run dynamic symbols table (clisp-2.46-my_malloc-patch.diff,767 bytes, patch)
2008-10-04 09:56 UTC, Dmitry Petrov
Details | Diff
Ebuild which applies clisp-2.46-my_malloc-patch.diff (clisp-2.46-r1.ebuild,4.04 KB, text/plain)
2008-10-04 09:58 UTC, Dmitry Petrov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Petrov 2008-10-04 09:52:24 UTC
When I tried to use clsql-mysql I got random segfault when connecting to database or executing query.

Reproducible: Always

Steps to Reproduce:
1. start clisp
2. (asdf:oos 'asdf:load-op :clsql-mysql)
3. (clsql:connect '("somehost" "somedb" "someuser" "somepass") :database-type :mysql) ; you may got segfault at this point
4. (clsql:query "select 1+2") ; or at this
5. (clsql:disconnect) ; or here

Actual Results:  
segfault or wrong result from select

Expected Results:  
Normally I would receive result of the query execution
Comment 1 Dmitry Petrov 2008-10-04 09:56:01 UTC
After playing with gdb I've finally found the reason: there are "my_malloc" and "my_realloc" symbols in both libmysqlclient.so and lisp.run binaries. So mysql call clisp's my_malloc/my_realloc instead of mysql's one. This results in undefined behavious when mysql code expects that memory block returned from my_malloc will be zero-filled.
Comment 2 Dmitry Petrov 2008-10-04 09:56:55 UTC
Created attachment 167150 [details, diff]
Patch which removes my_alloc and my_realloc from lisp.run dynamic symbols table
Comment 3 Dmitry Petrov 2008-10-04 09:58:40 UTC
Created attachment 167151 [details]
Ebuild which applies clisp-2.46-my_malloc-patch.diff
Comment 4 Marijn Schouten (RETIRED) gentoo-dev 2009-01-05 20:10:17 UTC
This should be fixed with clisp-2.47.