[Sqlrelay-discussion] segfault when sendQuery() called multiple times
Brought to you by:
mused
|
From: Cal H. <ca...@fb...> - 2010-05-14 21:29:57
|
Hi all,
I'm not sure how well I can describe this bug, because I can't recreate this
issue with a simple C++ app. It only happens from within our web app. In
an odd set of circumstances with a relatively large query (15 columns) I get
a segfault when using the same sqlrcursor object, and calling sendQuery()
mulitple times with different queries.
Here's the stacktrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912515408576 (LWP 20445)]
0x00002aaaaae05ab5 in row::addField (this=0x1b961a30, column=15,
buffer=0x1b907d7f "", length=0)
at row/row.C:42
42 extrafields[column-OPTIMISTIC_COLUMN_COUNT]=(char
*)buffer;
Current language: auto; currently c++
(gdb) bt
#0 0x00002aaaaae05ab5 in row::addField (this=0x1b961a30, column=15,
buffer=0x1b907d7f "", length=0)
at row/row.C:42
#1 0x00002aaaaae04d92 in sqlrcursor::parseData (this=0x1b812d70) at
cursor/parsedata.C:200
#2 0x00002aaaaae02877 in sqlrcursor::processResultSet (this=0x1b812d70,
getallrows=false,
rowtoget=9) at cursor/receiveresultset.C:53
#3 0x00002aaaaae01b65 in sqlrcursor::runQuery (this=0x1b812d70,
query=0x1bb5b280 "select prefix,\n list_nbr,\n
ma_tech_id,\n house_nbr,\n box_nbr,\n
streetdirprefix,\n streetname,\n streetsuffix,\n
streetdirsuffix,\n streetaddli"...) at cursor/runquery.C:20
#4 0x00002aaaaae004e0 in sqlrcursor::executeQuery (this=0x1b812d70) at
cursor/executequery.C:23
#5 0x00002aaaaadffa84 in sqlrcursor::sendQuery (this=0x1b812d70,
query=0x1bb5b280 "select prefix,\n list_nbr,\n
ma_tech_id,\n house_nbr,\n box_nbr,\n
streetdirprefix,\n streetname,\n streetsuffix,\n
streetdirsuffix,\n streetaddli"...) at cursor/sendquery.C:9
And in frame 0:
(gdb) frame 0
#0 0x00002aaaaae05ab5 in row::addField (this=0x1b961a30, column=15,
buffer=0x1b907d7f "", length=0)
at row/row.C:42
42 extrafields[column-OPTIMISTIC_COLUMN_COUNT]=(char
*)buffer;
(gdb) print extrafields
$1 = (char **) 0x0
I've managed to work around this by deleting the sqlrcursor and creating a
new object for every query... but, I'm not sure how much overhead this
creates when compared to calling sendQuery() multiple times. I'm not sure
if this matters, but column 15 is "decimal(sold_price,14,0)" in this
particular query. (DB2) So far, out of a gagillion queries in our system,
this is the only one that creates a segfault.
Please let me know if you'd like more info!
Thanks,
--Cal
|