Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -177935456 (LWP 5483)]
0xf79ff2ca in activemq::core::ActiveMQSessionExecutor::dispatch (this=0xf4b04bc0,
[email protected]) at activemq/core/ActiveMQSessionExecutor.cpp:129
129 activemq/core/ActiveMQSessionExecutor.cpp: No such file or directory.
in activemq/core/ActiveMQSessionExecutor.cpp
Current language: auto; currently c++
どうすればこの問題を解決できますか?もっとコードが必要ですか?私はそれがどこで失敗するのか分からない?どのように失敗するのかを見つけることができますか?セグメンテーションフォールトは失敗しますか?
どこにダンプするのですか?
編集:ここ
コードです:
std::string ActiveMQWrapper::get(){
Connection* connection;
Session* session;
Destination* destination;
MessageConsumer* consumer;
try {
std:string brokerURI = "tcp://localhost:61613?wireFormat=stomp";
auto_ptr<ConnectionFactory> connectionFactory(ConnectionFactory::createCMSConnectionFactory(brokerURI));
connection = connectionFactory->createConnection();
connection->start();
session = connection->createSession(Session::AUTO_ACKNOWLEDGE);
destination = session->createQueue("TEST.Prototype");
consumer = session->createConsumer(destination);
TextMessage* textMessage =
dynamic_cast< TextMessage* >(consumer->receive());
string text = "";
if(textMessage != NULL) {
text = textMessage->getText();
} else {
text = "NOT A TEXTMESSAGE!";
}
try{
if(destination != NULL) delete destination;
}catch (CMSException& e) { e.printStackTrace(); }
destination = NULL;
try{
if(consumer != NULL) delete consumer;
}catch (CMSException& e) { e.printStackTrace(); }
consumer = NULL;
// Close open resources.
try{
if(session != NULL) session->close();
if(connection != NULL) connection->close();
}catch (CMSException& e) { e.printStackTrace(); }
// Now Destroy them
try{
if(session != NULL) delete session;
}catch (CMSException& e) { e.printStackTrace(); }
session = NULL;
try{
if(connection != NULL) delete connection;
}catch (CMSException& e) { e.printStackTrace(); }
connection = NULL;
return text.c_str();
} catch(CMSException& e) {
e.printStackTrace();
}
}
コードが必要です。 – orlp
はい、コードがさらに必要になります。優れたIDEとデバッガでスタックトレースを表示できます。目を逸らさなければならないことのいくつかは、オフ・バイ・ワンのエラーであり、単純に未割り当てメモリにアクセスしようとしています。 – Maxpm
がコードで更新されました。 – DarthVader