Troubleshooting cored dumps

Troubleshooting cored dumps

Post by Francisco Rey » Sun, 21 Apr 2002 00:50:27



How does one go about troubleshooting Core Dumps?
server sent data ("D" message) without prior row description ("T" message)
server sent data ("D" message) without prior row description ("T" message)
server sent data ("D" message) without prior row description ("T" message)
server sent data ("D" message) without prior row description ("T" message)
server sent data ("D" message) without prior row description ("T" message)
server sent data ("D" message) without prior row description ("T" message)
DEBUG:  pq_flush: send() failed: Broken pipe
Segmentation fault (core dumped)

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate

message can get through to the mailing list cleanly

 
 
 

Troubleshooting cored dumps

Post by Joe Conw » Sun, 21 Apr 2002 00:58:47



> How does one go about troubleshooting Core Dumps?
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> DEBUG:  pq_flush: send() failed: Broken pipe
> Segmentation fault (core dumped)

run:
gdb [options] [executable-file [core-file or process-id]]

Assuming you're in the directory with the core, it would look something
like:

gdb /usr/local/pgsql/bin/postgres ./core

Once in gdb, run the command "bt" to see a backtrace.

However if you haven't compiled PostgrSQL with --enable-debug, it will
be difficult to tell what was going on.

HTH,

Joe

---------------------------(end of broadcast)---------------------------


 
 
 

Troubleshooting cored dumps

Post by Vince Vielhab » Sun, 21 Apr 2002 01:01:03



> How does one go about troubleshooting Core Dumps?
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> DEBUG:  pq_flush: send() failed: Broken pipe
> Segmentation fault (core dumped)

gdb /full/path/to/postmaster /full/path/to/corefile

You can change either full paths to relative if you want.

Then at the prompt:

gdb> where

And you'll get the necessary info - provided debugging symbols were
compiled in, but even if not you may get an idea of what's wrong.

Vince.
--
==========================================================================

         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate

message can get through to the mailing list cleanly

 
 
 

Troubleshooting cored dumps

Post by Francisco Rey » Sun, 21 Apr 2002 01:36:54




> > How does one go about troubleshooting Core Dumps?
> > server sent data ("D" message) without prior row description ("T" message)
> > server sent data ("D" message) without prior row description ("T" message)
> > server sent data ("D" message) without prior row description ("T" message)
> > server sent data ("D" message) without prior row description ("T" message)
> > server sent data ("D" message) without prior row description ("T" message)
> > server sent data ("D" message) without prior row description ("T" message)
> > DEBUG:  pq_flush: send() failed: Broken pipe
> > Segmentation fault (core dumped)

> gdb /full/path/to/postmaster /full/path/to/corefile

> You can change either full paths to relative if you want.

> Then at the prompt:

> gdb> where

> And you'll get the necessary info - provided debugging symbols were
> compiled in, but even if not you may get an idea of what's wrong.

I got
psql.core: not in executable format:
File format not recognized

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate

message can get through to the mailing list cleanly

 
 
 

Troubleshooting cored dumps

Post by Vince Vielhab » Sun, 21 Apr 2002 01:41:58





> > > How does one go about troubleshooting Core Dumps?
> > > server sent data ("D" message) without prior row description ("T" message)
> > > server sent data ("D" message) without prior row description ("T" message)
> > > server sent data ("D" message) without prior row description ("T" message)
> > > server sent data ("D" message) without prior row description ("T" message)
> > > server sent data ("D" message) without prior row description ("T" message)
> > > server sent data ("D" message) without prior row description ("T" message)
> > > DEBUG:  pq_flush: send() failed: Broken pipe
> > > Segmentation fault (core dumped)

> > gdb /full/path/to/postmaster /full/path/to/corefile

> > You can change either full paths to relative if you want.

> > Then at the prompt:

> > gdb> where

> > And you'll get the necessary info - provided debugging symbols were
> > compiled in, but even if not you may get an idea of what's wrong.

