[mapserver-dev] mapcache segv when starting service

Stephen Woodbridge woodbri at swoodbridge.com
Mon Apr 30 10:56:16 EDT 2012


Hi Thomas,

For the record in case anyone else needs to do this:

1. for mapcache rebuild with:
./configure --enable-module --enable-debug

2. create a script like:
  cat ../debug-mapcache
#
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
gdb apache2

3. sudo ../debug-mapcache
run -X
bt

See the below the bt for the solution ...

swoodbridge at iMapTools-tiles:~/work/mapserver-git/mapcache$ sudo 
../debug-mapcache
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/sbin/apache2...done.
(gdb) run -X
Starting program: /usr/sbin/apache2 -X
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff71a2e69 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff71a2e69 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff4a28415 in mapcache_configuration_parse_xml (
     ctx=0x7ffff7e224b8, filename=0x7ffff7e24ab0 "/u/mapcache/mapcache.xml",
     config=0x7ffff7e24ad0) at configuration_xml.c:876
#2  0x00007ffff4a38012 in mapcache_configuration_parse (ctx=0x7ffff7e224b8,
     filename=0x7ffff7e24ab0 "/u/mapcache/mapcache.xml", 
config=0x7ffff7e24ad0,
     cgi=0) at configuration.c:42
#3  0x00007ffff4c63929 in mapcache_add_alias (cmd=0x7fffffffe4c0, cfg=0x0,
     alias=0x7ffff7e24aa0 "/mapcache",
     configfile=0x7ffff7e24ab0 "/u/mapcache/mapcache.xml") at 
mod_mapcache.c:442
#4  0x00007ffff7fd4373 in invoke_cmd (cmd=0x7ffff4e64d40,
     parms=0x7fffffffe4c0, mconfig=0x0, args=0x7ffff7ebd30c "")
     at /build/buildd/apache2-2.2.20/server/config.c:811
#5  0x00007ffff7fd65ea in ap_walk_config_sub (section_vector=0x7ffff7f48ee0,
     parms=0x7fffffffe4c0, current=0x7ffff7ebd2a8)
     at /build/buildd/apache2-2.2.20/server/config.c:1164
#6  ap_walk_config (current=0x7ffff7ebd2a8, parms=0x7fffffffe4c0,
     section_vector=0x7ffff7f48ee0)
     at /build/buildd/apache2-2.2.20/server/config.c:1197
#7  0x00007ffff7fd7502 in ap_process_config_tree (s=<optimized out>,
     conftree=<optimized out>, p=0x7ffff7f86028, ptemp=<optimized out>)
     at /build/buildd/apache2-2.2.20/server/config.c:1792
#8  0x00007ffff7fc010c in main (argc=2, argv=0x7fffffffe738)
     at /build/buildd/apache2-2.2.20/server/main.c:646


So this problem was caused by having:

<service type="wms" enable="true">

instead of:

<service type="wms" enabled="true">

in my xml. I think a little more error reporting on the xml would make 
this much easier to debug. I just seems to be a lot to ask a user to do 
all of the above to find a typo in the xml file. Or maybe having a xml 
conf checker to validate the file first.

-Steve

