Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Segfault under Ubuntu 10.04 #13

Open
wDevil opened this Issue · 42 comments

5 participants

@wDevil

Boost version: 1.48 build from src.

Try to parse test.xml from folder test in carto-generator project and have segfault:

$ ~/src/carto-generator/example ~/src/carto-generator/tests/test.xml ./test.mml
Segmentation fault

valgrind output: https://gist.github.com/567dd3ec2c2a65466f5f

head of trace from gdb:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff73fc05f in std::basic_string, std::allocator >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6

#0 0x00007ffff73fc05f in std::basic_string, std::allocator >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6
#1 0x00000000004b48e8 in bool boost::spirit::karma::rulestd::back_insert_iterator<std::string, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type>::generate, boost::fusion::vector0 >, boost::spirit::unused_type, boost::optionalstd::string >(boost::spirit::karma::detail::output_iteratorstd::back_insert_iterator<std::string, mpl_::int_<15>, boost::spirit::unused_type>&, boost::spirit::context, boost::fusion::vector0 >&, boost::spirit::unused_type const&, boost::optionalstd::string const&) const (this=0x7fffffffd920, sink=..., delim=..., attr=...)
at /usr/local/include/boost/spirit/home/karma/nonterminal/rule.hpp:285
#2 0x00000000004b379b in bool boost::spirit::karma::referenceboost::spirit::karma::rule<std::back_insert_iterator<std::string, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>::generateboost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string, mpl_::int_<15>, boost::spirit::unused_type>, boost::spirit::context, boost::fusion::vector0 >, boost::spirit::unused_type, boost::optionalstd::string >(boost::spirit::karma::detail::output_iteratorstd::back_insert_iterator<std::string, mpl_::int_<15>, boost::spirit::unused_type>&, boost::spirit::context, boost::fusion::vector0 >&, boost::spirit::unused_type const&, boost::optionalstd::string const&) const (this=0x8ba358, sink=..., context=..., delim=..., attr=...) at /usr/local/include/boost/spirit/home/karma/reference.hpp:46
#3 0x00000000004b269e in bool boost::spirit::karma::omit_directiveboost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, true>::generateboost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string, mpl_::int_<15>, boost::spirit::unused_type>, boost::spirit::context, boost::fusion::vector0 >, boost::spirit::unused_type, boost::optionalstd::string >(boost::spirit::karma::detail::output_iteratorstd::back_insert_iterator<std::string, mpl_::int_<15>, boost::spirit::unused_type>&, boost::spirit::context, boost::fusion::vector0 >&, boost::spirit::unused_type const&, boost::optionalstd::string const&) const (this=0x8ba358, sink=..., ctx=..., d=..., attr=...)
at /usr/local/include/boost/spirit/home/karma/directive/omit.hpp:80

@springmeyer

Interesting. Not seen this on osx. I'm now also running boost 1.48 so I will try to test again. @rfw and @rcoup - you guys tried to run carto-parser recently?

@wDevil

It is normal, that program uses shared libs 42 and 48 boost versions?

$ ldd ~/src/carto-generator/example
linux-vdso.so.1 => (0x00007fff65fe6000)
libmapnik2.so.2.0 => /usr/local/lib/libmapnik2.so.2.0 (0x00007ffde21ef000)
libboost_program_options.so.1.48.0 => /usr/local/lib/libboost_program_options.so.1.48.0 (0x00007ffde1f94000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ffde1c7f000)
libm.so.6 => /lib/libm.so.6 (0x00007ffde19fc000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007ffde17e5000)
libc.so.6 => /lib/libc.so.6 (0x00007ffde1461000)
libicuuc.so.42 => /usr/lib/libicuuc.so.42 (0x00007ffde1106000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007ffde0ee9000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007ffde0c62000)
libltdl.so.7 => /usr/lib/libltdl.so.7 (0x00007ffde0a58000)
libpng12.so.0 => /lib/libpng12.so.0 (0x00007ffde0831000)
libtiff.so.4 => /usr/lib/libtiff.so.4 (0x00007ffde05ce000)
libz.so.1 => /lib/libz.so.1 (0x00007ffde03b7000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007ffde0193000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007ffddff50000)
libboost_filesystem.so.1.48.0 => /usr/local/lib/libboost_filesystem.so.1.48.0 (0x00007ffddfd31000)
libboost_regex.so.1.48.0 => /usr/local/lib/libboost_regex.so.1.48.0 (0x00007ffddfa1e000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007ffddf6cd000)
libboost_thread.so.1.48.0 => /usr/local/lib/libboost_thread.so.1.48.0 (0x00007ffddf4b2000)
libboost_system.so.1.48.0 => /usr/local/lib/libboost_system.so.1.48.0 (0x00007ffddf2ae000)
librt.so.1 => /lib/librt.so.1 (0x00007ffddf0a5000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffde2716000)
libicudata.so.42 => /usr/lib/libicudata.so.42 (0x00007ffdddf60000)
libdl.so.2 => /lib/libdl.so.2 (0x00007ffdddd5b000)
libicui18n.so.42 => /usr/lib/libicui18n.so.42 (0x00007ffddd9a3000)