> I got
> psql.core: not in executable format:
> File format not recognized

psql is the program that blew core?   In that case change the above
that reads /full/path/to/postmaster to /full/path/to/psql  and try it.

Vince.
--
==========================================================================

         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

 
 
 

Troubleshooting cored dumps

Post by Doug McNaug » Sun, 21 Apr 2002 01:44:27



> I got
> psql.core: not in executable format:
> File format not recognized

The first argument to gdb needs to be the postmaster binary; the core
file is the second argument.

-Doug
--
Doug McNaught       Wireboard Industries      http://www.wireboard.com/

      Custom software development, systems and network consulting.
      Java PostgreSQL Enhydra Python Zope Perl Apache Linux BSD...

---------------------------(end of broadcast)---------------------------

 
 
 

Troubleshooting cored dumps

Post by Francisco Rey » Sun, 21 Apr 2002 01:50:06




> > How does one go about troubleshooting Core Dumps?
> > server sent data ("D" message) without prior row description ("T" message)
> > server sent data ("D" message) without prior row description ("T" message)
> > server sent data ("D" message) without prior row description ("T" message)
> > server sent data ("D" message) without prior row description ("T" message)
> > server sent data ("D" message) without prior row description ("T" message)
> > server sent data ("D" message) without prior row description ("T" message)
> > DEBUG:  pq_flush: send() failed: Broken pipe
> > Segmentation fault (core dumped)

> gdb /full/path/to/postmaster /full/path/to/corefile

Ignore the previous post. :-)
Left out the program.

It turns out that it was psql that crashed.

bestpal:~/sql>gdb /usr/local/bin/psql psql.core
no debugging symbols found)...
Core was generated by `psql'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/libpq.so.2...(no debugging symbols
found)...done.
Reading symbols from /usr/local/lib/libgnugetopt.so.1...(no debugging
symbols found)...done.
Reading symbols from /usr/lib/libssl.so.2...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libcrypto.so.2...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libz.so.2...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libcrypt.so.2...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libm.so.2...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libutil.so.3...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libreadline.so.4...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libc.so.4...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libncurses.so.5...(no debugging symbols
found)...done.
Reading symbols from /usr/libexec/ld-elf.so.1...(no debugging symbols
found)...done.
#0  0x28088fec in appendPQExpBufferStr () from /usr/local/lib/libpq.so.2
(gdb) where
#0  0x28088fec in appendPQExpBufferStr () from /usr/local/lib/libpq.so.2
#1  0x28084dfa in PQexec () from /usr/local/lib/libpq.so.2
#2  0x804d6e3 in PQclientEncoding ()
#3  0x804f09e in PQclientEncoding ()
#4  0x80504e8 in PQclientEncoding ()
#5  0x804a125 in PQclientEncoding ()

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

 
 
 

Troubleshooting cored dumps

Post by Vince Vielhab » Sun, 21 Apr 2002 01:53:14



> It turns out that it was psql that crashed.

> bestpal:~/sql>gdb /usr/local/bin/psql psql.core
> no debugging symbols found)...
> Core was generated by `psql'.
> Program terminated with signal 11, Segmentation fault.
> Reading symbols from /usr/local/lib/libpq.so.2...(no debugging symbols
> found)...done.
> Reading symbols from /usr/local/lib/libgnugetopt.so.1...(no debugging
> symbols found)...done.
> Reading symbols from /usr/lib/libssl.so.2...(no debugging symbols
> found)...done.
> Reading symbols from /usr/lib/libcrypto.so.2...(no debugging symbols
> found)...done.
> Reading symbols from /usr/lib/libz.so.2...(no debugging symbols
> found)...done.
> Reading symbols from /usr/lib/libcrypt.so.2...(no debugging symbols
> found)...done.
> Reading symbols from /usr/lib/libm.so.2...(no debugging symbols
> found)...done.
> Reading symbols from /usr/lib/libutil.so.3...(no debugging symbols
> found)...done.
> Reading symbols from /usr/lib/libreadline.so.4...(no debugging symbols
> found)...done.
> Reading symbols from /usr/lib/libc.so.4...(no debugging symbols
> found)...done.
> Reading symbols from /usr/lib/libncurses.so.5...(no debugging symbols
> found)...done.
> Reading symbols from /usr/libexec/ld-elf.so.1...(no debugging symbols
> found)...done.
> #0  0x28088fec in appendPQExpBufferStr () from /usr/local/lib/libpq.so.2
> (gdb) where
> #0  0x28088fec in appendPQExpBufferStr () from /usr/local/lib/libpq.so.2
> #1  0x28084dfa in PQexec () from /usr/local/lib/libpq.so.2
> #2  0x804d6e3 in PQclientEncoding ()
> #3  0x804f09e in PQclientEncoding ()
> #4  0x80504e8 in PQclientEncoding ()
> #5  0x804a125 in PQclientEncoding ()

