carto-generator icon indicating copy to clipboard operation
carto-generator copied to clipboard

Segfault under Ubuntu 10.04

Open wDevil opened this issue 13 years ago • 42 comments

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<char, std::char_traits, std::allocator >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6 #0 0x00007ffff73fc05f in std::basic_string<char, std::char_traits, 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::spirit::context<boost::fusion::cons<cssgen::map_data const&, boost::fusion::nil>, 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::cons<cssgen::map_data const&, boost::fusion::nil>, 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::cons<cssgen::map_data const&, boost::fusion::nil>, 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::cons<cssgen::map_data const&, boost::fusion::nil>, 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::cons<cssgen::map_data const&, boost::fusion::nil>, 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::cons<cssgen::map_data const&, boost::fusion::nil>, 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

wDevil avatar Jan 28 '12 22:01 wDevil

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?

springmeyer avatar Jan 28 '12 22:01 springmeyer

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)

wDevil avatar Jan 28 '12 22:01 wDevil

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?

springmeyer avatar Jan 28 '12 22:01 springmeyer

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 avatar Jan 28 '12 23:01 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<char, std::char_traits, std::allocator >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6 (gdb) where #0 0x00007ffff73fd05f in std::basic_string<char, std::char_traits, 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::spirit::context<boost::fusion::cons<cssgen::map_data const&, boost::fusion::nil>, 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::cons<cssgen::map_data const&, boost::fusion::nil>, 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::cons<cssgen::map_data const&, boost::fusion::nil>, 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::cons<cssgen::map_data const&, boost::fusion::nil>, 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

wDevil avatar Jan 29 '12 13:01 wDevil

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.

rundel avatar Jan 30 '12 15:01 rundel

@wDevil did you compile with clang or gcc?

rcoup avatar Jan 30 '12 18:01 rcoup

@rcoup gcc

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

wDevil avatar Jan 30 '12 19:01 wDevil

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.

springmeyer avatar Jan 30 '12 19:01 springmeyer

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

rundel avatar Jan 31 '12 23:01 rundel

@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 bc731d0dae3c0cabc52ca49d8e9e8f122929b3af Author: Colin Rundel [email protected] 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 [email protected] 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<char, std::char_traits, std::allocator >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6 (gdb) where #0 0x00007ffff542f05f in std::basic_string<char, std::char_traits, 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?

wDevil avatar Feb 01 '12 12:02 wDevil

@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?

rundel avatar Feb 01 '12 23:02 rundel

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/

herm avatar Feb 01 '12 23:02 herm

@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?

rundel avatar Feb 02 '12 19:02 rundel

@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)

springmeyer avatar Feb 02 '12 20:02 springmeyer

@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?

rundel avatar Feb 02 '12 22:02 rundel

@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

wDevil avatar Feb 02 '12 22:02 wDevil

@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?

rundel avatar Feb 02 '12 22:02 rundel

@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?

wDevil avatar Feb 02 '12 22:02 wDevil

@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?

rundel avatar Feb 02 '12 23:02 rundel

@rundel compiling....

wDevil avatar Feb 02 '12 23:02 wDevil

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

wDevil avatar Feb 03 '12 00:02 wDevil

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

rundel avatar Feb 03 '12 00:02 rundel

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

wDevil avatar Feb 03 '12 07:02 wDevil

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

wDevil avatar Feb 07 '12 19:02 wDevil

@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.

rundel avatar Feb 07 '12 19:02 rundel

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

wDevil avatar Feb 07 '12 20:02 wDevil

@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?

rundel avatar Feb 07 '12 21:02 rundel

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

springmeyer avatar Feb 07 '12 21:02 springmeyer

@rundel with master branch(e4f7f10)

commit e4f7f1074a6cc9b668b0c62b43555fc6f18f73d8 Author: Artem Pavlenko [email protected] Date: Tue Jan 31 20:46:36 2012 +0000

7 days ago revision

wDevil avatar Feb 07 '12 21:02 wDevil