@springmeyer

looks fine. the only 42 I see is the soname for the icu libraries, which are different than boost.

The crashing bit is in spirit's karma, which is header only, so it will not show up in the ldd output. Perhaps your mapnik is compiled against a different set of boost headers?

@wDevil

yes
$ ldd /usr/local/lib/libmapnik2.so
linux-vdso.so.1 => (0x00007fffcebd7000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f95666f1000)
libltdl.so.7 => /usr/lib/libltdl.so.7 (0x00007f95664e7000)
libpng12.so.0 => /lib/libpng12.so.0 (0x00007f95662bf000)
libtiff.so.4 => /usr/lib/libtiff.so.4 (0x00007f956605d000)
libz.so.1 => /lib/libz.so.1 (0x00007f9565e46000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007f9565c21000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007f95659df000)
libicuuc.so.42 => /usr/lib/libicuuc.so.42 (0x00007f9565684000)
libboost_filesystem.so.1.48.0 => /usr/local/lib/libboost_filesystem.so.1.48.0 (0x00007f9565464000)
libboost_regex.so.1.48.0 => /usr/local/lib/libboost_regex.so.1.48.0 (0x00007f9565151000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007f9564e01000)
libboost_thread.so.1.48.0 => /usr/local/lib/libboost_thread.so.1.48.0 (0x00007f9564be5000)
libboost_system.so.1.48.0 => /usr/local/lib/libboost_system.so.1.48.0 (0x00007f95649e1000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f95646cd000)
libm.so.6 => /lib/libm.so.6 (0x00007f9564449000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f9564232000)
libc.so.6 => /lib/libc.so.6 (0x00007f9563eaf000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f9563caa000)
libicudata.so.42 => /usr/lib/libicudata.so.42 (0x00007f9562b65000)
librt.so.1 => /lib/librt.so.1 (0x00007f956295c000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f956273f000)
libicui18n.so.42 => /usr/lib/libicui18n.so.42 (0x00007f9562387000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9566e9e000)
boost compiled by this article https://github.com/mapnik/mapnik/wiki/Mapnik2
maybe something is wrong with boost?

@wDevil

i recompile all with correct version:
$ ldd /usr/local/lib/libmapnik2.so.2.0.0
linux-vdso.so.1 => (0x00007ffffd7ff000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f289a8c4000)
libltdl.so.7 => /usr/lib/libltdl.so.7 (0x00007f289a6ba000)
libpng12.so.0 => /lib/libpng12.so.0 (0x00007f289a492000)
libtiff.so.4 => /usr/lib/libtiff.so.4 (0x00007f289a230000)
libz.so.1 => /lib/libz.so.1 (0x00007f289a019000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007f2899df4000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007f2899bb2000)
libicuuc.so.48 => /usr/local/lib/libicuuc.so.48 (0x00007f2899822000)
libboost_filesystem.so.1.48.0 => /usr/local/lib/libboost_filesystem.so.1.48.0 (0x00007f2899602000)
libboost_regex.so.1.48.0 => /usr/local/lib/libboost_regex.so.1.48.0 (0x00007f28992ef000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007f2898f9f000)
libboost_thread.so.1.48.0 => /usr/local/lib/libboost_thread.so.1.48.0 (0x00007f2898d83000)
libboost_system.so.1.48.0 => /usr/local/lib/libboost_system.so.1.48.0 (0x00007f2898b7f000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f289886b000)
libm.so.6 => /lib/libm.so.6 (0x00007f28985e7000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f28983d0000)
libc.so.6 => /lib/libc.so.6 (0x00007f289804d000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f2897e48000)
libicudata.so.48 => /usr/local/lib/libicudata.so.48 (0x00007f2896ad9000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f28968bc000)
librt.so.1 => /lib/librt.so.1 (0x00007f28966b3000)
libicui18n.so.48 => /usr/local/lib/libicui18n.so.48 (0x00007f289629b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f289b06e000)

