在AIX上的std :: locale :: operator =(std :: locale const&)中崩溃 [英] Crash in std::locale::operator=(std::locale const&) on AIX

查看:176
本文介绍了在AIX上的std :: locale :: operator =(std :: locale const&)中崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对AIX有点陌生,并且遇到了一个奇怪的问题。我有两台AIX机器,而我的C ++应用程序在其中一台上运行,而在另一台上崩溃。

I am a bit new to AIX and stuck up with a weird issue. I have two AIX machine and my C++ application is running on one and crashing on the other.

当我检查安装的软件包(rpm -qa)时,我发现一个区别,在第一台机器上,所有rpm都以.ppc扩展名结尾,而第二台则不是。我的cpp应用程序可以在第二台计算机上完美运行。

When I checked packages installed (rpm -qa), I observed one difference, for 1st machine all the rpm's are ending with .ppc extension and for 2nd it's not. My cpp app is perfectly running on 2nd machine.

我怀疑这可能是导致此问题的原因,但不确定。

I suspect this can be a cause for this issue but not sure.

PS:显示两者之间的差异。

PS: Showing the difference between two.

堆栈跟踪:

    Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xd0bded2c in std::locale::operator=(std::locale const&) () from /opt/freeware/lib/libstdc++.a(libstdc++.so.6)
(gdb) bt
#0  0xd0bded2c in std::locale::operator=(std::locale const&) () from /opt/freeware/lib/libstdc++.a(libstdc++.so.6)
#1  0xd0bdeee0 in std::ios_base::_M_init() () from /opt/freeware/lib/libstdc++.a(libstdc++.so.6)
#2  0xd0bdede4 in std::basic_ios<char, std::char_traits<char> >::init () from /opt/freeware/lib/libstdc++.a(libstdc++.so.6)
#3  0x100b618c in Logging::Logging (this=0x20086438, filename=..., level=4) at Logging.cpp:404
#4  0x1005d96c in main (argc=<error reading variable>, argv=<error reading variable>) at  _start_ :141
warning: (Internal error: pc 0x100001e3 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x100001e4 in read in psymtab, but not in symtab.)

代码快照:

string logFile = "test.txt"
Logging* logger = new Logging(logFile,4);

// Logging Constructor     
Logging::Logging(const string &filename,loglevel): logfilename(filename),level(loglevel) {
}


推荐答案

我刚刚遇到了同样的问题,并且可以通过禁用优化标志来解决此问题(例如-O2)在g ++编译器的makefile中。我的makefile包含

I just faced the same issue and was able to fix so by disabling optimization flags (like -O2) at makefile for the g++ compiler. My makefile contained

CC = g ++
CC_FLAGS = -g3 -ggdb -Wall -std = c ++ 11 -DDEBUG -pthread -O2

其中来自gdb的回溯显示为
std :: locale :: operator =(std :: locale const&)()

Where the backtrace from gdb shown std::locale::operator=(std::locale const&) ()

此没有标志 -O2就不再出现

This wasn't occouring anymore without flags "-O2"

CC = g ++
CC_FLAGS = -Wall -std = c ++ 11 -DDEBUG -pthread

这篇关于在AIX上的std :: locale :: operator =(std :: locale const&amp;)中崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