[MAPSERVER-USERS] CLOSE_CONNECTION=DEFER - Segmentation fault

Dave Fuhry dfuhry at gmail.com
Tue Mar 11 23:41:13 EDT 2008


Ivan,

   p.mapper seems to use the typical php
{map,layer}Obj_queryBy{Point,Rect,etc.} functions.  These calls end up
calling the same msPOSTGIS* functions as everything else.

   I can't seem to reproduce your problem with a simple testcase
(basically, the attached files).  It might help if you can set
log_min_duration_statement = 0 in your postgresql.conf, reproduce the
problem, and send the output from your postgresql log file.  It will
show all commands issued to the database, including the BEGIN, and the
DECLARE CURSOR ..., and FETCH for every layer.

   I can setup p.mapper if that's necessary to reproduce the problem.

  (By the way, I assume you're not using an ancient version of
postgis, in the 0.5 - 0.6 era.  There is an alternate codepath for
that, which I have not tested.)

Thanks,

Dave

On Sun, Mar 9, 2008 at 5:31 AM, Ivan Mincik <ivan.mincik at gmail.com> wrote:
> I am sorry for late reply,
>  I am testing mapserver with p.mapper application so I *don't* use it as
>  cgi/fcgi.
>
>  I have downloaded source package of mapserver 5.0.2 from debian unstable,
>  applied a patch and compiled on Debian Etch.
>  Installed and restarted apache and also rebooted whole system few times (I am
>  testing this on my desktop computer).
>
>  The problems are starting mostly when I am trying to use p.mapper's  identify
>  function, to get attributes of map object. Then p.mapper is freezing.
>  In mapfile i have 7 postgis layers.
>
>  I can try this also with some openlayers which is using cgi.
>
>  LOGS:
>
>  2008-03-09 10:24:44 CET WARNING:  there is already a transaction in progress
>  2008-03-09 10:24:45 CET WARNING:  there is already a transaction in progress
>  2008-03-09 10:24:46 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:24:46 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:24:46 CET ERROR:  cursor "mycursor" does not exist
>  2008-03-09 10:24:46 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:24:46 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:24:47 CET ERROR:  cursor "mycursor" does not exist
>  2008-03-09 10:24:47 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:24:47 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:24:47 CET ERROR:  cursor "mycursor" does not exist
>  2008-03-09 10:24:50 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:24:50 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:24:50 CET ERROR:  cursor "mycursor" does not exist
>  2008-03-09 10:24:52 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:24:52 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:24:52 CET ERROR:  cursor "mycursor" does not exist
>  2008-03-09 10:24:53 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:24:53 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:24:53 CET ERROR:  cursor "mycursor" does not exist
>  2008-03-09 10:24:54 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:24:54 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:24:54 CET ERROR:  cursor "mycursor" does not exist
>  2008-03-09 10:24:54 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:24:54 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:24:54 CET ERROR:  cursor "mycursor" does not exist
>  2008-03-09 10:24:55 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:24:55 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:24:55 CET ERROR:  cursor "mycursor" does not exist
>  2008-03-09 10:25:00 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:25:00 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:25:00 CET ERROR:  cursor "mycursor" does not exist
>  2008-03-09 10:25:00 CET ERROR:  DECLARE CURSOR may only be used in transaction
>  blocks
>  2008-03-09 10:25:00 CET WARNING:  there is no transaction in progress
>  2008-03-09 10:25:01 CET ERROR:  cursor "mycursor" does not exist
>
>
>  Thanks a lot
>  Ivan
>
>
>
>
>  On Wednesday 05 March 2008 22:41, you wrote:
>  > Ivan,
>  >
>  >    Thanks for the problem report.  If you are using fastcgi, you may
>  > need to restart it.
>  >
>  >    The only two places PQconnectdb is called is in msPOSTGISLayerOpen
>  > and in msPOSTGRESQLJoinConnect, which operates independently, not
>  > using cursors or the connection pool.  With a patched
>  > msPOSTGISLayerOpen, PQexec(layerinfo->conn, "BEGIN") is always called
>  > right after connecting, before any queries and before the connection
>  > ends up in the connection pool.
>  >
>  >    So I'm wondering if you've put the new mapserv executable in your
>  > cgi-bin, but not restarted the webserver, and it's pulling old
>  > connections out of the fastcgi connection pool, which have not had
>  > PQexec(layerinfo->conn, "BEGIN") issued to them (and thus, no
>  > transaction started).
>  >
>  >    Try restarting fastcgi.  Depending on your configuration,
>  > restarting your webserver may automatically restart fastcgi, or you
>  > may have to specifically restart the fastcgi service/daemon on that
>  > machine.
>  >
>  >    Please let us know if this fixes the problem.
>  >
>  > Thanks,
>  >
>  > Dave
>  >
>  > On Wed, Mar 5, 2008 at 7:26 AM, Ivan Mincik <ivan.mincik at gmail.com> wrote:
>  > > Nothing is perfect. There are no problems with applied patch when
>  > > browsing the map. But when I use identify object query from
>  > > php5-mapscript the problem is rising again.
>  > >
>  > >  I have in postgresql log:
>  > >
>  > >   2008-03-05 13:19:30 CET WARNING:  there is no transaction in progress
>  > >  2008-03-05 13:19:30 CET ERROR:  cursor "mycursor" does not exist
>  > >  2008-03-05 13:19:31 CET ERROR:  DECLARE CURSOR may only be used in
>  > > transaction blocks
>  > >  2008-03-05 13:19:31 CET WARNING:  there is no transaction in progress
>  > >  2008-03-05 13:19:31 CET ERROR:  cursor "mycursor" does not exist
>  > >  2008-03-05 13:19:32 CET ERROR:  DECLARE CURSOR may only be used in
>  > > transaction blocks
>  > >  2008-03-05 13:19:32 CET WARNING:  there is no transaction in progress
>  > >  2008-03-05 13:19:32 CET ERROR:  cursor "mycursor" does not exist
>  > >  2008-03-05 13:19:34 CET ERROR:  DECLARE CURSOR may only be used in
>  > > transaction blocks
>  > >  2008-03-05 13:19:34 CET WARNING:  there is no transaction in progress
>  > >  2008-03-05 13:19:34 CET ERROR:  cursor "mycursor" does not exist
>  > >  2008-03-05 13:20:10 CET LOG:  could not receive data from client:
>  > > Connection reset by peer
>  > >  2008-03-05 13:20:10 CET LOG:  unexpected EOF on client connection
>  > >  2008-03-05 13:20:10 CET LOG:  could not receive data from client:
>  > > Connection reset by peer
>  > >  2008-03-05 13:20:10 CET LOG:  unexpected EOF on client connection
>  > >  2008-03-05 13:20:10 CET LOG:  autovacuum: processing database "gisplan"
>  > >  2008-03-05 13:20:10 CET LOG:  could not receive data from client:
>  > > Connection reset by peer
>  > >  2008-03-05 13:20:10 CET LOG:  unexpected EOF on client connection
>  > >  2008-03-05 13:20:10 CET LOG:  could not receive data from client:
>  > > Connection reset by peer
>  > >  2008-03-05 13:20:10 CET LOG:  unexpected EOF on client connection
>  > >  2008-03-05 13:20:10 CET LOG:  could not receive data from client:
>  > > Connection reset by peer
>  > >  2008-03-05 13:20:10 CET LOG:  unexpected EOF on client connection
>  > >  2008-03-05 13:20:10 CET LOG:  could not receive data from client:
>  > > Connection reset by peer
>  > >  2008-03-05 13:20:10 CET LOG:  unexpected EOF on client connection
>  > >  2008-03-05 13:20:10 CET LOG:  could not receive data from client:
>  > > Connection reset by peer
>  > >  2008-03-05 13:20:10 CET LOG:  unexpected EOF on client connection
>  > >  2008-03-05 13:20:10 CET LOG:  could not receive data from client:
>  > > Connection reset by peer
>  > >  2008-03-05 13:20:10 CET LOG:  unexpected EOF on client connection
>  > >  2008-03-05 13:20:10 CET LOG:  could not receive data from client:
>  > > Connection reset by peer
>  > >  2008-03-05 13:20:10 CET LOG:  unexpected EOF on client connection
>  > >
>  > >
>  > >  2008-03-05 13:20:40 CET WARNING:  there is already a transaction in
>  > > progress 2008-03-05 13:20:40 CET WARNING:  there is already a transaction
>  > > in progress 2008-03-05 13:20:41 CET WARNING:  there is already a
>  > > transaction in progress 2008-03-05 13:20:42 CET WARNING:  there is
>  > > already a transaction in progress 2008-03-05 13:20:43 CET WARNING:  there
>  > > is already a transaction in progress 2008-03-05 13:20:43 CET WARNING:
>  > > there is already a transaction in progress 2008-03-05 13:20:44 CET
>  > > WARNING:  there is already a transaction in progress 2008-03-05 13:20:44
>  > > CET WARNING:  there is already a transaction in progress 2008-03-05
>  > > 13:20:45 CET WARNING:  there is already a transaction in progress
>  > > 2008-03-05 13:20:45 CET WARNING:  there is already a transaction in
>  > > progress 2008-03-05 13:20:45 CET WARNING:  there is already a transaction
>  > > in progress 2008-03-05 13:20:46 CET WARNING:  there is already a
>  > > transaction in progress 2008-03-05 13:20:46 CET WARNING:  there is
>  > > already a transaction in progress 2008-03-05 13:20:46 CET WARNING:  there
>  > > is already a transaction in progress 2008-03-05 13:20:47 CET WARNING:
>  > > there is already a transaction in progress 2008-03-05 13:20:47 CET
>  > > WARNING:  there is already a transaction in progress 2008-03-05 13:20:48
>  > > CET WARNING:  there is already a transaction in progress 2008-03-05
>  > > 13:20:49 CET WARNING:  there is already a transaction in progress
>  > > 2008-03-05 13:20:50 CET WARNING:  there is already a transaction in
>  > > progress 2008-03-05 13:20:50 CET WARNING:  there is already a transaction
>  > > in progress
>  > >
>  > >
>  > >  ivan
>  > >
>  > >  On Monday 03 March 2008 21:53, rich.fromm wrote:
>  > > > hrach wrote:
>  > >  > > I use mapserver 4.10.3, postgresql 8.1, Debian Etch.
>  > >  > >
>  > >  > > Is anybody using CLOSE_CONNECTION=DEFER without any problems ?
>  > >  >
>  > >  > I am now using it fine with mapserver 5.0.0 after applying the patch
>  > >  > for bug 2497:
>  > >  > http://trac.osgeo.org/mapserver/ticket/2497
>  > >  >
>  > >  > I don't know if 4.10.3 is different enough for that patch to be
>  > >  > applicable or not.  But if it's not too hard to upgrade, you might
>  > >  > want to try a later version (e.g. 5.0.2) plus that patch.  Note that
>  > >  > the patch may make it into the 5.0.3 release (it was originally
>  > >  > targetted for 5.2).
>  > >  >
>  > >  > You also might want to take a look at the following related mailing
>  > >  > list threads:
>  > >  >
>  > >  > http://www.nabble.com/Segmentation-fault---mapserver---postgis-to12653
>  > >  >945.h tml#a12674499
>  > >  > http://www.nabble.com/postgres-transaction-warnings-to15749333.html
>  > >  >
>  > >  > - Rich
>  > >
>  > > _______________________________________________
>  > >  mapserver-users mailing list
>  > >  mapserver-users at lists.osgeo.org
>  > >  http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ms_test.php
Type: application/x-httpd-php
Size: 308 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080311/4ebe94ed/ms_test-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: muni_poly.map
Type: application/octet-stream
Size: 861 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080311/4ebe94ed/muni_poly-0001.obj


More information about the mapserver-users mailing list