rttrorg / rttr

C++ Reflection Library
https://www.rttr.org
MIT License
3.17k stars 439 forks source link

Segfault when building with GCC 8 #232

Closed antonio-rojas closed 5 years ago

antonio-rojas commented 5 years ago

rttr segfaults when called from kdenlive if it's built with GCC8 or Clang 8. Doesn't happen if built with GCC 7

(gdb) 
#0  0x000055555599f224 in std::_Sp_counted_ptr_inplace<rttr::detail::registration_executer, std::allocator<rttr::detail::registration_executer>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&) (this=0x555555d3b590,  type_info node=...) at /usr/include/c++/8.2.1/bits/shared_ptr_base.h:573
#1  0x00007ffff71c7864 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&) const
    (this=0x7fffffffe3d8,  type_info node=...) at /usr/include/c++/8.2.1/bits/shared_ptr_base.h:750
#2  0x00007ffff71c7864 in std::__shared_ptr<rttr::detail::registration_executer, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<rttr::detail::registration_executer>>(std::_Sp_make_shared_tag, std::allocator<rttr::detail::registration_executer> const&) (__tag=..., __a=..., this=0x7fffffffe3d0)
    at /usr/include/c++/8.2.1/bits/shared_ptr_base.h:1328
#3  0x00007ffff71c7864 in std::shared_ptr<rttr::detail::registration_executer>::shared_ptr<std::allocator<rttr::detail::registration_executer>>(std::_Sp_make_shared_tag, std::allocator<rttr::detail::registration_executer> const&) (__a=..., __tag=..., this=0x7fffffffe3d0)
    at /usr/include/c++/8.2.1/bits/shared_ptr.h:360
#4  0x00007ffff71c7864 in std::allocate_shared<rttr::detail::registration_executer, std::allocator<rttr::detail::registration_executer>>(std::allocator<rttr::detail::registration_executer> const&) (__a=...) at /usr/include/c++/8.2.1/bits/shared_ptr.h:707
#5  0x00007ffff71c7864 in std::make_shared<rttr::detail::registration_executer>() () at /usr/include/c++/8.2.1/bits/shared_ptr.h:723
#6  0x00007ffff71c7864 in rttr::detail::create_if_empty<rttr::detail::registration_executer>(std::shared_ptr<rttr::detail::registration_executer> const&)
    (obj=...) at /usr/src/debug/rttr-0.9.6/src/rttr/../rttr/detail/misc/utility.h:489
#7  0x00007ffff71c7bf6 in rttr::registration::class_<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::constructor<, rttr::detail::public_access, void>(rttr::detail::public_access) (this=0x7fffffffe370, level=...)
    at /usr/src/debug/rttr-0.9.6/src/rttr/../rttr/detail/registration/registration_impl.h:133
#8  0x00007ffff71c7bf6 in rttr_auto_register_reflection_function_() () at /usr/src/debug/rttr-0.9.6/src/rttr/detail/misc/standard_types.cpp:73
#9  0x00007ffff7fe354a in call_init.part () at /lib64/ld-linux-x86-64.so.2
#10 0x00007ffff7fe364a in _dl_init () at /lib64/ld-linux-x86-64.so.2
#11 0x00007ffff7fd503a in _dl_start_user () at /lib64/ld-linux-x86-64.so.2
#12 0x0000000000000001 in  ()
#13 0x00007fffffffe8d4 in  ()
#14 0x0000000000000000 in  ()
antonio-rojas commented 5 years ago

Seems to be a compiler bug - works fine with GCC prior to 8.2.1 and with 8.3 onwards.