Skip to content

Commit

Permalink
Fix for bug #1410928. Mxosrvr coring during performance tests.
Browse files Browse the repository at this point in the history
The core seems to be occurring because of a lack of synchronization
between the timer thread and main thread accessing a global statement
object. When the statement is dropped the associated pSrvrStmt
is also deleted and hence the global pointer is invalidated and causes
the core when accessed. The fix now also nulls the global statement
pointer so that the timer thread ignores the dropped
statement.

Fixes bug #1410928

Change-Id: I06b15b90325a7b405d4adcca871b58c9dba51729
  • Loading branch information
tharakc committed Jan 22, 2015
1 parent 729c3c5 commit 93df4ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions conn/odbc/src/odbc/nsksrvrcore/srvrcommon.cpp
Expand Up @@ -46,6 +46,8 @@
extern ResStatisticsSession *resStatSession;
extern ResStatisticsStatement *resStatStatement;

// Fix for bug 1410928
extern SRVR_STMT_HDL * pQueryStmt;
using namespace SRVR;

short qrysrvcExecuteFinished(
Expand Down Expand Up @@ -302,6 +304,9 @@ void SRVR::removeSrvrStmt(SRVR_STMT_HDL *pSrvrStmt)
if (pSrvrSession->pCurrentSrvrStmt == lpSrvrStmt)
pSrvrSession->pCurrentSrvrStmt = NULL;
delete lpSrvrStmt;
// Fix for bug 1410928. Set the global pQueryStmt to NULL so that the statistics timer thread is aware that the
// statement no longer exists.
pQueryStmt = NULL;
if( trace_memory ) LogDelete("delete lpSrvrStmt;",(void**)&lpSrvrStmt,lpSrvrStmt);
delete pSrvrStmtList;
if( trace_memory ) LogDelete("delete pSrvrStmtList;",(void**)&pSrvrStmtList,pSrvrStmtList);
Expand Down

0 comments on commit 93df4ee

Please sign in to comment.