[mapserver-dev] getting a crash that might be 32-64 bit ro buildissue related

Stephen Woodbridge woodbri at swoodbridge.com
Sat Jun 21 14:55:24 EDT 2008


Thomas,

I moved the test case to my 64bit machine and can not reproduce the 
problem, so I am inclined to believe this is a library/header file 
mismatch on the clients Linux distribution. It seems yum installs both 
32bit and 64bit libraries and I not sure how it deals with header files.

If you want the test case let me know, but I'm not sure of the value 
given that it runs on my Debian box.

I will recommend that we move to a 32bit arch as we know that works.

Thank you for your help.

-Steve W.

Stephen Woodbridge wrote:
> Here is the stacktrace from gdb on 5.2 beta2. As I said before, this 
> does not segv at least I did not wait that long to see and I have let it 
> run for 5+mins in the past with it using 100% cpu. The numbers for x1 
> and x2 in the call to imageScanline() look suspect, but I'm not familiar 
> with this code.
> 
> (gdb) bt
> #0  imageScanline (im=0x1a168400, x1=-16480499, x2=0, y=-2147483648, 
> c=2467402)
>     at mapgd.c:678
> #1  0x00000000004426ea in imageFilledPolygon (im=0x1a168400, 
> p=0x7fff290ad2e0,
>     c=2467402, offsetx=0, offsety=0) at mapgd.c:975
> #2  0x000000000044d06b in msDrawShadeSymbolGD (symbolset=0x19ee6230,
>     img=0x1a168400, p=0x7fff290ad2e0, style=0x7fff290ad1d0, scalefactor=1)
>     at mapgd.c:2258
> #3  0x000000000043c749 in msDrawLabelCache (image=0x19eefd90, 
> map=0x19ee6200)
>     at mapdraw.c:2215
> #4  0x0000000000441157 in msDrawMap (map=0x19ee6200, querymap=0)
>     at mapdraw.c:490
> #5  0x000000000040bdcc in main (argc=1, argv=<value optimized out>)
>     at mapserv.c:1405
> 
> 
> 
> -Steve
> 
> thomas bonfort wrote:
>> Hi,
>> could you also include the stacktrace from 5.2 please.
>> it seems the segfault appears when using a backgroundcolor for the
>> label. Would it be easy for you to try to disable them and confirm?
>> thanks,
>> thomas
>>
>> On Sat, Jun 21, 2008 at 6:17 AM, Stephen Woodbridge
>> <woodbri at swoodbridge.com> wrote:
>>> I just checked and it appears to be reproducible on both and I have
>>> confirmed I can reproduce it on 5.2 b2 also.
>>>
>>> For the png test I added map.imagetype=PNG8 and tried map.imagetype=png
>>> where the mapfile has
>>>
>>>  OUTPUTFORMAT
>>>    NAME "agg/png24"
>>>    MIMETYPE "image/png"
>>>    DRIVER "AGG/PNG"
>>>    EXTENSION "png"
>>>    FORMATOPTION "PALETTE_FORCE=TRUE"
>>>    FORMATOPTION "PALETTE=/u/data/maps/palette-ayna-agg.txt"
>>>  END
>>>
>>>  OUTPUTFORMAT
>>>    NAME PNG8
>>>    DRIVER "GD/PNG"
>>>    EXTENSION "png"
>>>    MIMETYPE "image/png"
>>>    IMAGEMODE RGBA
>>>    TRANSPARENT ON
>>>    FORMATOPTION "QUANTIZE_FORCE=ON"
>>>    FORMATOPTION "QUANTIZE_DITHER=OFF"
>>>    FORMATOPTION "QUANTIZE_COLORS=256"
>>>  END
>>>
>>>
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].320026 msDrawMap(): Layer 0 (World), 0.059s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].416089 msDrawMap(): Layer 1 (CountryZ1), 0.096s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].419505 msDrawMap(): Layer 5 (Land Contour), 0.003s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].460156 msDrawMap(): Layer 6 (World), 0.041s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].544059
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] 
>>> msDrawMap(): Layer
>>> 7 (CountryZ1), 0.084s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].545289
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] 
>>> msDrawMap(): Layer
>>> 8 (Urban Areas), 0.001s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].591990
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] 
>>> msDrawMap(): Layer
>>> 9 (Water p), 0.047s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].593163
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] 
>>> msDrawMap(): Layer
>>> 10 (Water l), 0.001s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].593603
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] 
>>> msDrawMap(): Layer
>>> 11 (Land Use), 0.000s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].596240
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] 
>>> msDrawMap(): Layer
>>> 20 (City Placenames), 0.003s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].629935 msDrawMap(): Layer 21 (City points), 0.034s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].629979 msPOSTGISLayerOpen called datastatement: 
>>> the_geom from
>>> (select a.gid, a.fcc, a.the_geom, initcap(a.name) as name_out, 
>>> a.name_alt as
>>> name_arb from data.st a  where a.fcc in ('A20')) as foo using SRID=4326
>>> using unique gid
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].630000 MSPOSTGISLayerOpen -- shared connection not 
>>> available.
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].635411 msConnPoolRegister(Streets A20,user=postgres
>>> dbname=test3 host=localhost port=5432,0x1f9855f0)
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].635432 msPOSTGISLayerFreeItemInfo called
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].635444 msPOSTGISLayerInitItemInfo called
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].635454 msPOSTGISLayerWhichShapes called
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].635467 msPOSTGISLayerParseData: unique column = gid,
>>> srid='4326', geom_column_name = the_geom, table_name=(select a.gid, 
>>> a.fcc,
>>> a.the_geom, initcap(a.name) as name_out, a.name_alt as name_arb from 
>>> data.st
>>> a  where a.fcc in ('A20')) as foo
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].636178 query_string_0_6:DECLARE mycursor BINARY CURSOR 
>>> FOR
>>> SELECT
>>> "name_out"::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text 
>>>
>>> from (select a.gid, a.fcc, a.the_geom, initcap(a.name) as name_out,
>>> a.name_alt as name_arb from data.st a  where a.fcc in ('A20')) as foo 
>>> WHERE
>>> the_geom && setSRID('BOX3D(8.00592636360692
>>> 36.6145187636069,9.22424883639308 37.8328412363931)'::BOX3D, 4326 )
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].681837 msPOSTGISLayerFreeItemInfo called
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].681875 msPOSTGISLayerClose datastatement: the_geom from
>>> (select a.gid, a.fcc, a.the_geom, initcap(a.name) as name_out, 
>>> a.name_alt as
>>> name_arb from data.st a  where a.fcc in ('A20')) as foo using SRID=4326
>>> using unique gid
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].681885 msPOSTGISLayerClose -- closing query_result
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].682483 msConnPoolRelease(Streets A20,user=postgres
>>> dbname=test3 host=localhost port=5432,0x1f9855f0)
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].682496 msConnPoolClose(user=postgres dbname=test3
>>> host=localhost port=5432,0x1f9855f0)
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].682535 msDrawMap(): Layer 22 (Streets A20), 0.053s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].733862
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] 
>>> msDrawMap(): Layer
>>> 23 (Streets A10), 0.051s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].734436
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] 
>>> msDrawMap(): Layer
>>> 25 (Placenames), 0.000s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].768513 msDrawMap(): Layer 26 (City points), 0.034s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].798392 msDrawMap(): Layer 27 (Airport p), 0.030s
>>> [Fri Jun 20 23:06:41 2008] [error] [client 129.44.191.48] [Fri Jun 20
>>> 23:06:41 2008].828134 msDrawMap(): Layer 28 (Airport points), 0.030s
>>> [Fri Jun 20 23:08:27 2008] [warn] [client 129.44.191.48] Timeout 
>>> waiting for
>>> output from CGI script /u/apache2/cgi-bin/mapserv
>>> [Fri Jun 20 23:08:41 2008] [warn] [client 129.44.191.48] Timeout 
>>> waiting for
>>> output from CGI script /u/apache2/cgi-bin/mapserv-5.2b2
>>> [Fri Jun 20 23:08:41 2008] [error] [client 129.44.191.48] Premature 
>>> end of
>>> script headers: mapserv-5.2b2
>>>
>>> So this looks like it is probably in the labelcache processing where 
>>> it is
>>> timing out, it also seems to be malloc'ing memory based on strace 
>>> before it
>>> segv or times out and this is confirmed by top.
>>>
>>> -Steve W
>>>
>>> Steve Lime wrote:
>>>> Is it present in both AGG and GD?
>>>>
>>>>>>> On 6/20/2008 at 5:42 PM, in message 
>>>>>>> <485C3255.1090207 at swoodbridge.com>,
>>>>>>> Stephen
>>>> Woodbridge <woodbri at swoodbridge.com> wrote:
>>>>> After spending 3 days chasing a problem that is making me nuts, I 
>>>>> thought
>>>>> I would post this much.
>>>>>
>>>>> It is clearly label related because if we comment out the label 
>>>>> block it
>>>>> works fine.
>>>>>
>>>>> I have been able to reproduce this in mapserver CGI just a short while
>>>>> ago. I will try it with 5.2 when I have a chance and let you know what
>>>>> happens.
>>>>>
>>>>> Meanwhile, does this back trace look familiar? Thomas? Steve?
>>>>>
>>>>> Thanks,
>>>>>   -Steve
>>>>>
>>>>> MapServer version 5.0.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
>>>>> OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE 
>>>>> SUPPORTS=WMS_SERVER
>>>>> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=GEOS INPUT=EPPL7
>>>>> INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>>>>>
>>>>> Program received signal SIGSEGV, Segmentation fault.
>>>>> [Switching to Thread 46912496217952 (LWP 15375)]
>>>>> 0x00002aaaae38ccb1 in 
>>>>> agg::rasterizer_cells_aa<agg::cell_aa>::sort_cells
>>>>> ()
>>>>>    from 
>>>>> /usr/lib64/extensions/no-debug-non-zts-20020429/php_mapscript.so
>>>>> (gdb) bt
>>>>> #0  0x00002aaaae38ccb1 in
>>>>> agg::rasterizer_cells_aa<agg::cell_aa>::sort_cells ()
>>>>>    from 
>>>>> /usr/lib64/extensions/no-debug-non-zts-20020429/php_mapscript.so
>>>>> #1  0x00002aaaae39c396 in
>>>>>
>>>>> agg::render_scanlines<agg::rasterizer_scanline_aa<agg::rasterizer_sl_clip<agg:: 
>>>>>
>>>>> ras_conv_int>  >,
>>>>> agg::scanline_p8,
>>>>>
>>>>> agg::renderer_scanline_aa_solid<agg::renderer_base<agg::pixfmt_alpha_blend_rgb 
>>>>>
>>>>> a<agg::blender_rgba_pre<agg::rgba8,
>>>>> agg::order_bgra>, mapserv_row_ptr_cache<int>, int> > > > ()
>>>>>    from 
>>>>> /usr/lib64/extensions/no-debug-non-zts-20020429/php_mapscript.so
>>>>> #2  0x00002aaaae39cbb5 in
>>>>> AGGMapserverRenderer::renderPathSolid<polygon_adaptor> ()
>>>>>    from 
>>>>> /usr/lib64/extensions/no-debug-non-zts-20020429/php_mapscript.so
>>>>> #3  0x00002aaaae386403 in msDrawShadeSymbolAGG () from
>>>>> /usr/lib64/extensions/no-debug-non-zts-20020429/php_mapscript.so
>>>>> #4  0x00002aaaae36ae2b in msDrawLabelCache () from
>>>>> /usr/lib64/extensions/no-debug-non-zts-20020429/php_mapscript.so
>>>>> #5  0x00002aaaae36f827 in msDrawMap () from
>>>>> /usr/lib64/extensions/no-debug-non-zts-20020429/php_mapscript.so
>>>>> #6  0x00002aaaae328309 in php3_ms_map_draw () from
>>>>> /usr/lib64/extensions/no-debug-non-zts-20020429/php_mapscript.so
>>>>> #7  0x00000000005255fb in execute (op_array=0xd88a418) at
>>>>> /home/steve/work/php-4.4.8/Zend/zend_execute.c:1681
>>>>> #8  0x000000000050d44b in zend_execute_scripts (type=8, retval=0x0,
>>>>> file_count=3)
>>>>>     at /home/steve/work/php-4.4.8/Zend/zend.c:939
>>>>> #9  0x00000000004e06fb in php_execute_script
>>>>> (primary_file=0x7fff80acb250) at
>>>>> /home/steve/work/php-4.4.8/main/main.c:1758
>>>>> #10 0x0000000000529ed2 in main (argc=4, argv=0x7fff80acb398) at
>>>>> /home/steve/work/php-4.4.8/sapi/cli/php_cli.c:838
>>>>> _______________________________________________
>>>>> mapserver-dev mailing list
>>>>> mapserver-dev at lists.osgeo.org
>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>>> _______________________________________________
>>> mapserver-dev mailing list
>>> mapserver-dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>>>
> 
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev



More information about the mapserver-dev mailing list