环境:
Linux version 4.14.0_1-0-0-17 (root@xxxxx) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC)) #1 SMP Tue Mar 10 19:33:18 CST 2020
GLIBC: libc-2.21.so
GCC: gcc-8.2.0
CENTOS VERSION:
LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.3 (Final)
Release: 6.3
Codename: Final
#include <iostream>
#include <string>
using namespace std;
int anss () {
static std::string ans = "prefix";
static std::string ans2 = "quit";
cout << ans << " " << ans2 << std::endl;
return 0;
}
class ANS{
public:
~ANS() {
anss();
}
};
ANS ans;
int main()
{
anss();
return 0;
}
这类问题的一些解决方法:
https://www.tylinux.com/post/fix-a-react-native-crash-on-mutex/
问题的原理:
https://www.cnblogs.com/william-cheung/p/4831085.html
https://wiki.osdev.org/C++#GCC