corrupted double-linked list
corrupted double-linked list
От:
Maarten Foqué <maarten.foque@edchq.com>
Дата:
Hello everyone, I ran into a problem writing a program using libpq, and after postin on a forum and asking it on the irc channel I was redirected here. I'll try to keep it simple so you don't have to read to much to start: The program is asynchronous using libev, using sockets and notifications to wake up. Notifications is done with connection conn_async, queries are done using conn_block with PQexec. PGresult *res; is defined global. When a notification arrives, the callback goes something like: PGresult *res2; res2 = PQexec(conn_async, "select stuff"); // yes, this is the only time I use conn_async for a query for( i "PostgreSQL 8.3.4 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)" (Fedora 9) My system (running the program): Linux 2.6.26.8-57.fc8 #1 SMP Thu Dec 18 19:19:45 EST 2008 i686 athlon i386 GNU/Linux Thanks in advance, Maarten P.S.: I'm not subscribed to the list.
Re: corrupted double-linked list
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Maarten Foqué writes: > The program crashes on PQclear(resu) with the following: > *** glibc detected *** ./incident_relay: corrupted double-linked list: > 0x09c459c8 *** This looks like a memory-stomp type of bug. There's no reason to assume that PQclear is the cause; it's more likely the victim of a stomp that occurred sometime earlier. I'd suggest running the app under valgrind or electric fence or some other memory-overrun-catcher. regards, tom lane
Re: corrupted double-linked list
От:
Maarten Foqué <maarten.foque@edchq.com>
Дата:
Thanks, you were right on. regards, Maarten On Wed, 2009-09-09 at 13:47 -0400, Tom Lane wrote: > Maarten Foqué writes: > > The program crashes on PQclear(resu) with the following: > > *** glibc detected *** ./incident_relay: corrupted double-linked list: > > 0x09c459c8 *** > > This looks like a memory-stomp type of bug. There's no reason to assume > that PQclear is the cause; it's more likely the victim of a stomp that > occurred sometime earlier. I'd suggest running the app under valgrind > or electric fence or some other memory-overrun-catcher. > > regards, tom lane