Opened 9 years ago

Last modified 9 years ago

#9560 new Bugs

operations_test_static unit test crashes during static initialization phase on Mac/10.7/32-bit/darwin-4.2.1

Reported by: Monty Brandenberg <mcbinc@…> Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.55.0 Severity: Regression
Keywords: Cc:

Description

Verifying a 32-bit build of Boost on Mac, I get a consistent crash in operations_test_static during static initialization (prior to main() invocation). Problem appears to be a lack of initialization of path.hpp's anon namespace 'codecvt_facet_ptr'.

Platform: 1.55.0, Mac OS 10.7, Xcode 4.3.3, darwin-4.2.1, address-model=32, architecture=x86

Build sequence is (approximately):

./bjam toolset=darwin variant=debug address-model=32 architecture=x86 --layout=tagged --with-filesystem -sNO_BZIP2=1 -d2 -d+4 stage
cd libs/filesystem/test
../../../bjam toolset=darwin variant=debug address-model=32 architecture=x86 --layout=tagged --with-filesystem -sNO_BZIP2=1 -d2 -d+4 -a -q

Stacktrace of access violation:

(gdb) run
Starting program: /Users/monty/3P/3p-boost-update/boost/bin.v2/libs/filesystem/test/operations_test_static.test/darwin-4.2.1/debug/address-model-32/architecture-x86/link-static/operations_test_static 
Reading symbols for shared libraries ++......................... done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00058054 in std::__codecvt_abstract_base<wchar_t, char, __mbstate_t>::in (this=0x0, __state=@0xbfffeba0, 
    __from=0x1660cc "operations-test-%%%%-%%%%-%%%%-%%%%", __from_end=0x1660ef "", __from_next=@0xbfffeb9c, 
    __to=0xbfffec90, __to_end=0xbffff090, __to_next=@0xbfffeb98) at codecvt.h:206
206				   __to, __to_end, __to_next);
(gdb) where
#0  0x00058054 in std::__codecvt_abstract_base<wchar_t, char, __mbstate_t>::in (this=0x0, __state=@0xbfffeba0, 
    __from=0x1660cc "operations-test-%%%%-%%%%-%%%%-%%%%", __from_end=0x1660ef "", __from_next=@0xbfffeb9c, 
    __to=0xbfffec90, __to_end=0xbffff090, __to_next=@0xbfffeb98) at codecvt.h:206
#1  0x00057e10 in convert_aux (from=0x1660cc "operations-test-%%%%-%%%%-%%%%-%%%%", from_end=0x1660ef "", 
    to=0xbfffec90, to_end=0xbffff090, target=@0xbffff200, cvt=@0x0) at path_traits.cpp:76
#2  0x00057908 in boost::filesystem::path_traits::convert (from=0x1660cc "operations-test-%%%%-%%%%-%%%%-%%%%", 
    from_end=0x1660ef "", to=@0xbffff200, cvt=@0x0) at path_traits.cpp:158
#3  0x00058c79 in boost::filesystem::path::wstring (this=0xbffff288, cvt=@0x0) at path.hpp:392
#4  0x00058d0a in boost::filesystem::path::wstring (this=0xbffff288) at path.hpp:386
#5  0x00058346 in boost::filesystem::detail::unique_path (model=@0xbffff288, ec=0x0) at unique_path.cpp:113
#6  0x000375fb in boost::filesystem::unique_path (p=@0xbffff288) at operations.hpp:544
#7  0x000339b5 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535)
    at operations_test.cpp:118
#8  0x0003371a in global constructors keyed to _ZN12_GLOBAL__N_18platformE () at operations_test.cpp:2035
#9  0x8fe11203 in __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE ()
#10 0x8fe10d68 in __dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE ()
#11 0x8fe0e2c8 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE
    ()
#12 0x8fe0f268 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextERNS_21InitializerTimingListE ()
#13 0x8fe03694 in __dyld__ZN4dyld24initializeMainExecutableEv ()
#14 0x8fe07f99 in __dyld__ZN4dyld5_mainEPK12macho_headermiPPKcS5_S5_ ()
#15 0x8fe012ef in __dyld__ZN13dyldbootstrap5startEPK12macho_headeriPPKclS2_ ()
#16 0x8fe01063 in __dyld__dyld_start ()

Change History (2)

comment:1 by chris.cooper@…, 9 years ago

Similar problem with the clang++ compiler shipped with XCode 5.1 ("Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)").

Stack trace:

  • thread #1: tid = 0x430e0, 0x000000010002a609 operations_test_static`(anonymous namespace)::convert_aux(char const*, char const*, wchar_t*, wchar_t*, std::1::basic_string<wchar_t, std::1::char_traits<wchar_t>, std::1::allocator<wchar_t> >&, std::1::codecvt<wchar_t, char, mbstate_t> const&) + 89, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    • frame #0: 0x000000010002a609 operations_test_static`(anonymous namespace)::convert_aux(char const*, char const*, wchar_t*, wchar_t*, std::1::basic_string<wchar_t, std::1::char_traits<wchar_t>, std::1::allocator<wchar_t> >&, std::1::codecvt<wchar_t, char, mbstate_t> const&) + 89 frame #1: 0x000000010002a56f operations_test_static`boost::filesystem::path_traits::convert(char const*, char const*, std::1::basic_string<wchar_t, std::1::char_traits<wchar_t>, std::1::allocator<wchar_t> >&, std::1::codecvt<wchar_t, char, mbstate_t> const&) + 207 frame #2: 0x000000010002ac47 operations_test_static`boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*) + 135 frame #3: 0x0000000100021028 operations_test_static`_GLOBALI_a + 504

comment:2 by anonymous, 9 years ago

Sorry, didn't notice the formatting.

* thread #1: tid = 0x430e0, 0x000000010002a609 operations_test_static`(anonymous namespace)::convert_aux(char const*, char const*, wchar_t*, wchar_t*, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, std::__1::codecvt<wchar_t, char, __mbstate_t> const&) + 89, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x000000010002a609 operations_test_static`(anonymous namespace)::convert_aux(char const*, char const*, wchar_t*, wchar_t*, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, std::__1::codecvt<wchar_t, char, __mbstate_t> const&) + 89
    frame #1: 0x000000010002a56f operations_test_static`boost::filesystem::path_traits::convert(char const*, char const*, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, std::__1::codecvt<wchar_t, char, __mbstate_t> const&) + 207
    frame #2: 0x000000010002ac47 operations_test_static`boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*) + 135
    frame #3: 0x0000000100021028 operations_test_static`_GLOBAL__I_a + 504
Note: See TracTickets for help on using tickets.