[MAPSERVER-USERS] CLOSE_CONNECTION=DEFER - Segmentation fault

Dave Fuhry dfuhry at gmail.com
Mon Apr 7 20:01:11 EDT 2008


Carlos,

   I won't be able to look at this until after April 14th.  But note
that I posted a third version of my patch which Ivan is using.
(Lesson learned: From now on in Trac, I'm posting a separate file for
every version of a patch).  It seems like you're using the latest, but
check to be sure.

   If you can send a snippet of the python code you're using, that
might help.  I assume you are using CLOSE_CONNECTION=DEFER on the
layer.  There is clearly still something wrong with the series of SQL
statements being issued; for one thing, a ROLLBACK followed by BEGIN
should only be issued if the previous statement ended erroneously.

   The SELECT * FROM tablename WHILE false LIMIT 0 is normal though;
mapserver needs to know the field names and data types.  Pity it can't
infer them from the layer definition; there's probably a good reason
it can't.

Thanks,

Dave Fuhry

On Fri, Mar 28, 2008 at 12:47 PM, Carlos_Molina
<dr.chamberlain at gmail.com> wrote:
>
>  I miss one extra query right here:
>
> DECLARE mycursor2 BINARY CURSOR FOR SELECT... // getShape(1)
>  FETCH ALL in mycursor2
>  CLOSE mycursor2
>  ROLLBACK
>  //////////////////////////////////////////////////////////queryByAttribute///////////////////////////////////////////////////////////////
>
> ERROR:  DECLARE CURSOR may only be used in transaction blocks
>  WARNING:  there is no transaction in progress
>  statement: rollback
>  statement: begin
>  ERROR:  cursor "mycursor" does not exist
>  ABORT
>
>  I tried this QueryByAttribute by itself, without the first QueryByRect I
>  showed no my last post and it seems to be missing a BEGIN statement for its
>  cursor.
>
>  Saludos!
>
>
>
>
>  Carlos_Molina wrote:
>  >
>  >
>  > Dave Fuhry wrote:
>  >>
>  >> 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
>  >>
>  >
>  > Hello Dave,
>  >
>  > I've tried first and second version of your patch and both resolved my
>  > first issue of many many BEGIN statements being issued by cursors so my
>  > application went back to running smoothly. The sad part is that another
>  > issued arised from this patch and It's when using python mapscript and the
>  > drawQuery call.
>  > If i just render my .map file with draw() I get no trouble, but if I open
>  > my map file, get a single layer from it, query the layer, open the layer
>  > to retrieve results and call drawQuery() afterwards to render everything
>  > like I used to do before the patch, I get the following error(I resumed
>  > the sql statements):
>  >
>  > BEGIN
>  > DECLARE mycursor BINARY CURSOR FOR SELECT...  // queryByPoint
>  > FETCH ALL in mycursor
>  > CLOSE mycursor
>  > SELECT * FROM... "same as above" WHILE false LIMIT 0 // Dont know why this
>  > is issued, might be openLayer or just to get the field names of the table
>  > WARNING:  there is already a transaction in progress
>  > BEGIN
>  > DECLARE mycursor2 BINARY CURSOR FOR SELECT... // getShape(0)
>  > FETCH ALL in mycursor2
>  > CLOSE mycursor2
>  > ROLLBACK
>  > BEGIN
>  > DECLARE mycursor2 BINARY CURSOR FOR SELECT... // getShape(1)
>  > FETCH ALL in mycursor2
>  > CLOSE mycursor2
>  > ROLLBACK
>  > ERROR:  DECLARE CURSOR may only be used in transaction blocks
>  > WARNING:  there is no transaction in progress
>  > statement: rollback
>  > statement: begin
>  > ERROR:  cursor "mycursor" does not exist
>  > ABORT
>  >
>  > Regards
>  >
>  > Carlos Molina
>  >
>
>  --
>  View this message in context: http://www.nabble.com/CLOSE_CONNECTION%3DDEFER----Segmentation-fault-tp15786741p16353907.html
>
>
> Sent from the Mapserver - User mailing list archive at Nabble.com.
>
>  _______________________________________________
>  mapserver-users mailing list
>  mapserver-users at lists.osgeo.org
>  http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


More information about the mapserver-users mailing list