$ ldd ./example
linux-vdso.so.1 => (0x00007fffc57ff000)
libmapnik2.so.2.0 => /usr/local/lib/libmapnik2.so.2.0 (0x00007f8354c9c000)
libboost_program_options.so.1.48.0 => /usr/local/lib/libboost_program_options.so.1.48.0 (0x00007f8354a41000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f835472c000)
libm.so.6 => /lib/libm.so.6 (0x00007f83544a9000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f8354292000)
libc.so.6 => /lib/libc.so.6 (0x00007f8353f0e000)
libicuuc.so.48 => /usr/local/lib/libicuuc.so.48 (0x00007f8353b7e000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f8353961000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f83536da000)
libltdl.so.7 => /usr/lib/libltdl.so.7 (0x00007f83534d0000)
libpng12.so.0 => /lib/libpng12.so.0 (0x00007f83532a9000)
libtiff.so.4 => /usr/lib/libtiff.so.4 (0x00007f8353046000)
libz.so.1 => /lib/libz.so.1 (0x00007f8352e2f000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007f8352c0b000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007f83529c8000)
libboost_filesystem.so.1.48.0 => /usr/local/lib/libboost_filesystem.so.1.48.0 (0x00007f83527a9000)
libboost_regex.so.1.48.0 => /usr/local/lib/libboost_regex.so.1.48.0 (0x00007f8352496000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007f8352145000)
libboost_thread.so.1.48.0 => /usr/local/lib/libboost_thread.so.1.48.0 (0x00007f8351f2a000)
libboost_system.so.1.48.0 => /usr/local/lib/libboost_system.so.1.48.0 (0x00007f8351d26000)
librt.so.1 => /lib/librt.so.1 (0x00007f8351b1d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f83551c0000)
libicudata.so.48 => /usr/local/lib/libicudata.so.48 (0x00007f83507ae000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f83505aa000)
libicui18n.so.48 => /usr/local/lib/libicui18n.so.48 (0x00007f8350191000)

top of gdb stack:
run ./tests/map.xml ./map.mml
Starting program: /home/v.kulpin/src/carto-generator/example ./tests/map.xml ./map.mml
[Thread debugging using libthread_db enabled]
: ### WARNING: Using 'name' in TextSymbolizer is deprecated (http://trac.mapnik.org/wiki/TextSymbolizer)

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff73fd05f in std::basic_string, std::allocator >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6
(gdb) where
#0 0x00007ffff73fd05f in std::basic_string, std::allocator >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6
#1 0x00000000004b48d8 in bool boost::spirit::karma::rulestd::back_insert_iterator<std::string, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type>::generate, boost::fusion::vector0 >, boost::spirit::unused_type, boost::optionalstd::string >(boost::spirit::karma::detail::output_iteratorstd::back_insert_iterator<std::string, mpl_::int_<15>, boost::spirit::unused_type>&, boost::spirit::context, boost::fusion::vector0 >&, boost::spirit::unused_type const&, boost::optionalstd::string const&) const (this=0x7fffffffd940, sink=..., delim=..., attr=...)
at /usr/local/include/boost/spirit/home/karma/nonterminal/rule.hpp:285
#2 0x00000000004b378b in bool boost::spirit::karma::referenceboost::spirit::karma::rule<std::back_insert_iterator<std::string, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>::generateboost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string, mpl_::int_<15>, boost::spirit::unused_type>, boost::spirit::context, boost::fusion::vector0 >, boost::spirit::unused_type, boost::optionalstd::string >(boost::spirit::karma::detail::output_iteratorstd::back_insert_iterator<std::string, mpl_::int_<15>, boost::spirit::unused_type>&, boost::spirit::context, boost::fusion::vector0 >&, boost::spirit::unused_type const&, boost::optionalstd::string const&) const (this=0x8c6a48, sink=..., context=..., delim=..., attr=...) at /usr/local/include/boost/spirit/home/karma/reference.hpp:46

@rundel
Owner

I haven't upgraded to 1.48 yet on my systems, I'll try it this week on OSX and Ubuntu 11.10 and see if I can replicate this.

@rcoup

@wDevil did you compile with clang or gcc?

@wDevil

@rcoup gcc

$ gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3

@springmeyer

I can replicate crashes as well, using either g++ or clang++ with boost 1.48. But, it may be because I'm trying to get things working with mapnik master. If I get farther I will push my changes for @rundel to review.

@rundel
Owner

@springmeyer @wDevil @rcoup try the newest version and let me know if there are still segfaults.

@wDevil

@rundel

$ ./xml2carto ./tests/map.xml ./map.mml
WARNING: Using 'name' in TextSymbolizer/ShieldSymbolizer is deprecated!
Segmentation fault
v.kulpin@dev:~/src/carto-generator$ git pull
Already up-to-date.

$ git show
commit bc731d0
Author: Colin Rundel rundel@gmail.com
Date: Tue Jan 31 18:00:10 2012 -0500

