[H-GEN] malloc/free problems in mysqlclient_r
Allen Grace
a.grace at mailbox.uq.edu.au
Wed Aug 1 04:19:00 EDT 2001
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Please observe the list's charter. ]
[ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]
Evening all
I'm rather stumped about a situation I've come across in a multi-threaded
program which queries MySQL, and was hoping that someone could point me in a
direction, having tried all workarounds I can think of.
Running on FreeBSD 4.2-RELEASE, gcc 2.95.2, native threads.
One particular process shows 'in free(): error: modified (page-) pointer.'
whenever it executes a query containing a SELECT, and then in a subsequent
call to mysq_store_result() it segfaults. I understand what the free() error
means, having read the man page and searched the list archives on
freebsd.org, but am not sure what to do about it, because the problem occurs
somewhere in the thread library called from in libmysqlclient_r. A half-hour
walk through the relevant parts of mysql source wasn't very fruitful.
Backtrace from gdb (the abort is a result of my having set
MALLOC_OPTIONS='A'):
#0 0x280fe320 in kill () from /usr/lib/libc_r.so.4
#1 0x281486a6 in abort () from /usr/lib/libc_r.so.4
#2 0x2814719d in _thread_leave_cancellation_point () from
/usr/lib/libc_r.so.4
#3 0x281471d3 in _thread_leave_cancellation_point () from
/usr/lib/libc_r.so.4
#4 0x281480be in _thread_leave_cancellation_point () from
/usr/lib/libc_r.so.4
#5 0x28148345 in free () from /usr/lib/libc_r.so.4
#6 0x2809fd73 in my_no_flags_free ()
from /usr/home/dvadmin/mysqlclient/lib/mysql/libmysqlclient_r.so.10
#7 0x280a2910 in free_root ()
from /usr/home/dvadmin/mysqlclient/lib/mysql/libmysqlclient_r.so.10
#8 0x28099db1 in free_rows (cur=0x8073100) at libmysql.c:414
#9 0x2809aab3 in unpack_fields (data=0x8073100, alloc=0xbfbff9ec, fields=1,
default_value=0 '\000', long_flag_protocol=1 '\001') at libmysql.c:866
#10 0x2809c83c in mysql_read_query_result (mysql=0xbfbff878) at
libmysql.c:1754
#11 0x2809c97c in mysql_real_query (mysql=0xbfbff878,
query=0xbfbff030 "SELECT parent_id FROM contact WHERE child_id = '1'",
length=50)
at libmysql.c:1772
#12 0x80580a3 in adm_setstatus (mcon=0xbfbff878, userid=1, newstatus=10, cou
nt=1)
at admlayer.c:2368
#13 0x805297e in notify_user_logout (mcon=0xbfbff878, userid=1)
at messagehandling.c:3560
#14 0x804af58 in check_record_expiry (mcon=0xbfbff878, now=996676508,
userid=1,
record=0x80730c0 "0000000001121294945450996654418010") at
textdatastore.c:536
#15 0x804ae5e in cleanup_files (mp=0xbfbff83c) at textdatastore.c:497
#16 0x8049606 in monitor_logins (thing=0xbfbff83c) at cleanup.c:110
#17 0x80494c9 in cleanup_main (imc=0xbfbffa88) at cleanup.c:62
#18 0x804942b in main () at cleanup.c:24
#19 0x8049341 in _start ()
Changing the order of the queries doesn't help, nor does starting up only
one thread. (There was only one thread running while generating the above
listing) Should I be posting to the mysql general list, or perhaps trying
the freebsd lists? Any suggestions appreciated.
allen
--
Allen Grace
Dark Blue Sea Pty Ltd
ph +61 7 3007 0000
fax +61 7 3007 0001
***The opinions expressed in this email are my own and are not
representative of DBS Pty Ltd.***
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.
More information about the General
mailing list