FooBarWidget/passenger — pull request #85 by pdrakeweb (2013-06-19 20:14:27+00:00)
Title: Fix fakeroot generated locations.ini

When running the fakeroot rake task, an invalid locations.ini file is generated in the fakeroot. If the generated locations.ini file is used as the PassengerRoot for apache, it may result in a segfault as shown below. These changes correct the locations.ini.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff3fd6e18 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_begin (this=0x8)
at /usr/include/c++/4.4/bits/stl_tree.h:488
/usr/include/c++/4.4/bits/stl_tree.h:488:13040:beg:0x7ffff3fd6e18
(gdb) exit
Undefined command: "exit". Try "help".
(gdb) where
#0 0x00007ffff3fd6e18 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_begin (this=0x8)
at /usr/include/c++/4.4/bits/stl_tree.h:488
#1 0x00007ffff3fd4028 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::find (this=0x8, __k=...)
at /usr/include/c++/4.4/bits/stl_tree.h:1434
#2 0x00007ffff3fd053f in std::map, std::allocator > >::find (this=0x8, __x=...) at /usr/include/c++/4.4/bits/stl_map.h:674
#3 0x00007ffff3fc0b8f in Passenger::IniFileSection::hasKey (this=0x0, keyName=...) at ext/common/Utils/IniFile.h:59
#4 0x00007ffff3fc2b7a in Passenger::ResourceLocator::getOption (file=..., section=..., key=...) at ext/common/ResourceLocator.h:55
#5 0x00007ffff3fc3098 in ResourceLocator (this=0x7fffffffd9e0, rootOrFile=...) at ext/common/ResourceLocator.h:68
#6 0x00007ffff3fc4edb in Passenger::AgentsStarter::start(std::string const&, Passenger::VariantMap const&, boost::function const&) (this=0x7ffff8403e20, passengerRoot=..., extraParams=..., afterFork=...) at ext/common/AgentsStarter.h:393
#7 0x00007ffff3fce6d1 in Hooks (this=0x7ffff8403da0, pconf=0x7ffff820e138, plog=0x7ffff82422d8, ptemp=0x7ffff82442e8, s=0x7ffff8217590) at ext/apache2/Hooks.cpp:1301
#8 0x00007ffff3fb8cda in init_module (pconf=0x7ffff820e138, plog=0x7ffff82422d8, ptemp=0x7ffff82442e8, s=0x7ffff8217590) at ext/apache2/Hooks.cpp:1585
#9 0x00007ffff7fd5159 in ap_run_post_config (pconf=0x7ffff820e138, plog=0x7ffff82422d8, ptemp=0x7ffff82442e8, s=0x7ffff8217590) at /build/buildd/apache2-2.2.14/server/config.c:95
#10 0x00007ffff7fc11c5 in main (argc=1, argv=0x7fffffffe6a8) at /build/buildd/apache2-2.2.14/server/main.c:682