Short term fix for text_symbolizer names

And last version of mapnik:
v.kulpin@dev:~/src/mapnik_last/mapnik$ git show
commit e4f7f1074a6cc9b668b0c62b43555fc6f18f73d8
Author: Artem Pavlenko artem@mapnik.org
Date: Tue Jan 31 20:46:36 2012 +0000

+ validate input tuple length
+ fix index in extract<double>

$ ldd ./xml2carto
linux-vdso.so.1 => (0x00007fffdbfff000)
libmapnik.so.2.0 => /usr/local/lib/libmapnik.so.2.0 (0x00007fc132bf3000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007fc13296d000)
libltdl.so.7 => /usr/lib/libltdl.so.7 (0x00007fc132762000)
libpng12.so.0 => /lib/libpng12.so.0 (0x00007fc13253b000)
libtiff.so.4 => /usr/lib/libtiff.so.4 (0x00007fc1322d9000)
libz.so.1 => /lib/libz.so.1 (0x00007fc1320c1000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007fc131e9d000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007fc131c5b000)
libicuuc.so.48 => /usr/local/lib/libicuuc.so.48 (0x00007fc1318ca000)
libboost_filesystem.so.1.48.0 => /usr/local/lib/libboost_filesystem.so.1.48.0 (0x00007fc1316ab000)
libboost_system.so.1.48.0 => /usr/local/lib/libboost_system.so.1.48.0 (0x00007fc1314a7000)
libboost_regex.so.1.48.0 => /usr/local/lib/libboost_regex.so.1.48.0 (0x00007fc131193000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007fc130e43000)
libboost_thread.so.1.48.0 => /usr/local/lib/libboost_thread.so.1.48.0 (0x00007fc130c28000)
libboost_program_options.so.1.48.0 => /usr/local/lib/libboost_program_options.so.1.48.0 (0x00007fc1309cc000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fc1306b8000)
libm.so.6 => /lib/libm.so.6 (0x00007fc130435000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fc13021d000)
libc.so.6 => /lib/libc.so.6 (0x00007fc12fe9a000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007fc12fc7d000)
libdl.so.2 => /lib/libdl.so.2 (0x00007fc12fa78000)
libicudata.so.48 => /usr/local/lib/libicudata.so.48 (0x00007fc12e709000)
librt.so.1 => /lib/librt.so.1 (0x00007fc12e500000)
libicui18n.so.48 => /usr/local/lib/libicui18n.so.48 (0x00007fc12e0e8000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc13311e000)

$ ldd /usr/local/lib/libmapnik.so.2.0
linux-vdso.so.1 => (0x00007fffe59ff000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f4669991000)
libltdl.so.7 => /usr/lib/libltdl.so.7 (0x00007f4669787000)
libpng12.so.0 => /lib/libpng12.so.0 (0x00007f466955f000)
libtiff.so.4 => /usr/lib/libtiff.so.4 (0x00007f46692fd000)
libz.so.1 => /lib/libz.so.1 (0x00007f46690e6000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007f4668ec1000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007f4668c7f000)
libicuuc.so.48 => /usr/local/lib/libicuuc.so.48 (0x00007f46688ef000)
libboost_filesystem.so.1.48.0 => /usr/local/lib/libboost_filesystem.so.1.48.0 (0x00007f46686cf000)
libboost_system.so.1.48.0 => /usr/local/lib/libboost_system.so.1.48.0 (0x00007f46684cb000)
libboost_regex.so.1.48.0 => /usr/local/lib/libboost_regex.so.1.48.0 (0x00007f46681b8000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007f4667e67000)
libboost_thread.so.1.48.0 => /usr/local/lib/libboost_thread.so.1.48.0 (0x00007f4667c4c000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f4667938000)
libm.so.6 => /lib/libm.so.6 (0x00007f46676b4000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f466749d000)
libc.so.6 => /lib/libc.so.6 (0x00007f466711a000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f4666f15000)
libicudata.so.48 => /usr/local/lib/libicudata.so.48 (0x00007f4665ba6000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f4665989000)
librt.so.1 => /lib/librt.so.1 (0x00007f4665780000)
libicui18n.so.48 => /usr/local/lib/libicui18n.so.48 (0x00007f4665368000)
/lib64/ld-linux-x86-64.so.2 (0x00007f466a142000)

