Opened 15 years ago

Closed 13 years ago

#2820 closed defect (wontfix)

SVG+FCGID is not working

Reported by: pvalsecc Owned by: assefa
Priority: normal Milestone:
Component: Output-SVG Version: 5.2
Severity: critical Keywords:
Cc:

Description

If I do a WMS request with format=image/svg+xml on my server using the CGI mode, everything works fine.

If I do the same query with my server configured to use FCGID, I get an error 500. In the apache logs, I find:

[Tue Dec 02 11:45:29 2008] [notice] mod_fcgid: server /usr/lib/cgi-bin/mapserv(4120) started
*** glibc detected *** corrupted double-linked list: 0x082edad8 ***
[Tue Dec 02 11:45:35 2008] [notice] mod_fcgid: process /usr/lib/cgi-bin/mapserv(4120) exit(communication error), get unexpected signal 6

I'm on Debian etch, using the provided apache and mod_fcgid package. Mapserver is from the cgi-mapserver-5.2 package you can find here:

deb http://dev.camptocamp.com/packages etch sig

Change History (6)

comment:1 by pvalsecc, 15 years ago

If it helps, here is the stack trace (sorry, I don't have the debug version):

Program received signal SIGABRT, Aborted.
[Switching to Thread -1248786208 (LWP 18874)]
0xb7fbb410 in ?? ()
(gdb) backtrace
#0  0xb7fbb410 in ?? ()
#1  0xbfe153d4 in ?? ()
#2  0x00000006 in ?? ()
#3  0x000049ba in ?? ()
#4  0xb72cf811 in raise () from /lib/tls/i686/cmov/libc.so.6
#5  0xb72d0fb9 in abort () from /lib/tls/i686/cmov/libc.so.6
#6  0xb7304dfa in __fsetlocking () from /lib/tls/i686/cmov/libc.so.6
#7  0xb730ae4c in malloc_usable_size () from /lib/tls/i686/cmov/libc.so.6
#8  0xb730c45f in mallopt () from /lib/tls/i686/cmov/libc.so.6
#9  0xb730c732 in free () from /lib/tls/i686/cmov/libc.so.6
#10 0x08066681 in msCleanupOnSignal ()
#11 0x0806a0c5 in msCleanupOnSignal ()
#12 0x0806a29d in msCleanupOnSignal ()
#13 0x081131d6 in msRASTERLayerOpen ()
#14 0x08058c86 in msCleanupOnSignal ()
#15 0x080553f8 in msCleanupOnSignal ()
#16 0xb72bbea8 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#17 0x08051c71 in ?? ()

comment:2 by assefa, 15 years ago

Status: newassigned

This seems to indicate that there was a problem drawing one of your raster layers.

Could you please add logging in your map and check what the log says:

CONFIG "MS_ERRORFILE" "/tmp/mylogfile.log" DEBUG 5

I have tried the svg support on my sample layers (vector and raster) and provided that my settings were correct, I had a correct result. Note that for rasters layers to work, you need to configure properly the web elements imagepath and imageurl. This svg renderer creates a temporary image for the ratster inside the imagepath directory and outputs in the svg a link to that image.

svg version="1.1" width="1600" height="1200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

example :in my case my settings are

IMAGEPATH "c:/ms4w/tmp/ms_tmp/"

IMAGEURL "http://localhost/ms_tmp/"

and the svg output looks like this:

<!-- START LAYER bathymetry -->

<image xlink:href="http://localhost/ms_tmp/49387c19_1740_1.png" x="0" y="0" width="1600" height="1200"/> </svg>

comment:3 by pvalsecc, 15 years ago

Since my SVG layer works like a champ in CGI mode and not in FCGI mode, I doubt my layer configuration has any problem.

Here is the log I get for a request that ends up in error 500:

[Fri Dec  5 08:25:20 2008].68478 CGI Request 1 on process 15866
[Fri Dec  5 08:25:20 2008].81986 msPOSTGISLayerOpen called datastatement: the_geom from (SELECT t.id, t.the_geom, t.name, t.track_type_id, d.lft, d.rgt FROM tracks t INNER JOIN directories d ON t.directory_id=d.id) as tracks_full using unique id
[Fri Dec  5 08:25:20 2008].82006 MSPOSTGISLayerOpen -- shared connection not available.
[Fri Dec  5 08:25:20 2008].148901 msConnPoolRegister(tracksPrint,user=XXXXXX password=XXXXXXXX dbname=XXXXXXXXXX host=localhost,0x822a4e0)
[Fri Dec  5 08:25:20 2008].148940 msPOSTGISLayerFreeItemInfo called
[Fri Dec  5 08:25:20 2008].148953 msPOSTGISLayerInitItemInfo called
[Fri Dec  5 08:25:20 2008].148967 msPOSTGISLayerWhichShapes called
[Fri Dec  5 08:25:20 2008].148989 msPOSTGISLayerParseData: unique column = id, srid='', geom_column_name = the_geom, table_name=(SELECT t.id, t.the_geom, t.name, t.track_type_id, d.lft, d.rgt FROM tracks t INNER JOIN directories d ON t.directory_id=d.id) as tracks_full
[Fri Dec  5 08:25:20 2008].149632 query_string_0_6:DECLARE mycursor BINARY CURSOR FOR SELECT "track_type_id"::text,"name"::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),id::text from (SELECT t.id, t.the_geom, t.name, t.track_type_id, d.lft, d.rgt FROM tracks t INNER JOIN directories d ON t.directory_id=d.id) as tracks_full WHERE (id=1148) and (the_geom && setSRID( 'BOX3D(557957.739709622 143911.50345189,571928.060290378 153611.21654811)'::BOX3D,find_srid('','tracks','the_geom') ))
[Fri Dec  5 08:25:20 2008].202842 msPOSTGISLayerFreeItemInfo called
[Fri Dec  5 08:25:20 2008].202863 msPOSTGISLayerClose datastatement: the_geom from (SELECT t.id, t.the_geom, t.name, t.track_type_id, d.lft, d.rgt FROM tracks t INNER JOIN directories d ON t.directory_id=d.id) as tracks_full using unique id
[Fri Dec  5 08:25:20 2008].202870 msPOSTGISLayerClose -- closing query_result
[Fri Dec  5 08:25:20 2008].203897 msConnPoolRelease(tracksPrint,user=XXXXXX password=XXXXXXXXXX dbname=XXXXXXXXXX host=localhost,0x822a4e0)
[Fri Dec  5 08:25:20 2008].203931 msDrawMap(): Layer 1 (tracksPrint), 0.122s
[Fri Dec  5 08:25:20 2008].205566 msDrawMap(): Drawing Label Cache, 0.002s
[Fri Dec  5 08:25:20 2008].205598 msDrawMap() total time: 0.124s
[Fri Dec  5 08:25:20 2008].205787 msSaveImage() total time: 0.000s
[Fri Dec  5 08:25:20 2008].205814 mapserv request processing time (msLoadMap not incl.): 0.137s
[Fri Dec  5 08:25:20 2008].205822 msFreeMap(): freeing map at 0x81a3208.
[Fri Dec  5 08:25:20 2008].205830 msPOSTGISLayerClose datastatement: the_geom from (SELECT t.id, t.the_geom, t.name, t.track_type_id, d.lft, d.rgt FROM tracks t INNER JOIN directories d ON t.directory_id=d.id) as tracks_full using unique id
[Fri Dec  5 08:25:20 2008].205836 msPOSTGISLayerClose -- layerinfo is  NULL

