[OSM-dev] Mapnik segfault - revision 451

Jon Burgess jburgess777 at googlemail.com
Wed Mar 7 23:36:13 GMT 2007


On Wed, 2007-03-07 at 23:08 +0000, Nick Whitelegg wrote:
> Hello Artem (and anyone else who may be able to help...)
> 
> I've now tried the Mapnik demo on the Freemap server using revision 451 (I am 
> using 451 rather than the most up to date version as I wanted to avoid the 
> dependency on 'property_tree' so I could use the built in Debian boost 
> packages).
> 
> I still get a segfault like error when I run the demo. Revision 451 worked 
> fine on my home box.
> 
> Any pointers as to what might be wrong? Copy and paste of my console, plus gdb 
> run below.
> 
> Thanks,
> Nick
> 
> nick at freemap:~/mapnik/demo/c++$ !592
> ./rundemo /usr/local/lib/mapnik/input
>  running demo ...
> *** glibc detected *** free(): invalid pointer: 0x0808c2f8 ***
> Aborted
> nick at freemap:~/mapnik/demo/c++$ gdb rundemo
> GNU gdb 6.4.90-debian
> Copyright (C) 2006 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i486-linux-gnu"...Using host libthread_db library 
> "/lib/libthread_db.so.1".
> 
> (gdb) r /usr/local/lib/mapnik/input
> Starting 
> program: /home/nick/mapnik/demo/c++/rundemo /usr/local/lib/mapnik/input
> [Thread debugging using libthread_db enabled]
> [New Thread 16384 (LWP 23509)]
>  running demo ...
> *** glibc detected *** free(): invalid pointer: 0x0808c2f8 ***
> 
> Program received signal SIGABRT, Aborted.
> [Switching to Thread 16384 (LWP 23509)]
> 0x40269b01 in kill () from /lib/libc.so.6
> (gdb) bt
> #0  0x40269b01 in kill () from /lib/libc.so.6
> #1  0x40633f65 in pthread_kill () from /lib/libpthread.so.0
> #2  0x40633fab in raise () from /lib/libpthread.so.0
> #3  0x40269894 in raise () from /lib/libc.so.6
> #4  0x4026accc in abort () from /lib/libc.so.6
> #5  0x4029db0f in __fsetlocking () from /lib/libc.so.6
> #6  0x402a3080 in __libc_malloc_pthread_startup () from /lib/libc.so.6
> #7  0x402a4628 in free () from /lib/libc.so.6
> #8  0x401dc3b1 in operator delete () from /usr/lib/libstdc++.so.6
> #9  0x401b8ebd in std::string::_Rep::_M_destroy () 
> from /usr/lib/libstdc++.so.6
> #10 0x40088c5b in mapnik::datasource_cache::register_datasources ()
>    from /usr/local/lib/libmapnik.so
> #11 0x08055183 in main ()
> (gdb)
> 

I don't know the cause, but here are some things to try. 

The backtrace looks a little suspicious with free apparently calling
__libc_malloc_pthread_startup. I'd suspect some pointer related problem
which probably occurred some time prior to the crash. Running program
under valgrind is often a good way to diagnose these issues.

Be quite careful if you start reverting file revisions since you can end
up with object files with new timestamps which do not get recompiled
when the source file goes back in time (assuming they get the timestamp
of svn checkin).

I would also make sure that all you have recently recompiled the rundemo
code (i've saw an issue once before with an old rundemo executable after
updating the libmapnik.so file). Also check the libraries are running
against the versions which you compiled and installed (e.g. check 'ldd
rundemo' shows it linking with /usr/local/lib/libmapnik.so and the
timestamp of this library is within a few seconds of the mapnik plugin
files and consistent with when you compiled this code.

	Jon






More information about the dev mailing list