$ gdb ./xml2carto
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 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://www.gnu.org/software/gdb/bugs/...
Reading symbols from /home/v.kulpin/src/carto-generator/xml2carto...(no debugging symbols found)...done.
(gdb) run ./tests/map.xml ./map.mml
Starting program: /home/v.kulpin/src/carto-generator/xml2carto ./tests/map.xml ./map.mml
[Thread debugging using libthread_db enabled]
WARNING: Using 'name' in TextSymbolizer/ShieldSymbolizer is deprecated!

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff542f05f in std::basic_string, std::allocator >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6
(gdb) where
#0 0x00007ffff542f05f in std::basic_string, std::allocator >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6

$ ./xml2carto --xml ./tests/map.xml ./map.mml
terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::exception_detail::error_info_injector<boost::program_options::multiple_occurrences >'
what(): multiple occurrences
Аварийный останов
v.kulpin@dev:~/src/carto/carto-generator$ ./xml2carto --xml ./tests/map.xml --mml ./map.mml
WARNING: Using 'name' in TextSymbolizer/ShieldSymbolizer is deprecated!
Segmentation fault

Maybe i forget something?

  • update mapnik source from master
  • rebuild mapnik
  • update carto source from master
  • rebuild carto what else?
@rundel
Owner

@wDevil looks like you are doing everything correctly, there are still recent changes to the text symbolizer that I will need to accomodate that seem like the likely cause.

@herm Any documentation on your placement changes?

@herm

I'm pretty sure this isn't related to the TextSymbolizer changes. One of the earlier crashlogs shows this message
"### WARNING: Using 'name' in TextSymbolizer is deprecated (http://trac.mapnik.org/wiki/TextSymbolizer)"
This is the message in Mapnik 2, but this message was just there to inform the users about the upcoming change. There was no change in internal logic involved.
After the new code was merged it shows "WARNING: Using 'name' in TextSymbolizer/ShieldSymbolizer is deprecated!" seen in the last reports.

There are no good docs about the user side yet, some (unfinished) docs about the internal workings are available here:
https://github.com/mapnik/mapnik/wiki/Text-Rendering-Overview
You can also look at https://github.com/mapnik/mapnik/tree/master/tests/visual_tests to get some working examples.
Some old documentation is here: http://mapnik.org/news/2011/09/02/text_formating
The last paragraph about the C++ interface is outdated.
http://mapnik.org/news/2011/07/13/new_text_placement_system/

@rundel
Owner

@herm Thank you, all of the information is immensely helpful. I'll look more into other potential causes, get_name was the only deprecated function I had looked at since it now just returns an empty expression_ptr.

@springmeyer Do any of these improvements have an accepted carto syntax yet?

@springmeyer

@rundel - not sure, would need a closer look. I'm out of the office until next week - awesome job getting things updated. Though things still appear to crash for me:

(gdb) bt
#0  0x00007fff86e98b2b in pow$fenv_access_off ()
#1  0x0000000100005afa in boost::spirit::karma::int_inserter<10u, boost::spirit::unused_type, boost::spirit::unused_type>::call<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, double> ()
#2  0x0000000100005d9c in boost::spirit::karma::int_inserter<10u, boost::spirit::unused_type, boost::spirit::unused_type>::call<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, double> ()
#3  0x0000000100005d9c in boost::spirit::karma::int_inserter<10u, boost::spirit::unused_type, boost::spirit::unused_type>::call<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, double> ()
#4  0x0000000100005d9c in boost::spirit::karma::int_inserter<10u, boost::spirit::unused_type, boost::spirit::unused_type>::call<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, double> ()
#5  0x0000000100005d9c in boost::spirit::karma::int_inserter<10u, boost::spirit::unused_type, boost::spirit::unused_type>::call<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, double> ()
#6  0x0000000100005d9c in boost::spirit::karma::int_inserter<10u, boost::spirit::unused_type, boost::spirit::unused_type>::call<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, double> ()
#7  0x0000000100005d9c in boost::spirit::karma::int_inserter<10u, boost::spirit::unused_type, boost::spirit::unused_type>::call<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, double> ()
#8  0x0000000100005d9c in boost::spirit::karma::int_inserter<10u, boost::spirit::unused_type, boost::spirit::unused_type>::call<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, double> ()
#9  0x0000000100005d9c in boost::spirit::karma::int_inserter<10u, boost::spirit::unused_type, boost::spirit::unused_type>::call<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, double> ()
#10 0x0000000100005d9c in boost::spirit::karma::int_inserter<10u, boost::spirit::unused_type, boost::spirit::unused_type>::call<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spi

....pages and pages...

Also I think you need this mod to the makefile:

diff --git a/Makefile b/Makefile
index deed072..5e5ae51 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ CXX = clang++

 CXXFLAGS = -I./include $(shell mapnik-config --cflags) -DMAPNIKDIR=\"$(shell ma 
