Thread: ecpg program getting stuck
Hello List I have a program that worked fine in 7.4.19. I am in process of upgrading to 8.3.1 and my program runs for a while and then hangs. I used gdb to attach to the process and it shows the following backtrace which shows it going into the libpq library and getting stuck. Anybody have any ideas on how to proceed? I don't see anything in the postgres error log file. (gdb) bt #0 0x282e2de3 in poll () from /lib/libc.so.6 #1 0x280af646 in pqPutMsgStart () from /usr/X11R6/lib/libpq.so.5 #2 0x280afa0b in pqWaitTimed () from /usr/X11R6/lib/libpq.so.5 #3 0x280afa65 in pqWait () from /usr/X11R6/lib/libpq.so.5 #4 0x280ad595 in PQgetResult () from /usr/X11R6/lib/libpq.so.5 #5 0x280ad6b3 in PQgetResult () from /usr/X11R6/lib/libpq.so.5 #6 0x280c3655 in ECPGdo () from /usr/X11R6/lib/libecpg.so.6 #7 0x08054378 in updateTCTS (pUnit=0x8081800, pMsg=0xbfbf8850 "") at srm2_monitor_db.pgc:2313 #8 0x0804f8ae in main (argc=3, argv=0xbfbf7fc0) at srm2_monitor_server.c:3356 Thanks, Steve
Steve Clark <sclark@netwolves.com> writes: > I have a program that worked fine in 7.4.19. I am in process of upgrading > to 8.3.1 and my program runs for a while and then hangs. I used gdb > to attach to the process and it shows the following backtrace which > shows it > going into the libpq library and getting stuck. Well, gdb is lying to you to some extent (you'd probably get a better backtrace if you had built libpq with debug symbols), but I think it's simply waiting for a query response. Is the connected backend busy? If the problem is that some query is taking way longer than you were expecting, the first thought that comes to mind is "did you ANALYZE your tables after reloading", and the second is "check for configuration settings that you forgot to propagate into the new installation". regards, tom lane
Tom Lane wrote: > Steve Clark <sclark@netwolves.com> writes: > >>I have a program that worked fine in 7.4.19. I am in process of upgrading >>to 8.3.1 and my program runs for a while and then hangs. I used gdb >>to attach to the process and it shows the following backtrace which >>shows it >>going into the libpq library and getting stuck. > > > Well, gdb is lying to you to some extent (you'd probably get a better > backtrace if you had built libpq with debug symbols), but I think it's > simply waiting for a query response. Is the connected backend busy? > > If the problem is that some query is taking way longer than you were > expecting, the first thought that comes to mind is "did you ANALYZE > your tables after reloading", and the second is "check for > configuration settings that you forgot to propagate into the new > installation". > > regards, tom lane > > Hi Tom, I was testing with 8.2.6 before 8.3.0 came out and I don't think I saw this problem. I recompiled with debugging turned on and I'll do a closer inspection when/if it happens again. Steve