legend template crash with fast CGI

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Oct 16 16:37:10 PDT 2006


Jeez, need to read more carefully, thanks for the test case. Would help to track in bugzilla at any rate...

Steve

>>> Mguel Coladas <mcoladas at TELEFONICA.NET> 10/14/2006 4:06:41 AM >>>
Hi,
I had some problems with legend mode when I was worked with fastCGI some 
months ago. I had to stop this job for a time, but I can retake it again 
now.
I'm testing the last CGI MapServer version. When i want use the legend 
template option MapServer crashes in some cases (and isn't fastCGI).
I atach a test case to reproduce (mapfile, legend template and url) this 
problem.

The MapServer version:

/usr/local/apache/cgi-bin/mapserv -v
MapServer version 4.10.0-rc1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG 
OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE 
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER 
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER INPUT=EPPL7 INPUT=POSTGIS 
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

Valgrind results:

valgrind /usr/local/apache/cgi-bin/mapserv 
QUERY_STRING='map=/usr/local/apache/htdocs/mapserver/maps/prueba.map&mode=legend&layers=a+b&mapext=458350+4613016+704030+4858696&mapsize=350+350&map_legend_template=../templates/legend_pruebas.html' 

==3299== Memcheck, a memory error detector for x86-linux.
==3299== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==3299== Using valgrind-2.1.0, a program supervision framework for 
x86-linux.
==3299== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==3299== Estimated CPU clock rate is 1922 MHz
==3299== For more details, rerun with: -v
==3299==
==3299== Invalid free() / delete / delete[]
==3299==    at 0x4002B455: free (vg_replace_malloc.c:186)
==3299==    by 0x40BBBCBB: (within /lib/i686/libc-2.3.3.so)
==3299==    by 0x40BBB951: __libc_freeres (in /lib/i686/libc-2.3.3.so)
==3299==    by 0x4016AACC: vgPlain___libc_freeres_wrapper 
(vg_intercept.c:172)
==3299==  Address 0x410AA570 is not stack'd, malloc'd or free'd
==3299==
==3299== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==3299== malloc/free: in use at exit: 19708 bytes in 16 blocks.
==3299== malloc/free: 1746 allocs, 1731 frees, 1759492 bytes allocated.
==3299== For a detailed leak analysis,  rerun with: --leak-check=yes
==3299== For counts of detected errors, rerun with: -v

Thanks,
   Miguel

Mguel Coladas escribió:
> I have tried using valgrind --num-callers=20, but don't tell much anyway.
>
> I'm testing if the crash is caused by a special layer, or by a special 
> set of layers.
> It seems that when I put more than seven layers visibles in the legend 
> mapserver crash. If i put maxscale and minscale works, but the layers 
> are not visible.
>
> When i can, i  package a test case to send you.
>
> Thanks
>
> Daniel Morissette escribió:
>> Um.. it seems that Valgrind is finding something but we can't tell 
>> much from this Valgrind output. Perhaps try using 'valgrind 
>> --num-callers=20' to get a more complete call stack in the Valgrind 
>> output (note that since the error is reported inside valgrind's 
>> libc_freeres_wrapper that probably won't tell us much anyway, but we 
>> can try).
>>
>> Would it be possible for you to package a test case (mapfile, data, 
>> html templates, etc.) to send us to reproduce this issue? Since this 
>> is happening when generating in mode=legend, we may be able get away 
>> with a test case with just the mapfile and templates (without the 
>> data) but I'm not sure.
>>
>> Daniel
>>
>>
>> miguel coladas wrote:
>>> Thanks for your answer Daniel.
>>>
>>> I'm testing with latest 4.10 beta and I'm having some problems
>>>
>>> [miguel at mcoladas miguel]$ /usr/local/apache/fcgi-bin/mapserv -v
>>> MapServer version 4.10.0-beta1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG 
>>> OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE 
>>> SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER 
>>> SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=FASTCGI INPUT=EPPL7 
>>> INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>>>
>>> With this version of mapserver I have run Valgrind at the command 
>>> line as you tell me:
>>>
>>> [miguel at mcoladas miguel]$ valgrind 
>>> /usr/local/apache/fcgi-bin/mapserv 
>>> QUERY_STRING="map=/usr/local/apache/htdocs/mapserver/map/client-draw.map&mode=legend&layers=provincias&mapext=458350+4613016+704030+4858696&mapsize=350+350&map_legend_template=../templates/legend.html" 
>>>
>>> ==5322== Memcheck, a memory error detector for x86-linux.
>>> ==5322== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
>>> ==5322== Using valgrind-2.1.0, a program supervision framework for 
>>> x86-linux.
>>> ==5322== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
>>> ==5322== Estimated CPU clock rate is 1923 MHz
>>> ==5322== For more details, rerun with: -v
>>> ==5322==
>>> ==5322== Invalid free() / delete / delete[]
>>> ==5322==    at 0x4002B455: free (vg_replace_malloc.c:186)
>>> ==5322==    by 0x40BC4CBB: (within /lib/i686/libc-2.3.3.so)
>>> ==5322==    by 0x40BC4951: __libc_freeres (in /lib/i686/libc-2.3.3.so)
>>> ==5322==    by 0x4016AACC: vgPlain___libc_freeres_wrapper 
>>> (vg_intercept.c:172)
>>> ==5322==  Address 0x410897F8 is not stack'd, malloc'd or free'd
>>> ==5322==
>>> ==5322== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
>>> ==5322== malloc/free: in use at exit: 58517 bytes in 129 blocks.
>>> ==5322== malloc/free: 14327 allocs, 14199 frees, 4390277 bytes 
>>> allocated.
>>> ==5322== For a detailed leak analysis,  rerun with: --leak-check=yes
>>> ==5322== For counts of detected errors, rerun with: -v
>>>
>>> any idea?
>>>
>>>
>>> Daniel Morissette escribió:
>>>
>>>> If you are on Linux then you could perhaps capture the URL of the 
>>>> request that causes the crash, and then run it under Valgrind 
>>>> (http://valgrind.org/) at the command line using something like:
>>>>
>>>> valgrind ./mapserv QUERY_STRING="map=....."
>>>>
>>>> You get the value of QUERY_STRING from the URL that causes the crash.
>>>>
>>>> If Valgrind reports errors then I suggest you create a bug report 
>>>> with the Valgrind output and a test case to reproduce (including 
>>>> mapfile, test dataset, etc. and the query_string that causes the 
>>>> crash).
>>>>
>>>> BTW, I would suggest that you test this against the latest 4.10 
>>>> beta before reporting a bug.
>>>>
>>>> Daniel
>>>>
>>>>
>>>>
>>>> miguel coladas wrote:
>>>>
>>>>> Hi everyone,
>>>>>
>>>>> first i'm spanish, so sorry for my english.
>>>>> I'm using mapserver (4.8.3) in fast CGI mode (apache 2.0.59, 
>>>>> mod_fastcgi/2.4.2). I'm having some problems with this 
>>>>> configuration when i want use the legend template option.
>>>>> In the legend template file, when I put "[leg_layer_html 
>>>>> opt_flag=1]" the legend works correctly. However, when I put 
>>>>> "[leg_layer_html opt_flag=2]" mapserver crashes. In CGI mode, the 
>>>>> same legend works correctly. Other modes (map, query... works 
>>>>> correctly too).
>>>>>
>>>>> The error_log of apache server:
>>>>>
>>>>> [Mon Aug 21 18:16:43 2006] [error] [client 192.168.1.3] Premature 
>>>>> end of script headers: mapserv
>>>>>
>>>>> I think this is a bug with mapserver in fast CGI mode. Can anyone 
>>>>> help me out with this?
>>>>>
>>>>> Many thanks,
>>>>>
>>>>>     Miguel Coladas
>>>>
>>>>
>>>>
>>>
>>
>>
>



More information about the MapServer-users mailing list