Skip to content

seg-fault in v1.8 release #294

@chenziliang

Description

@chenziliang

Tried using v1.8 release (the single CLI11.hpp file) in my project, got seg-fault, the following is the trace.

(gdb) bt
#0  __GI___libc_free (mem=0x93fa55d09a576) at malloc.c:3103
#1  0x000055555565846e in __gnu_cxx::new_allocator<CLI::App*>::deallocate (this=0x5555569ec7a0, __p=0x93fa55d09a576) at /usr/include/c++/8/ext/new_allocator.h:125
#2  0x000055555564efe5 in std::allocator_traits<std::allocator<CLI::App*> >::deallocate (__a=..., __p=0x93fa55d09a576, __n=18446418666927868753)
    at /usr/include/c++/8/bits/alloc_traits.h:462
#3  0x00005555556430fe in std::_Vector_base<CLI::App*, std::allocator<CLI::App*> >::_M_deallocate (this=0x5555569ec7a0, __p=0x93fa55d09a576, __n=18446418666927868753)
    at /usr/include/c++/8/bits/stl_vector.h:304
#4  0x0000555555633170 in std::_Vector_base<CLI::App*, std::allocator<CLI::App*> >::~_Vector_base (this=0x5555569ec7a0, __in_chrg=<optimized out>)
    at /usr/include/c++/8/bits/stl_vector.h:285
#5  0x0000555555621653 in std::vector<CLI::App*, std::allocator<CLI::App*> >::~vector (this=0x5555569ec7a0, __in_chrg=<optimized out>)
    at /usr/include/c++/8/bits/stl_vector.h:570
#6  0x00005555556114aa in CLI::App::~App (this=0x5555569ec640, __in_chrg=<optimized out>) at /.../CLI11.hpp:3912
#7  0x0000555555611584 in CLI::App::~App (this=0x5555569ec640, __in_chrg=<optimized out>) at /.../CLI11.hpp:3912
#8  0x0000555555678944 in std::_Sp_counted_ptr<CLI::App*, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x5555569f3130) at /usr/include/c++/8/bits/shared_ptr_base.h:377
#9  0x00005555556298b2 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x5555569f3130) at /usr/include/c++/8/bits/shared_ptr_base.h:155
#10 0x0000555555618061 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x5555569f2678, __in_chrg=<optimized out>)
    at /usr/include/c++/8/bits/shared_ptr_base.h:728
#11 0x00005555556092ba in std::__shared_ptr<CLI::App, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x5555569f2670, __in_chrg=<optimized out>)
    at /usr/include/c++/8/bits/shared_ptr_base.h:1167
#12 0x00005555556092d6 in std::shared_ptr<CLI::App>::~shared_ptr (this=0x5555569f2670, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/shared_ptr.h:103
#13 0x0000555555658536 in std::_Destroy<std::shared_ptr<CLI::App> > (__pointer=0x5555569f2670) at /usr/include/c++/8/bits/stl_construct.h:98
#14 0x000055555564f0ff in std::_Destroy_aux<false>::__destroy<std::shared_ptr<CLI::App>*> (__first=0x5555569f2670, __last=0x5555569f2690)
    at /usr/include/c++/8/bits/stl_construct.h:108
#15 0x0000555555643244 in std::_Destroy<std::shared_ptr<CLI::App>*> (__first=0x5555569f2670, __last=0x5555569f2690) at /usr/include/c++/8/bits/stl_construct.h:137
#16 0x000055555563331f in std::_Destroy<std::shared_ptr<CLI::App>*, std::shared_ptr<CLI::App> > (__first=0x5555569f2670, __last=0x5555569f2690)
    at /usr/include/c++/8/bits/stl_construct.h:206
#17 0x0000555555621735 in std::vector<std::shared_ptr<CLI::App>, std::allocator<std::shared_ptr<CLI::App> > >::~vector (this=0x7fffffffe3c8, __in_chrg=<optimized out>)
    at /usr/include/c++/8/bits/stl_vector.h:567
#18 0x0000555555611474 in CLI::App::~App (this=0x7fffffffe1f0, __in_chrg=<optimized out>) at /.../CLI11.hpp:3912
#19 0x00005555555ed045 in main (argc=4, argv=0x7fffffffe578) at /../main.cxx:478

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions