[xubuntu-users] C++ Compile crashes after Systemupdate to Xubuntu 13.10
hellhound_01 at web.de
hellhound_01 at web.de
Sat Nov 30 12:50:45 UTC 2013
Lately I've migrated my OS from 13.04 to 13.10. Now My C++ code doesn't compile anymore.
Now any C++ compile using GNU 4.8.1 compiler crashes with:
terminate called after throwing an instance of 'std::system_error' what(): Unknown error -1 Aborted (core dumped)
I tried Xubuntu 13.10 32bit and 64bit version. Failure exist on both. GDB reports:
Program received signal SIGABRT, Aborted. 0x00007ffff6c33f77 in __GI_raise (sig=sig at entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56 56
../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
Meanwhile I figured out that the problem is based on my singleton implementation. This implementation works successfully
with MinGW-64 on Windows platform in handshake with GCC 4.8 and with Xubuntu 13.04 (32 and 64bit):
namespace binrev{
namespace brCore{
template <typename T> class DLL_EXPORT brSingleton
{ public:
static T& getInstance() { std::call_once(m_once, safe_create); return *m_instance; }
protected:
brSingleton(const std::string& name) : m_name(name) {}
static void safe_create() { brSingleton::m_instance.reset(new T()); }
brSingleton(const brSingleton& rs) = delete;
brSingleton& operator = (const brSingleton& rs) = delete;
virtual ~brSingleton(){}
protected:
static std::unique_ptr<T> m_instance;
static std::once_flag m_once; std::string m_name;
};
template<typename T> std::once_flag brSingleton<T>::m_once;
}// ns-brCore
}// ns-binrev
If I call getInstance at concrete singleton implementation, the crash occurs on std::call_once function call.
I'm running out of ideas. Has anyone an idea what's going wrong? Thanks.
More information about the xubuntu-users
mailing list