mapnik/mapnik — Issue #958: high cpu hang in ogr driver registration
Author: springmeyer
Created: 2011-11-17 05:08:42+00:00
State: open

Running tilemill, just sample projects and one project with a remote csv. During presentation lost internet connection, then reconnected and that csv based project would no longer load, even though others would. CPU and fan started going nutz.

Laptop closes, now hours later doing forensics. CPU is at 150%. Activity monitor trace shows some kind of infinite looping in OGR driver registration which makes no sense because the hung project does not use ogr datasources, just shapefile and csv. All other projects work fine, including the geography lesson project (the only one that uses geojson).

Below follows with the `gdb --pid` output from attaching and a screen shot from activity monitor showing where the hang is:

```
(gdb) bt
#0 0x00007fff92f1b7e6 in kevent ()
warning: .o file "/Users/dane/src/node-v0.4.12/build/default/deps/libev/ev_1.o" more recent than executable timestamp in "/usr/local/bin/node"
warning: Couldn't open object file '/Users/dane/src/node-v0.4.12/build/default/deps/libev/ev_1.o'
#1 0x0000000102a2a932 in kqueue_poll ()
#2 0x0000000102a2b45b in ev_run ()
warning: .o file "/Users/dane/src/node-v0.4.12/build/default/src/node_4.o" more recent than executable timestamp in "/usr/local/bin/node"
warning: Couldn't open object file '/Users/dane/src/node-v0.4.12/build/default/src/node_4.o'
#3 0x00000001029fbea0 in node::Start ()
#4 0x00000001029f8334 in start ()
(gdb) thread apply all bt

Thread 10 (process 1595):
#0 0x00007fff92f1abca in __psynch_cvwait ()
#1 0x00007fff8d216274 in _pthread_cond_wait ()
warning: .o file "/Users/dane/src/node-v0.4.12/build/default/deps/libeio/eio_1.o" more recent than executable timestamp in "/usr/local/bin/node"
warning: Couldn't open object file '/Users/dane/src/node-v0.4.12/build/default/deps/libeio/eio_1.o'
#2 0x0000000102a22324 in etp_proc ()
#3 0x00007fff8d2128bf in _pthread_start ()
#4 0x00007fff8d215b75 in thread_start ()

Thread 9 (process 1595):
#0 0x00007fff92f1abca in __psynch_cvwait ()
#1 0x00007fff8d216274 in _pthread_cond_wait ()
#2 0x0000000102a22324 in etp_proc ()
#3 0x00007fff8d2128bf in _pthread_start ()
#4 0x00007fff8d215b75 in thread_start ()

Thread 8 (process 1595):
#0 0x00007fff92f1abca in __psynch_cvwait ()
#1 0x00007fff8d216274 in _pthread_cond_wait ()
#2 0x0000000102a22324 in etp_proc ()
#3 0x00007fff8d2128bf in _pthread_start ()
#4 0x00007fff8d215b75 in thread_start ()

Thread 7 (process 1595):
#0 0x00007fff8cc108b4 in std::string::compare ()
#1 0x000000012a480318 in std::_Select1st >::operator() () at /usr/include/c++/4.2.1/bits/stl_function.h:2228
#2 0x000000012a480318 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_insert_unique (this=0xa, __v=@0x12d87a8c8) at basic_string.h:1019
#3 0x000000012a4804c4 in std::pair::pair () at /usr/include/c++/4.2.1/bits/stl_pair.h:426
#4 0x000000012a4804c4 in std::map, std::allocator > >::operator[] (this=0xa, __k=@0x12d87a940) at stl_map.h:350
#5 0x000000012a47fb5c in VSIFileManager::InstallHandler (osPrefix=@0x12d87a940, poHandler=0x7fcc03879d10) at cpl_vsil.cpp:745
#6 0x000000012a4845ab in VSIInstallCurlFileHandler () at cpl_vsil_curl.cpp:2128
#7 0x000000012a47fb01 in VSIFileManager::Get () at cpl_vsil.cpp:687
#8 0x000000012a47fb83 in VSIFileManager::GetHandler (pszPath=0x7fcc03879ae8 "/usr/local/lib/gdalplugins/1.9") at cpl_vsil.cpp:705
#9 0x000000012a47fda4 in VSIStatExL [inlined] () at /Users/dane/src/gdal/gdal/port/cpl_vsil.cpp:280
#10 0x000000012a47fda4 in VSIStatL (pszFilename=0x7fcc03879ae8 "/usr/local/lib/gdalplugins/1.9", psStatBuf=0x12d87aa18) at cpl_vsil.cpp:230
#11 0x000000012a5e8023 in OGRSFDriverRegistrar::AutoLoadDrivers (this=0xa) at ogrsfdriverregistrar.cpp:857
#12 0x000000012a5e05f1 in OGRRegisterAll () at ogrregisterall.cpp:40
#13 0x000000012ae9f20f in ogr_datasource::bind (this=0x7fcc038796b0) at plugins/input/ogr/ogr_datasource.cpp:110
#14 0x000000012ae9ef3d in boost::optional_detail::optional_base::destroy () at plugins/input/ogr/ogr_datasource.cpp:90
#15 boost::optional::~optional () at /opt/boost-47/include/boost/optional/optional.hpp:268
#16 0x000000012ae9ef3d in ogr_datasource::ogr_datasource (this=0x7fcc038796b0, params=, bind=) at plugins/input/ogr/ogr_datasource.cpp:567
#17 0x000000012ae9e60c in create (params=, bind=) at ogr_datasource.hpp:42
#18 0x0000000128842bcd in boost::shared_ptr::shared_ptr () at src/datasource_cache.cpp:107
#19 boost::shared_ptr::shared_ptr () at /opt/boost-47/include/boost/smart_ptr/shared_ptr.hpp:107
#20 0x0000000128842bcd in mapnik::datasource_cache::create (params=, bind=) at src/datasource_cache.cpp:197
#21 0x00000001288085df in mapnik::map_parser::parse_layer (this=0x12d87ccf0, map=@0x7fcc0392ee10, lay=) at src/load_map.cpp:675
#22 0x0000000128805251 in mapnik::map_parser::parse_map_include (this=0x12d87ccf0, map=@0x7fcc0392ee10, include=) at src/load_map.cpp:349
#23 0x0000000128804492 in mapnik::map_parser::parse_map (this=, map=, pt=, base_path=) at src/load_map.cpp:322
#24 0x00000001288049d3 in mapnik::load_map_string (map=, str=, strict=, base_path=) at src/load_map.cpp:173
#25 0x00000001279d226a in Map::EIO_FromString (req=) at mapnik_map.cpp:814
#26 0x0000000102a2310d in etp_proc ()
#27 0x00007fff8d2128bf in _pthread_start ()
#28 0x00007fff8d215b75 in thread_start ()

Thread 6 (process 1595):
#0 VSIStatExL [inlined] () at /Users/dane/src/gdal/gdal/port/cpl_vsil.cpp:285
#1 0x000000012a47fda4 in VSIStatL (pszFilename=0x10314e698 "/usr/local/lib/gdalplugins/1.9", psStatBuf=0x12c461a18) at cpl_vsil.cpp:230
#2 0x000000012a5e8023 in OGRSFDriverRegistrar::AutoLoadDrivers (this=0x18) at ogrsfdriverregistrar.cpp:857
#3 0x000000012a5e05f1 in OGRRegisterAll () at ogrregisterall.cpp:40
#4 0x000000012ae9f20f in ogr_datasource::bind (this=0x10314e080) at plugins/input/ogr/ogr_datasource.cpp:110
#5 0x000000012ae9ef3d in boost::optional_detail::optional_base::destroy () at plugins/input/ogr/ogr_datasource.cpp:90
#6 boost::optional::~optional () at /opt/boost-47/include/boost/optional/optional.hpp:268
#7 0x000000012ae9ef3d in ogr_datasource::ogr_datasource (this=0x10314e080, params=, bind=) at plugins/input/ogr/ogr_datasource.cpp:230
#8 0x000000012ae9e60c in create (params=, bind=) at ogr_datasource.hpp:42
#9 0x0000000128842bcd in boost::shared_ptr::shared_ptr () at src/datasource_cache.cpp:107
#10 boost::shared_ptr::shared_ptr () at /opt/boost-47/include/boost/smart_ptr/shared_ptr.hpp:107
#11 0x0000000128842bcd in mapnik::datasource_cache::create (params=, bind=) at src/datasource_cache.cpp:230
#12 0x00000001288085df in mapnik::map_parser::parse_layer (this=0x12c463cf0, map=@0x7fcc03928310, lay=) at src/load_map.cpp:675
#13 0x0000000128805251 in mapnik::map_parser::parse_map_include (this=0x12c463cf0, map=@0x7fcc03928310, include=) at src/load_map.cpp:349
#14 0x0000000128804492 in mapnik::map_parser::parse_map (this=, map=, pt=, base_path=) at src/load_map.cpp:322
#15 0x00000001288049d3 in mapnik::load_map_string (map=, str=, strict=, base_path=) at src/load_map.cpp:173
#16 0x00000001279d226a in Map::EIO_FromString (req=) at mapnik_map.cpp:814
#17 0x0000000102a2310d in etp_proc ()
#18 0x00007fff8d2128bf in _pthread_start ()
#19 0x00007fff8d215b75 in thread_start ()
Current language: auto; currently c++

Thread 5 (process 1595):
#0 0x00007fff8cc108b4 in std::string::compare ()
#1 0x000000012a480318 in std::_Select1st >::operator() () at /usr/include/c++/4.2.1/bits/stl_function.h:2228
#2 0x000000012a480318 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_insert_unique (this=0xa, __v=@0x12c44e8c8) at basic_string.h:1019
#3 0x000000012a4804c4 in std::pair::pair () at /usr/include/c++/4.2.1/bits/stl_pair.h:426
#4 0x000000012a4804c4 in std::map, std::allocator > >::operator[] (this=0xa, __k=@0x12c44e940) at stl_map.h:350
#5 0x000000012a47fb5c in VSIFileManager::InstallHandler (osPrefix=@0x12c44e940, poHandler=0x7fcc02cb2ee0) at cpl_vsil.cpp:745
#6 0x000000012a4845ab in VSIInstallCurlFileHandler () at cpl_vsil_curl.cpp:2128
#7 0x000000012a47fb01 in VSIFileManager::Get () at cpl_vsil.cpp:687
#8 0x000000012a47fb83 in VSIFileManager::GetHandler (pszPath=0x7fcc02c9e148 "/usr/local/lib/gdalplugins/1.9") at cpl_vsil.cpp:705
#9 0x000000012a47fda4 in VSIStatExL [inlined] () at /Users/dane/src/gdal/gdal/port/cpl_vsil.cpp:280
#10 0x000000012a47fda4 in VSIStatL (pszFilename=0x7fcc02c9e148 "/usr/local/lib/gdalplugins/1.9", psStatBuf=0x12c44ea18) at cpl_vsil.cpp:230
#11 0x000000012a5e8023 in OGRSFDriverRegistrar::AutoLoadDrivers (this=0xa) at ogrsfdriverregistrar.cpp:857
#12 0x000000012a5e05f1 in OGRRegisterAll () at ogrregisterall.cpp:40
#13 0x000000012ae9f20f in ogr_datasource::bind (this=0x7fcc02c95090) at plugins/input/ogr/ogr_datasource.cpp:110
#14 0x000000012ae9ef3d in boost::optional_detail::optional_base::destroy () at plugins/input/ogr/ogr_datasource.cpp:90
#15 boost::optional::~optional () at /opt/boost-47/include/boost/optional/optional.hpp:268
#16 0x000000012ae9ef3d in ogr_datasource::ogr_datasource (this=0x7fcc02c95090, params=, bind=) at plugins/input/ogr/ogr_datasource.cpp:567
#17 0x000000012ae9e60c in create (params=, bind=) at ogr_datasource.hpp:42
#18 0x0000000128842bcd in boost::shared_ptr::shared_ptr () at src/datasource_cache.cpp:107
#19 boost::shared_ptr::shared_ptr () at /opt/boost-47/include/boost/smart_ptr/shared_ptr.hpp:107
#20 0x0000000128842bcd in mapnik::datasource_cache::create (params=, bind=) at src/datasource_cache.cpp:197
#21 0x00000001288085df in mapnik::map_parser::parse_layer (this=0x12c450cf0, map=@0x7fcc0392fb80, lay=) at src/load_map.cpp:675
#22 0x0000000128805251 in mapnik::map_parser::parse_map_include (this=0x12c450cf0, map=@0x7fcc0392fb80, include=) at src/load_map.cpp:349
#23 0x0000000128804492 in mapnik::map_parser::parse_map (this=, map=, pt=, base_path=) at src/load_map.cpp:322
#24 0x00000001288049d3 in mapnik::load_map_string (map=, str=, strict=, base_path=) at src/load_map.cpp:173
#25 0x00000001279d226a in Map::EIO_FromString (req=) at mapnik_map.cpp:814
#26 0x0000000102a2310d in etp_proc ()
#27 0x00007fff8d2128bf in _pthread_start ()
#28 0x00007fff8d215b75 in thread_start ()

Thread 4 (process 1595):
#0 0x00007fff8cc108b4 in std::string::compare ()
#1 0x000000012a480318 in std::_Select1st >::operator() () at /usr/include/c++/4.2.1/bits/stl_function.h:2228
#2 0x000000012a480318 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_insert_unique (this=0xa, __v=@0x12c43b8c8) at basic_string.h:1019
#3 0x000000012a4804c4 in std::pair::pair () at /usr/include/c++/4.2.1/bits/stl_pair.h:426
#4 0x000000012a4804c4 in std::map, std::allocator > >::operator[] (this=0xa, __k=@0x12c43b940) at stl_map.h:350
#5 0x000000012a47fb5c in VSIFileManager::InstallHandler (osPrefix=@0x12c43b940, poHandler=0x7fcc039e4bf0) at cpl_vsil.cpp:745
#6 0x000000012a4845ab in VSIInstallCurlFileHandler () at cpl_vsil_curl.cpp:2128
#7 0x000000012a47fb01 in VSIFileManager::Get () at cpl_vsil.cpp:687
#8 0x000000012a47fb83 in VSIFileManager::GetHandler (pszPath=0x7fcc039e4968 "/usr/local/lib/gdalplugins/1.9") at cpl_vsil.cpp:705
#9 0x000000012a47fda4 in VSIStatExL [inlined] () at /Users/dane/src/gdal/gdal/port/cpl_vsil.cpp:280
#10 0x000000012a47fda4 in VSIStatL (pszFilename=0x7fcc039e4968 "/usr/local/lib/gdalplugins/1.9", psStatBuf=0x12c43ba18) at cpl_vsil.cpp:230
#11 0x000000012a5e8023 in OGRSFDriverRegistrar::AutoLoadDrivers (this=0xa) at ogrsfdriverregistrar.cpp:857
#12 0x000000012a5e05f1 in OGRRegisterAll () at ogrregisterall.cpp:40
#13 0x000000012ae9f20f in ogr_datasource::bind (this=0x7fcc039e4530) at plugins/input/ogr/ogr_datasource.cpp:110
#14 0x000000012ae9ef3d in boost::optional_detail::optional_base::destroy () at plugins/input/ogr/ogr_datasource.cpp:90
#15 boost::optional::~optional () at /opt/boost-47/include/boost/optional/optional.hpp:268
#16 0x000000012ae9ef3d in ogr_datasource::ogr_datasource (this=0x7fcc039e4530, params=, bind=) at plugins/input/ogr/ogr_datasource.cpp:567
#17 0x000000012ae9e60c in create (params=, bind=) at ogr_datasource.hpp:42
#18 0x0000000128842bcd in boost::shared_ptr::shared_ptr () at src/datasource_cache.cpp:107
#19 boost::shared_ptr::shared_ptr () at /opt/boost-47/include/boost/smart_ptr/shared_ptr.hpp:107
#20 0x0000000128842bcd in mapnik::datasource_cache::create (params=, bind=) at src/datasource_cache.cpp:197
#21 0x00000001288085df in mapnik::map_parser::parse_layer (this=0x12c43dcf0, map=@0x7fcc0392f9a0, lay=) at src/load_map.cpp:675
#22 0x0000000128805251 in mapnik::map_parser::parse_map_include (this=0x12c43dcf0, map=@0x7fcc0392f9a0, include=) at src/load_map.cpp:349
#23 0x0000000128804492 in mapnik::map_parser::parse_map (this=, map=, pt=, base_path=) at src/load_map.cpp:322
#24 0x00000001288049d3 in mapnik::load_map_string (map=, str=, strict=, base_path=) at src/load_map.cpp:173
#25 0x00000001279d226a in Map::EIO_FromString (req=) at mapnik_map.cpp:814
#26 0x0000000102a2310d in etp_proc ()
#27 0x00007fff8d2128bf in _pthread_start ()
#28 0x00007fff8d215b75 in thread_start ()

Thread 3 (process 1595):
#0 0x00007fff92f1abca in __psynch_cvwait ()
#1 0x00007fff8d216274 in _pthread_cond_wait ()
#2 0x0000000102a22324 in etp_proc ()
#3 0x00007fff8d2128bf in _pthread_start ()
#4 0x00007fff8d215b75 in thread_start ()

Thread 2 (process 1595):
#0 0x00007fff92f1b7e6 in kevent ()
#1 0x00007fff9185a5be in _dispatch_mgr_invoke ()
#2 0x00007fff9185914e in _dispatch_mgr_thread ()

Thread 1 (process 1595):
#0 0x00007fff92f1b7e6 in kevent ()
#1 0x0000000102a2a932 in kqueue_poll ()
#2 0x0000000102a2b45b in ev_run ()
#3 0x00000001029fbea0 in node::Start ()
#4 0x00000001029f8334 in start ()
(gdb) thread 4
[Switching to thread 4 (process 1595)]
0x00007fff8cc108b4 in std::string::compare ()
(gdb) frame 20
#20 0x0000000128842bcd in mapnik::datasource_cache::create (params=, bind=) at src/datasource_cache.cpp:197
197	#else // v2
(gdb) p params
$1 =
(gdb) p *params
Structure has no component named operator*.
(gdb) frame 13
#13 0x000000012ae9f20f in ogr_datasource::bind (this=0x7fcc039e4530) at plugins/input/ogr/ogr_datasource.cpp:110
110	OGRRegisterAll();
(gdb) p dataset_name_
$2 = {
_M_dataplus = {
> = {
<__gnu_cxx::new_allocator> = {}, },
members of std::basic_string::_Alloc_hider:
_M_p = 0x7fcc02c82628 "/Users/dane/Documents/MapBox/project/geography-class/layers/world_extent_wgs84.geojson"
},
static npos = 18446744073709551615
}

```