Memory Access Violation While Using PQexec

From: Yan Cheng Cheok <yccheok(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Memory Access Violation While Using PQexec
Date: 2010-01-14 08:49:32
Message-ID: 777127.25362.qm@web65707.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I encounter case when I call a stored procedure for 299166 th times (intensive, i put a non-stop while true loop to call stored procedure)

, the following exception will be thrown from PQexec. I am rather sure the exception are from PQexec, as there is a just before cout and just after cout wrap around PQexec.

std::cout << "Start PQexec " << sql << std::endl;
PGresult *res = PQexec(connection, sql.c_str());
std::cout << "End PQexec " << sql << std::endl;
const bool status = (PQresultStatus(res) == PGRES_TUPLES_OK);
PQclear(res);

"End PQexec..." is not being printed.

The last printed message before crashed is :

Start PQexec SELECT * FROM insert_unit(1,299166,array[0.407461,0.516022,0.434267
,0.802882,-1,1.99054,1.99039,0.808687], array['Pad Area','Pad Pitch','Pad Width','Pad Length','Side Pad Pitch','Package X Dimension','Package Y Dimension','Package Z Dimension'], array['mm','mm','mm','mm','mm','mm','mm','mm'])

The output is :

The thread 'Win32 Thread' (0x264) has exited with code 0 (0x0).
First-chance exception at 0x7c812afb in Report.exe: Microsoft C++ exception: std::exception at memory location 0x0012edb4..
First-chance exception at 0x7c812afb in Report.exe: Microsoft C++ exception: std::exception at memory location 0x0012ed94..
First-chance exception at 0x10017ea5 in Report.exe: 0xC0000005: Access violation writing location 0xfeeefeee.
'Report.exe': Unloaded 'C:\WINDOWS\system32\wshtcpip.dll'
'Report.exe': Unloaded 'C:\WINDOWS\system32\hnetcfg.dll'
Unhandled exception at 0x10017ea5 in Report.exe: 0xC0000005: Access violation writing location 0xfeeefeee.

The call stack is :

libpq.dll!10017ea5()
[Frames below may be incorrect and/or missing, no symbols loaded for libpq.dll]
libpq.dll!1000fa61()
> msvcr90d.dll!__set_flsgetvalue() Line 256 + 0xc bytes C
msvcp90d.dll!std::clog() + 0x3f bytes C++

Using VC 2008, I break at file tidtable.c

_CRTIMP PFLS_GETVALUE_FUNCTION __cdecl __set_flsgetvalue()
{
#ifdef _M_IX86
PFLS_GETVALUE_FUNCTION flsGetValue = FLS_GETVALUE; <-- BREAK HERE
if (!flsGetValue)
{
flsGetValue = _decode_pointer(gpFlsGetValue);
TlsSetValue(__getvalueindex, flsGetValue);
}
return flsGetValue;
#else /* _M_IX86 */

Any suggestion?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2010-01-14 08:55:58 Re: R: Re: R: Re: Weird EXECUTE ... USING behaviour
Previous Message Vincenzo Romano 2010-01-14 08:41:10 R: Re: R: Re: R: Re: Weird EXECUTE ... USING behaviour