I'd look at what you're passing to PQexec.  Perhaps a null pointer or
something?

Vince.
--
==========================================================================

         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate

message can get through to the mailing list cleanly

 
 
 

Troubleshooting cored dumps

Post by Tom La » Sun, 21 Apr 2002 02:46:06



> How does one go about troubleshooting Core Dumps?
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> server sent data ("D" message) without prior row description ("T" message)
> DEBUG:  pq_flush: send() failed: Broken pipe
> Segmentation fault (core dumped)

I'll save you the trouble: I'll bet that psql ran out of memory for a
huge result set.  libpq is not real robust about coping with that :-(.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command

 
 
 

Troubleshooting cored dumps

Post by Francisco Rey » Sun, 21 Apr 2002 04:17:54



> I'll save you the trouble: I'll bet that psql ran out of memory for a
> huge result set.  libpq is not real robust about coping with that :-(.

Thanks Tom.
That hint was enough. I looked at the query... real hard. :-)
Found that I was missing a join condition so my return set would have been
gigantic (cartisian product of tables with close to 1 Million records)

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

 
 
 

1. pfree() core dump in 7.2.3

Has anyone experienced a pfree() related core dump in 7.2.3.
Here is my gdb  backtrace

0  0x005dbb5c in pfree ()
(gdb) bt
#0  0x005dbb5c in pfree ()
#1  0x004208c0 in heap_freetuple ()
#2  0x004a8390 in acquire_sample_rows ()
#3  0x004a75c8 in analyze_rel ()
#4  0x0049f690 in vacuum ()
#5  0x005585d8 in ProcessUtility ()
#6  0x00553c78 in pg_exec_query_string ()
#7  0x00555850 in PostgresMain ()
#8  0x00524660 in DoBackend ()
#9  0x00523d08 in BackendStartup ()
#10 0x00521c18 in ServerLoop ()
#11 0x005211c8 in PostmasterMain ()
#12 0x004df3d8 in main ()
#13 0x2ae34928 in __libc_start_main () from /lib/libc.so.6
(gdb)

FYI, I'm using the Async Query for my vacuum as shown below and I'm
not doing the PQgetResult(), so I'm hoping that closing the connection will
tear down the backend after finishing the vacuum...

       if ( ! PQsendQuery( Conn, SQL.c_str() ) )
        {

                cout << __FUNCTION__
                       << " : Failed to execute Async vacuum  ["
                       << PQerrorMessage(Conn) << "]\n";
                PQfinish(Conn);
                return status;
        }
        PQflush(Conn);
        PQfinish(Conn);

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command

2. Visit a new software and books shop

3. PostgreSQL ports post-installation gives core dump?

4. Wizards Mac-Win

5. PG 7.2.1 core dump

6. Progress E-Zine Issue 13

7. Oracle oci driver: Core dump-oci parameter passed

8. Max Extents

9. Pb with Apache 1.3.12 + Oracle 817 on AIX : Core Dumped

10. postmaster core dumps with SPI_repalloc

11. Core dump on HP

12. Java Web Server Core Dump

13. initdb failing - core dumped