On 4/30/2012 5:43 AM, thomas bonfort wrote:
> as Andreas hinted, please post the gdb backtrace when running in debug
> mode. i.e.
> gdb /usr/sbin/apache2
>   >  run -X
>   >  bt
>
> --
> thomas
>
> On Mon, Apr 30, 2012 at 03:59, Stephen Woodbridge
> <woodbri at swoodbridge.com>  wrote:
>> Some additional information:
>>
>> I tried this on my old Debian Lenny system and got a complaint that it could
>> not find libmapcache.so.0 which is getting installed in /usr/local/bin so I
>> added to /etc/apache2/envvars
>>
>> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
>>
>> and then got the segv that I was getting on Ubuntu. I added above to Ubuntu
>> also but that did not change the behavior. Regardless, this might be
>> something to mention in the INSTALL document.
>>
>> I also rebuilt mapcache with --enable-debug but it dies before it prints
>> anything into the log files.
>>
>> -Steve
>>
>>
>> On 4/29/2012 9:18 PM, Stephen Woodbridge wrote:
>>>
>>> Hi Thomas,
>>>
>>> I just cloned mapcache trunk and compiled it on Ubuntu 11.10 and tried
>>> to configure it with the following mapcache xml and got a segv. Do any
>>> of the directories need to be created ahead of time? How can I run this
>>> in the debugger to get a backtrace? Nothing in the error.log file either.
>>>
>>> I pretty much followed the mapcache.xml and mapcache.xml.sample files to
>>> create my mapcache.xml below.
>>>
>>> Let me know if you want a ticket with all this in it.
>>>
>>> Thanks,
>>> -Steve
>>>
>>> swoodbridge at iMapTools-tiles:/u$ sudo chown -R www-data.www-data mapcache
>>> swoodbridge at iMapTools-tiles:/u$ ls -al /u/mapcache/
>>> total 12
>>> drwxrwxr-x 2 www-data www-data 4096 2012-04-30 00:54 .
>>> drwxr-xr-x 4 swoodbridge swoodbridge 4096 2012-04-29 13:49 ..
>>> -rw-rw-r-- 1 www-data www-data 2209 2012-04-30 00:54 mapcache.xml
>>>
>>> swoodbridge at iMapTools-tiles:/u$ cat
>>> /etc/apache2/mods-enabled/mapcache.conf
>>> <IfModule mapcache_module>
>>> <Directory /u/mapcache>
>>> Order Allow,Deny
>>> Allow from all
>>> </Directory>
>>> MapCacheAlias /mapcache "/u/mapcache/mapcache.xml"
>>> </IfModule>
>>>
>>>
>>> swoodbridge at iMapTools-tiles:/u$ sudo a2enmod mapcache
>>> Enabling module mapcache.
>>> To activate the new configuration, you need to run:
>>> service apache2 restart
>>> swoodbridge at iMapTools-tiles:/u$ sudo service apache2 restart
>>> Segmentation fault
>>> Action 'configtest' failed.
>>> The Apache error log may have more information.
>>> ...fail!
>>>
>>> swoodbridge at iMapTools-tiles:/u$ cat /u/mapcache/mapcache.xml
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <mapcache>
>>> <metadata>
>>> <title>iMaptools mapcache service</title>
>>> <abstract>Contains various services for Tiger 2011 maps</abstract>
>>> </metadata>
>>>
>>> <cache name="disk" type="disk">
>>> <base>/u/mapcache</base>
>>> <symlink_blank/>
>>> </cache>
>>>
>>> <source name="tiger2011" type="wms">
>>> <getmap>
>>> <params>
>>> <FORMAT>image/png</FORMAT>
>>> <MAP_IMAGETYPE>agg_qn</MAP_IMAGETYPE>
>>> <LAYERS>Tiger_2011</LAYERS>
>>> </params>
>>> </getmap>
>>>
>>> <http>
>>> <url>http://localhost/cgi-bin/mapserv</url>
>>> </http>
>>> </source>
>>>
>>> <source name="tiger2011-streets" type="wms">
>>> <getmap>
>>> <params>
>>> <FORMAT>image/png</FORMAT>
>>> <MAP_IMAGETYPE>agg_qn</MAP_IMAGETYPE>
>>> <LAYERS>streets</LAYERS>
>>> <TRANSPARENT>true</TRANSPARENT>
>>> </params>
>>> </getmap>
>>>
>>> <http>
>>> <url>http://localhost/cgi-bin/mapserv</url>
>>> </http>
>>> </source>
>>>
>>> <format name="PNGQ_FAST" type="PNG">
>>> <compression>fast</compression>
>>> <colors>256</colors>
>>> </format>
>>>
>>> <format name="PNG_BEST" type="PNG">
>>> <compression>best</compression>
>>> </format>
>>>
>>> <tileset name="tiger-base">
>>> <source>tiger2011</source>
>>> <cache>disk</cache>
>>> <grid>WGS84</grid>
>>> <grid>g</grid>
>>> <format>PNGQ_FAST</format>
>>> <metatile>5 5</metatile>
>>> <metabuffer>30</metabuffer>
>>> <expires>3600</expires>
>>> </tileset>
>>>
>>> <tileset name="tiger-streets">
>>> <source>tiger2011-streets</source>
>>> <cache>disk</cache>
>>> <grid>WGS84</grid>
>>> <grid>g</grid>
>>> <format>PNGQ_FAST</format>
>>> <metatile>5 5</metatile>
>>> <metabuffer>30</metabuffer>
>>> <expires>3600</expires>
>>> </tileset>
>>>
>>> <default_format>PNGQ_FAST</default_format>
>>>
>>> <service type="wms" enable="true">
>>> <full_wms>assemble</full_wms>
>>> <resample_mode>bilinear</resample_mode>
>>> <format>PNG</format>
>>> <maxsize>4096</maxsize>
>>> </service>
>>> <service type="wmts" enabled="true"/>
>>> <service type="tms" enabled="true"/>
>>> <service type="kml" enabled="true"/>
>>> <service type="gmaps" enabled="true"/>
>>> <service type="ve" enabled="true"/>
>>> <service type="demo" enabled="true"/>
>>>
>>> <errors>report</errors>
>>> <lock_dir>/tmp</lock_dir>
>>>
>>> </mapcache>
>>> _______________________________________________
>>> 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