Maybe the crash is because of the postgis driver? I tried to switch to a non-persistent connection and it didn't help.

comment:4 by assefa, 15 years ago

The log shows that there was a problem drawing one of the postgis layers. The initial trace you sent me was had msRASTERLayerOpen which made be believe that there was a problem with one of your raster layers. Are you using the same map? is this a problem only with svg output or any kind of oputput? There is nothing fundamentally different (in term of the svg code) when it is run in cgi or fastcgi. If it is possible to prepare a map/data that I ca reproduce here, I am willing to take a look.

comment:5 by pvalsecc, 15 years ago

Exactly the same map file. The only thing I change is commenting or leaving the SetHandler of my apache conf:

  ScriptAlias /cgi-bin/XXXX /usr/lib/cgi-bin/mapserv
  <Location /cgi-bin/mapserv-st>
    SetEnv MS_MAPFILE /XXX.map
    SetEnv MS_ERRORFILE "/tmp/mapserver.log"
    SetHandler fcgid-script
  </Location>

If I ask for a PNG, it works fine in both config.

comment:6 by assefa, 13 years ago

Resolution: wontfix
Status: assignedclosed

Hopefully not an issue any more. NOte that MS 6.0 uses cairo for it's svg output. Please reopen if there is a problem.

Note: See TracTickets for help on using tickets.