-LIBS = $(shell mapnik-config --libs --dep-libs) -lboost_program_options
+LIBS = $(shell mapnik-config --libs --ldflags --dep-libs) -lboost_program_optio 
 SRC = $(wildcard *.cpp)
@rundel
Owner

@wDevil just pushed a couple of small fixes. I still can't replicate the segfault you and Dane are seeing, so I'm not sure if these will fix it.

@springmeyer if you are still seeing the segfault can you post the tail of the backtrace?

@wDevil

@rundel

$ git pull
Updating bc731d0..3640318
Fast-forward
Makefile | 2 +-
include/symbolizers/gen_shield_sym.hpp | 6 +++---
include/symbolizers/gen_stroke.hpp | 5 ++++-
include/symbolizers/gen_text_sym_def.hpp | 3 +--
4 files changed, 9 insertions(+), 7 deletions(-)
v.kulpin@dev:~/src/carto/carto-generator$ make clean
rm -f gen_building_sym.o gen_font_set.o gen_layer.o gen_line_pattern_sym.o gen_line_sym.o gen_map.o gen_style.o gen_symbolizers.o gen_text_sym.o gen_utility.o xml2carto.o
rm -f xml2carto

$ make clean
rm -f gen_building_sym.o gen_font_set.o gen_layer.o gen_line_pattern_sym.o gen_line_sym.o gen_map.o gen_style.o gen_symbolizers.o gen_text_sym.o gen_utility.o xml2carto.o
rm -f xml2carto

$ ./xml2carto ./tests/map.xml ./map.mml

WARNING: Using 'name' in TextSymbolizer/ShieldSymbolizer is deprecated!

Segmentation fault

gdb output: git://gist.github.com/1726195.git

@rundel
Owner

@wDevil I've pushed three subset xml test files can you try the following:

./xml2carto ./tests/map_line.xml map.mml
./xml2carto ./tests/map_poly.xml map.mml
./xml2carto ./tests/map_text.xml map.mml

and let me know which are segfaulting?

@wDevil

@rundel
$ ./xml2carto ./tests/map_line.xml map.mml
Ошибка сегментирования
v.kulpin@dev:~/src/carto/carto-generator$ ./xml2carto ./tests/map_poly.xml map.mml
Ошибка сегментирования
v.kulpin@dev:~/src/carto/carto-generator$ ./xml2carto ./tests/map_text.xml map.mml

WARNING: Using 'name' in TextSymbolizer/ShieldSymbolizer is deprecated!

Ошибка сегментирования
v.kulpin@dev:~/src/carto/carto-generator$ ./xml2carto ./tests/map.xml map.mml

WARNING: Using 'name' in TextSymbolizer/ShieldSymbolizer is deprecated!

Ошибка сегментирования

