kopano-server crash at start time when linking against musl


  • Hi,

    We’re trying to deploy kopano 10.0.5 on Alpine Linux, which uses musl libc, instead of GNU libc. We’re building kopano using gcc 9.2.0.
    After patching some stuff preprocessor stuff, building works fine, but starting kopano-server crashes it because of a problem in the destructor of ec_socket. There’s also a probably related issue that makes kopano-server crash when opening a socket fails.
    Following are the preceeding stack frames and the stack trace. This is probably something for Jan.
    Please let me know if you’d help us solving this. I’m not a C++ expert.

    std::_Rb_tree<int, std::pair<int const, std::unique_ptr<soap, KC::ec_soap_deleter> >, std::_Select1st<std::pair<int const, std::unique_ptr<soap, KC::ec_soap_deleter> > >, std::less<int>, std::allocator<[55/4507$
    <int const, std::unique_ptr<soap, KC::ec_soap_deleter> > > >::_M_insert_node (__z=0x7ffff7ffefc0, __p=0x7ffff7455fc0, __x=0x0, this=0x55555559eea8) at /usr/include/c++/9.2.0/bits/stl_tree.h:2354                 
    2354    in /usr/include/c++/9.2.0/bits/stl_tree.h                                                                                                                                                                  
    (gdb)                                                                                                                                                                                                              
    std::_Rb_tree<int, std::pair<int const, std::unique_ptr<soap, KC::ec_soap_deleter> >, std::_Select1st<std::pair<int const, std::unique_ptr<soap, KC::ec_soap_deleter> > >, std::less<int>, std::allocator<std::pair
    <int const, std::unique_ptr<soap, KC::ec_soap_deleter> > > >::_M_emplace_unique<int&, std::unique_ptr<soap, KC::ec_soap_deleter> > (this=0x55555559eea8, __args#0=<optimized out>, __args#1=...)                   
        at /usr/include/c++/9.2.0/bits/move.h:74                                                                                                                                                                       
    74      /usr/include/c++/9.2.0/bits/move.h: No such file or directory.                                                                                                                                             
    (gdb)                                                                                                                                                                                                              
    std::unique_ptr<soap, KC::ec_soap_deleter>::~unique_ptr (this=0x7fffffffda00, __in_chrg=<optimized out>) at /usr/include/c++/9.2.0/bits/unique_ptr.h:278                                                           
    278     /usr/include/c++/9.2.0/bits/unique_ptr.h: No such file or directory.                                                                                                                                       
    (gdb)                        
    ksrv_listen_pipe (cfg=<optimized out>, ssc=0x7ffff56cbfc0) at provider/server/ECServer.cpp:788
    788     provider/server/ECServer.cpp: No such file or directory.
    (gdb) 
    786     in provider/server/ECServer.cpp
    (gdb) 
    std::_List_iterator<KC::ec_socket>::operator++ (this=<synthetic pointer>) at /usr/include/c++/9.2.0/bits/stl_list.h:217
    217     /usr/include/c++/9.2.0/bits/stl_list.h: No such file or directory.
    (gdb)                        
    ksrv_listen_pipe (cfg=<optimized out>, ssc=0x7ffff56cbfc0) at provider/server/ECServer.cpp:786
    786     provider/server/ECServer.cpp: No such file or directory.
    (gdb) 
    1051    /usr/include/c++/9.2.0/bits/stl_list.h: No such file or directory.
    (gdb) 
    785     provider/server/ECServer.cpp: No such file or directory.
    (gdb) 
    std::__cxx11::list<KC::ec_socket, std::allocator<KC::ec_socket> >::~list (this=0x7fffffffdae0, __in_chrg=<optimized out>) at provider/server/ECServer.cpp:785
    785     in provider/server/ECServer.cpp
    (gdb)                        
    std::__cxx11::_List_base<KC::ec_socket, std::allocator<KC::ec_socket> >::~_List_base (this=0x7fffffffdae0, __in_chrg=<optimized out>) at /usr/include/c++/9.2.0/bits/stl_list.h:823
    823     /usr/include/c++/9.2.0/bits/stl_list.h: No such file or directory.
    (gdb) 
    std::__cxx11::_List_base<KC::ec_socket, std::allocator<KC::ec_socket> >::_M_clear (this=0x7fffffffdae0) at /usr/include/c++/9.2.0/bits/list.tcc:66
    66      /usr/include/c++/9.2.0/bits/list.tcc: No such file or directory.
    (gdb)                        
    71      in /usr/include/c++/9.2.0/bits/list.tcc
    (gdb)                        
    77      in /usr/include/c++/9.2.0/bits/list.tcc
    (gdb)                        
    std::allocator_traits<std::allocator<std::_List_node<KC::ec_socket> > >::destroy<KC::ec_socket> (__a=..., __p=0x5555555c7450) at /usr/include/c++/9.2.0/bits/list.tcc:77
    77      in /usr/include/c++/9.2.0/bits/list.tcc
    (gdb) 
    __gnu_cxx::new_allocator<std::_List_node<KC::ec_socket> >::destroy<KC::ec_socket> (this=0x7fffffffdae0, __p=0x5555555c7450) at /usr/include/c++/9.2.0/ext/new_allocator.h:151
    151     /usr/include/c++/9.2.0/ext/new_allocator.h: No such file or directory.
    (gdb) 
    KC::ec_socket::~ec_socket (this=0x5555555c7450, __in_chrg=<optimized out>) at common/ECChannel.cpp:1010
    1010    common/ECChannel.cpp: No such file or directory.
    (gdb) 
    1011    in common/ECChannel.cpp
    (gdb) 
    
    Program received signal SIGSEGV, Segmentation fault. 
    0x00007ffff7fa056b in freeaddrinfo () from /lib/ld-musl-x86_64.so.1
    
    #0  0x00007ffff7fa056b in freeaddrinfo () from /lib/ld-musl-x86_64.so.1
    No symbol table info available.
    #1  0x00007fffffffdae0 in ?? ()
    No symbol table info available.
    #2  0x00005555555c7450 in ?? ()
    No symbol table info available.
    #3  0x00007fffffffdae0 in ?? ()
    No symbol table info available.
    #4  0x00007ffff7f200c4 in KC::ec_socket::~ec_socket (this=0x1, __in_chrg=<optimized out>) at common/ECChannel.cpp:1011
    No locals.
    #5  0x0000555555561d34 in __gnu_cxx::new_allocator<std::_List_node<KC::ec_socket> >::destroy<KC::ec_socket> (this=0x5555553623f8, __p=0x5555555c7450) at /usr/include/c++/9.2.0/ext/new_allocator.h:151
    No locals.
    #6  std::allocator_traits<std::allocator<std::_List_node<KC::ec_socket> > >::destroy<KC::ec_socket> (__a=..., __p=0x5555555c7450) at /usr/include/c++/9.2.0/bits/alloc_traits.h:497
    No locals.
    #7  std::__cxx11::_List_base<KC::ec_socket, std::allocator<KC::ec_socket> >::_M_clear (this=0x5555553623f8) at /usr/include/c++/9.2.0/bits/list.tcc:77
            __tmp = 0x5555555c7440
            __val = 0x5555555c7450
            __cur = 0x555555362444
    #8  0x000055555555fb9b in std::__cxx11::_List_base<KC::ec_socket, std::allocator<KC::ec_socket> >::~_List_base (this=0x7fffffffdae0, __in_chrg=<optimized out>) at /usr/include/c++/9.2.0/bits/stl_list.h:823
    No locals.
    #9  std::__cxx11::list<KC::ec_socket, std::allocator<KC::ec_socket> >::~list (this=0x7fffffffdae0, __in_chrg=<optimized out>) at /usr/include/c++/9.2.0/bits/stl_list.h:823
    No locals.
    #10 ksrv_listen_pipe (cfg=<optimized out>, ssc=0x7ffff56cbfc0) at provider/server/ECServer.cpp:785
    

  • I’m sorry I can’t help as I myself have failed even at compiling. Watching the thread in hopes that someone else has some insight, I would love to be able to run this under Alpine / musl based systems.


  • @tiredofit For your benefit, here are the current package sources I use: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/8569


  • Changes available in Stash/GH, was posted to Kopano on 2020-08-19, and nothing happened then.