Program terminated with signal SIGABRT, Aborted.

时间:2023-03-09 15:34:03
Program terminated with signal SIGABRT, Aborted.

linux C++ 程序 启动后就奔溃

#0  0x00007f01ee4c21f7 in raise () from /lib64/libc.so.6
#1 0x00007f01ee4c38e8 in abort () from /lib64/libc.so.6
#2 0x00007f01ee501f47 in __libc_message () from /lib64/libc.so.6
#3 0x00007f01ee5088bd in malloc_consolidate () from /lib64/libc.so.6
#4 0x00007f01ee50a3a5 in _int_malloc () from /lib64/libc.so.6
#5 0x00007f01ee50d10c in malloc () from /lib64/libc.so.6
#6 0x00007f01eedc71bd in operator new(unsigned long) () from /lib64/libstdc++.so.6
#7 0x00007f01eee25cf9 in std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) () from /lib64/libstdc++.so.6
#8 0x000000000040b1cf in std::string::_S_construct<char const*> (
__beg=0x1d41264 "{\"DeviceId\":\"1523945328\",\"Project\":\"stream\",\"Record\":\"RwEAGKQHDY+jeJJ1BNSYQv9Yn4E2D4WsKc3DbHg4CcI70CEKBJH4RUk4P6d//+4tKj7jXB36HrIEnJOIU1BUjPrRDF7IKMFZh8a8IX+lDsHkD5UHhNS1E3gefyrAVu1ccdhE/rWimfMH1hizGA"...,
__end=0x1d41cb3 "\r\nPOST /Info HTTP/1.1\r\nAccept:Application/json\r\nContent-Type:Application/json;charset=utf-8\r\nContent-Length:2639\r\nConnection:keep-alive\r\n\r\n{\"DeviceId\":\"1523945328\",\"Project\":\"stream\",\"Record\":\"RwEAEvV"..., __a=...) at /usr/include/c++/4.8.2/bits/basic_string.tcc:138
#9 0x00007f01eee2763d in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, unsigned long, std::allocator<char> const&) () from /lib64/libstdc++.so.6
#10 0x0000000000424309 in on_message_complete (p=0x7ffd735b0ee0) at adapter.cpp:693
#11 0x00007f01ef992ab8 in http_parser_execute () from /root/rel/lib/libhttp_parser.so.2.7.1
#12 0x0000000000423b23 in process_input_buffer (c=0x1d3d140) at adapter.cpp:506
#13 0x0000000000423f6c in read_query_from_client (el=0x1cbd8e0, fd=6, privdata=0x1d3d140, mask=1)
at adapter.cpp:604
#14 0x00007f01efda2150 in aeProcessEvents (eventLoop=0x1cbd8e0, flags=3) at ae.c:413
#15 0x000000000042374d in dtadapter::process_events (this=0x7ffd735b10a0) at adapter.cpp:373
#16 0x000000000042bb58 in main (argc=2, argv=0x7ffd735b1298) at main.cpp:60

  奔溃在std::string 内部

原因:编译环境的libc 和部署环境的libc 版本不一样