You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Maarten Engelen <ma...@iridia.nl> on 2007/07/10 13:40:55 UTC
Still crashes in apr dbd mysql plugin
Hi,
Currently I'm working on a piece of software that uses a MySQL
database as the backend. The problem we have is that we get crashes at
the following places at random times:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1404044384 (LWP 30750)]
0xb7fc8232 in dbd_mysql_get_row (pool=0xac8688a0, res=0xac8689f8,
row=0xac7585f0, rownum=0) at dbd/apr_dbd_mysql.c:353
353 (*row)->row = r;
(gdb) bt
#0 0xb7fc8232 in dbd_mysql_get_row (pool=0xac8688a0, res=0xac8689f8,
row=0xac7585f0, rownum=0) at dbd/apr_dbd_mysql.c:353
#1 0xb7fca017 in apr_dbd_get_row (driver=0xb7fcb080, pool=0xac8688a0,
res=0xac8689f8, row=0xac7585f0, rownum=0) at dbd/apr_dbd.c:243
#2 0x0804b9cd in ps_get_single_row (conn=0xac7585e8, pool=0xac8688a0,
sql=0xac8688d8 "SELECT reference.key, ... FROM reference"...) at
persistent.c:133
#3 0x0804be60 in ps_get_user_by_key (data=0xac4ff3e8,
conn=0xac7585e8, pool=0xac7585a0, key=0x826ca00 "test22") at
persistent.c:152
And the following one occurs sometimes:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1289524320 (LWP 19868)]
dbd_mysql_get_entry (row=0x8351508, n=8) at dbd/apr_dbd_mysql.c:396
396 if (row->res->statement) {
(gdb) bt
#0 dbd_mysql_get_entry (row=0x8351508, n=8) at dbd/apr_dbd_mysql.c:396
#1 0xb7f1d039 in apr_dbd_get_entry (driver=0xb7f1e080, row=0x8351508,
col=8) at dbd/apr_dbd.c:248
#2 0x0804bfee in ps_get_user_by_key (data=0xb32363e8, conn=0x81f82e8,
pool=0x81f82a0, key=0x83ad658 "test17") at persistent.c:165
It is a multithreaded application and every thread has it's own
database connection.
I think that for some reason the 'row' structure is getting corrupted,
but I can't really see why or how this is happening. Besides that, the
application can run for a few days or a few hours and then suddenly
crash with one of the errors above. Most of the times it is
(*row)->row = r; which causes the crash.
Any help would be greatly appreciated.
Regards,
Maarten
Re: Still crashes in apr dbd mysql plugin
Posted by Nick Kew <ni...@webthing.com>.
On Tue, 10 Jul 2007 13:40:55 +0200
"Maarten Engelen" <ma...@iridia.nl> wrote:
> I think that for some reason the 'row' structure is getting corrupted,
> but I can't really see why or how this is happening. Besides that, the
> application can run for a few days or a few hours and then suddenly
> crash with one of the errors above. Most of the times it is
> (*row)->row = r; which causes the crash.
Does your program guarantee that the "row" argument to get_row
is always either
* a pointer to NULL
or
* a pointer to a valid apr_dbd_row_t* that can safely be written?
If you were (say) passing it uninitialised pointers, I'd expect it
to break much quicker than you said. But if that could happen in
some edge-case, for example?
--
Nick Kew
Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/