All of them :(
gdb output?

@rundel
Owner

@wDevil Hm, I am stumped. Are mapnik and xml2carto compiled with debug symbols? If not can you recompile and then repost a gist of the gdb backtrace for map.xml?

@wDevil

@rundel compiling....

@wDevil

@rundel done - git://gist.github.com/1726624.git

@rundel
Owner

@wDevil is that the full backtrace? It seems like some of the stack is missing.

@wDevil

@rundel full backtrace git://gist.github.com/1728845.git

@wDevil

@rundel backtrace is ok? it's helped you?

@rundel
Owner

@wDevil backtrace is complete but it is almost impossible to sort through the Boost mess to find the exact cause. I'm hoping @springmeyer would be able to test the newest revision to see if he is also seeing the segfault.

@wDevil

@rundel on which revision of mapnik20 carto-generator was tested? i'll try to find mac for compiling and convert styles.

@rundel
Owner

@wDevil I'm currently working with a week old revision from the master branch (1e2897b28d003bb013f2bde2f4453f872b913b5a) to be exact. Are you working with the master or 2.0.x branch?

@springmeyer

Yep, also seeing segfaults still.


~/projects/carto-generator[master]$ ./xml2carto ./tests/map_line.xml map.mml
Segmentation fault: 11
~/projects/carto-generator[master]$ ./xml2carto ./tests/map_poly.xml map.mml
Bus error: 10
~/projects/carto-generator[master]$ ./xml2carto ./tests/map_text.xml map.mml
### WARNING: Using 'name' in TextSymbolizer/ShieldSymbolizer is deprecated!
Bus error: 10
@wDevil

@rundel with master branch(e4f7f10)

commit e4f7f1074a6cc9b668b0c62b43555fc6f18f73d8
Author: Artem Pavlenko artem@mapnik.org
Date: Tue Jan 31 20:46:36 2012 +0000

7 days ago revision

@rundel
Owner

Hm, my working build is on Ubuntu 11.10, I'll try building on my Laptop to see what happens under OSX 10.7

@wDevil

@rundel what versions of:
libboost -?
libicui -?
this libs builded from source?

can you comment output of commands:
$ ldd /usr/local/lib/libmapnik2.so
$ ldd ./xml2carto

@rundel
Owner

@wDevil libboost is 1.48 compiled from source with gcc 4.6.1, libicu is 4.4 installed by apt.

Library ldd info is at https://gist.github.com/1762299

@springmeyer

osx 10.7 and clang++ here, tried both boost 1.48 and trunk.

Here is an example crash:

gdb ./xml2carto
(gdb) r tests/map_poly.xml t.mml
(gdb) bt
#0  0x00007fff876b6239 in std::string::_Rep::_M_grab ()
#1  0x00007fff876b634d in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string ()
#2  0x000000010002b7b8 in boost::spirit::karma::rule<std::back_insert_iterator<std::string>, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type>::generate<boost::spirit::context<boost::fusion::cons<cssgen::map_data const&, boost::fusion::nil>, boost::fusion::vector0<void> >, boost::spirit::unused_type, boost::optional<std::string> > ()
#3  0x000000010002b06f in boost::spirit::detail::any_if<boost::spirit::traits::attribute_not_unused<boost::spirit::context<boost::fusion::cons<cssgen::map_data const&, boost::fusion::nil>, boost::fusion::vector0<void> >, boost::spirit::unused_type>, boost::fusion::cons_iterator<boost::fusion::cons<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, true>, boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, mapnik::color ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, true>, boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::optional<boost::spirit::karma::any_int_generator<int, boost::spirit::unused_type, boost::spirit::unused_type, 10u, false> >, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [17], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<std::string const, boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [4], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [12], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::list<boost::spirit::karma::sequence<boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, cssgen::layer_mml ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::nil> > > >, boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true> >, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::nil> > > > > > > > > > > > > > > const>, boost::fusion::cons_iterator<boost::fusion::nil const>, boost::fusion::basic_iterator<boost::fusion::struct_iterator_tag, boost::fusion::random_access_traversal_tag, cssgen::map_data const, 1>, boost::fusion::basic_iterator<boost::fusion::struct_iterator_tag, boost::fusion::random_access_traversal_tag, cssgen::map_data const, 6>, boost::spirit::karma::detail::fail_function<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, boost::spirit::context<boost::fusion::cons<cssgen::map_data const&, boost::fusion::nil>, boost::fusion::vector0<void> >, boost::spirit::unused_type> > ()
#4  0x000000010002afd2 in boost::spirit::detail::any_if<boost::spirit::traits::attribute_not_unused<boost::spirit::context<boost::fusion::cons<cssgen::map_data const&, boost::fusion::nil>, boost::fusion::vector0<void> >, boost::spirit::unused_type>, boost::fusion::cons_iterator<boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::optional<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, std::map<std::string, mapnik::font_set, std::less<std::string>, std::allocator<std::pair<std::string const, mapnik::font_set> > > ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const> >, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [8], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, true>, boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, mapnik::color ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, true>, boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::optional<boost::spirit::karma::any_int_generator<int, boost::spirit::unused_type, boost::spirit::unused_type, 10u, false> >, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [17], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<std::string const, boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [4], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [12], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::list<boost::spirit::karma::sequence<boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, cssgen::layer_mml ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::nil> > > >, boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true> >, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::nil> > > > > > > > > > > > > > > > > > const>, boost::fusion::cons_iterator<boost::fusion::nil const>, boost::fusion::basic_iterator<boost::fusion::struct_iterator_tag, boost::fusion::random_access_traversal_tag, cssgen::map_data const, 0>, boost::fusion::basic_iterator<boost::fusion::struct_iterator_tag, boost::fusion::random_access_traversal_tag, cssgen::map_data const, 6>, boost::spirit::karma::detail::fail_function<boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>, boost::spirit::context<boost::fusion::cons<cssgen::map_data const&, boost::fusion::nil>, boost::fusion::vector0<void> >, boost::spirit::unused_type> > ()
#5  0x000000010002ac8f in boost::detail::function::function_obj_invoker3<boost::spirit::karma::detail::generator_binder<boost::spirit::karma::sequence<boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::optional<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, std::map<std::string, mapnik::font_set, std::less<std::string>, std::allocator<std::pair<std::string const, mapnik::font_set> > > ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const> >, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [8], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, std::string ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, true>, boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, mapnik::color ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, true>, boost::fusion::cons<boost::spirit::karma::omit_directive<boost::spirit::karma::optional<boost::spirit::karma::any_int_generator<int, boost::spirit::unused_type, boost::spirit::unused_type, 10u, false> >, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [17], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<std::string const, boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [4], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [12], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::list<boost::spirit::karma::sequence<boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::reference<boost::spirit::karma::rule<std::back_insert_iterator<std::string>, cssgen::layer_mml ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const>, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::nil> > > >, boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true> >, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_string<char const (&) [3], boost::spirit::unused_type, boost::spirit::unused_type, true>, boost::fusion::cons<boost::spirit::karma::literal_char<boost::spirit::char_encoding::standard, boost::spirit::unused_type, true>, boost::fusion::nil> > > > > > > > > > > > > > > > > > >, mpl_::bool_<false> >, bool, boost::spirit::karma::detail::output_iterator<std::back_insert_iterator<std::string>, mpl_::int_<15>, boost::spirit::unused_type>&, boost::spirit::context<boost::fusion::cons<cssgen::map_data const&, boost::fusion::nil>, boost::fusion::vector0<void> >&, boost::spirit::unused_type const&>::invoke ()
#6  0x00000001000735a5 in boost::spirit::karma::rule<std::back_insert_iterator<std::string>, cssgen::map_data ()(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type>::generate<boost::spirit::context<boost::fusion::cons<cssgen::map_data const&, boost::fusion::nil>, boost::spirit::locals<mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na> >, boost::spirit::unused_type, cssgen::map_data> ()
#7  0x00000001000726f2 in main ()
@rundel
Owner

Finally got everything compiled on OSX 10.7 with clang++ 3.0 and boost 1.48 and I still dont see the segfault.

otool -L xml2carto
xml2carto:
    /usr/local/Cellar/mapnik2_debug/HEAD/lib/libmapnik.dylib (compatibility version 2.0.0, current version 2.0.0)
    /usr/local/Cellar/freetype/2.4.4/lib/libfreetype.6.dylib (compatibility version 13.0.0, current version 13.2.0)
    /usr/lib/libltdl.7.dylib (compatibility version 10.0.0, current version 10.2.0)
    /usr/local/Cellar/libpng/1.2.44/lib/libpng12.0.dylib (compatibility version 45.0.0, current version 45.0.0)
    /usr/local/Cellar/libtiff/3.9.5/lib/libtiff.3.dylib (compatibility version 13.0.0, current version 13.5.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /usr/local/lib/libjpeg.8.dylib (compatibility version 13.0.0, current version 13.0.0)
    /usr/local/Cellar/proj/4.7.0/lib/libproj.0.dylib (compatibility version 7.0.0, current version 7.6.0)
    /usr/local/Cellar/icu4c/4.8.1.1/lib/libicuuc.48.1.1.dylib (compatibility version 48.0.0, current version 48.1.1)
    /usr/local/lib/libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libboost_regex-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.3.0)
    /usr/local/lib/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
@springmeyer

I'm still seeing the segfault. I've narrowed it down to an XML with only a <LineSymbolizer stroke-dasharray="8,4,2,2,2,2"/>. So, it appears that the crash is happening because a boost::optionalmapnik::dash_array is not getting created properly. In release mode it crashes. If I remove the '-DDNDEBUG' from the mapnik-config --cflags by editing mapnik-config I get an assertion in boost like:

Assertion failed: (this->is_initialized()), function get, file /opt/boost-49/include/boost/optional/optional.hpp, line 630.
Abort trap: 6

And the backtrace looks like: https://gist.github.com/2117624

@springmeyer

Hmm, correction, it looks like all I had to do to generate a crash in release (-DNDEBUG) was add a stroke-dasharray, but in debug mode just adding a <LineSymbolizer /> prompts a boost optional assertion. Here is the entire style:

<?xml version="1.0" encoding="utf-8"?>
<Map srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" background-color="rgb(255,255,255)">
    <Style name="provlines">
        <Rule>
            <LineSymbolizer />
        </Rule>
    </Style>

    <Layer name="Provincial borders" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
        <StyleName>provlines</StyleName>
        <Datasource>
            <Parameter name="file">data/boundaries_l</Parameter>
            <Parameter name="type">shape</Parameter>
        </Datasource>
    </Layer>
</Map>
@springmeyer

When I remove the <LineSymbolizer I get no abort or crash but just: Generation of stylesheet failed

@rundel
Owner

@springmeyer I think I've fixed your particular bug. Issue was one of the map_data attributes not being properly marked as optional in the karma grammar. Let me know if it is working for you now.

@springmeyer

@rundel - awesome. I don't however see a commit - do you still need to push?

@rundel
Owner

Forgot to push, should be there now. @springmeyer

@springmeyer

sweet, that fixed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.