且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C ++程序总是崩溃执行std :: string assign时

更新时间:2023-11-14 16:02:46

这是一个初始猜测,返回跟踪。

This is an initial guess using all information I can extract from your back trace.

您很可能混合和匹配gcc版本,链接器和libstdc ++,导致主机上的异常行为:

You are most likely mixing and matching gcc version, linker and libstdc++ that results an unusual behaviour on the host machine:


  1. libc是系统的: /lib64/libc.so.6

  2. libstdc ++在ThirdParty目录中 - 这是可疑的,因为它告诉我它可能在其他地方用不同的目标编译 - /home/bbazso/ThirdParty/sources/gcc-4.2.4/x86_64- pc-linux-gnu / libstdc ++ - v3 /

  3. 另一个libstdc ++在 / opt /opt/trx-HEAD/gcc/4.2.4/lib/gcc/x86_64-pc-linux-gnu/4.2.4 /../../../../ include / c ++ / 4.2 .4 / bits / basic_string.h:491

  1. libc is the system's: /lib64/libc.so.6
  2. libstdc++ is in a "ThirdParty" directory - this is suspicions, as it tells me it might be compiled elsewhere with a different target - /home/bbazso/ThirdParty/sources/gcc-4.2.4/x86_64-pc-linux-gnu/libstdc++-v3/
  3. Yet another libstdc++ in /opt: /opt/trx-HEAD/gcc/4.2.4/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../include/c++/4.2.4/bits/basic_string.h:491

此外,GCC可能会混合系统的ld这可能会导致进一步奇怪的内存映射使用。

In addition, GCC may mix the system's ld instead of itself which may cause further weird memory maps usage.