microsoft / mimalloc

mimalloc is a compact general purpose allocator with excellent performance.
MIT License
10.58k stars 864 forks source link

under what situation mi_new could fail and how to get more info when crashes #379

Open chengm349 opened 3 years ago

chengm349 commented 3 years ago

most time my program runs ok (for example several months in production no problem). when there was a network issue and restarted my program, the program could crash. And I can't do any meaningful logical analysis.

gdb result

Using host libthread_db library "/lib64/libthread_db.so.1". Missing separate debuginfo for /home/sgesys/flex/libs/libxerces-c-3.1.so Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/df/7633d16d4b4063b8cd02ccdbb11acaa15526f5.debug Core was generated by `sge_flex -nodeid SGE_FLEX'. Program terminated with signal 11, Segmentation fault.

0 0x0000000000625b2e in mi_new ()

Missing separate debuginfos, use: debuginfo-install glibc-2.17-222.el7.x86_64 libgcc-4.8.5-28.el7.x86_64 libstdc++-4.8.5-28.el7.x86_64 zlib-1.2.7-17.el7.x86_64 (gdb) bt full

0 0x0000000000625b2e in mi_new ()

No symbol table info available.

1 0x0000000000417a70 in allocate (this=0x7f5cb73fd940, __n=784) at /opt/rh/devtoolset-7/root/usr/include/c++/7/ext/new_allocator.h:111

No locals.

2 allocate (a=..., n=784) at /opt/rh/devtoolset-7/root/usr/include/c++/7/bits/alloc_traits.h:436

No locals.

3 fmt::v6::basic_memory_buffer<char, 250ul, std::allocator >::grow (this=0x7f5cb73fd940, size=) at /fs02/home/thirdparty/spdlog/include/spdlog/fmt/bundled/format.h:676

    new_capacity = 784
    new_data = <optimized out>
chengm349 commented 3 years ago

on that network issue day, user started 4 times and the program crashed 4 times with same gdb trace result (ie mi_new ())