I am creating an object of ImqQueueManager
class like this
ImqQueueManager mqManager;
Default constructor is getting called which is default initializing an object of ImqObject
class.
Which is further leading to the crash. Here is the call stack
(gdb) bt full
#0 0x00007fb41179c336 in xcsCheckPointer () from /apps/mqm/lib64/libmqe_r.so
No symbol table info available.
#1 0x00007fb412101ccd in ImqTrc::checkWritePointer(void const*, unsigned long) () from /apps/mqm/lib64/libimqb23gl_r.so
No symbol table info available.
#2 0x00007fb412100264 in ImqStr::copy(char*, unsigned long, char const*, char) () from /apps/mqm/lib64/libimqb23gl_r.so
No symbol table info available.
#3 0x00007fb411fdd007 in ImqObj::setName(char const*) () from /apps/mqm/lib64/libimqc23gl_r.so
No symbol table info available.
#4 0x00007fb411fda4ee in ImqMgr::ImqMgr() () from /apps/mqm/lib64/libimqc23gl_r.so
IBM MQ version 7.5 is installed on this 64 bit Linux machine. Same code is working fine on another machine having the same IBM MQ version installed on that.
Can someone please help me to figure out what could be the reason behind this?
IBM MQ version 7.5 is installed on this 64 bit Linux machine.
You are using a release of IBM MQ that is long out of support. See here for a list of IBM MQ End of Service Dates.
Secondly, you should be showing us your code (update your post) because otherwise we will just be guessing.
Here's a fully functioning C++ that will connect to a remote queue manager and put a message to a queue.
/*
* Program Name
* MQTest31.cpp
*
* Description
* Test program to connect to a queue manager using MQCONNX and MQCSP
* and then put a message from a queue.
*
* Sample Command Line Parameters
* QMgrName ChlName hostname(port) QName
*
* Where
* QMgrName is the queue manager name
* ChlName is the name of the channel to be used
* hostname(port) is the hostname and port number
* QName is the queue name
* i.e.
* MQTest31.exe MQWT1 TEST.CHL 127.0.0.1(1415) TEST.Q1
*
* @author Roger Lacroix, Capitalware Inc.
*/
/*
* Standard Include files
*/
#include <iostream.h>
#include <stdio.h>
#include <string.h>
#include <imqi.hpp> /* MQI */
/*
* mainline
*/
int main ( int argc, char * * argv )
{
/* --------------------------------------------
* Variable declarations.
* --------------------------------------------
*/
ImqQueueManager mgr;
ImqChannel *pchannel = 0 ;
ImqQueue queue;
ImqMessage msg;
/* */
char buffer[10240];
char myUserId[33] = "roger";
char myPassword[33] = "mypwd";
char testMsg[] = "This is a simple test message.";
/* --------------------------------------------
* Code section
* --------------------------------------------
*/
if (argc != 5)
{
cout << "Usage: MQTest31 QMgrName ChlName hostname(port) QName" <<endl;
return( 1 );
}
cout << "MQTest31 Starting." <<endl;
// Create object descriptor for subject queue
mgr.setName( argv[ 1 ] );
pchannel = new ImqChannel ;
pchannel -> setHeartBeatInterval( 1 );
pchannel -> setTransportType( MQXPT_TCP );
pchannel -> setChannelName( argv[ 2 ] );
pchannel -> setConnectionName( argv[ 3 ] );
mgr.setChannelReference( pchannel );
queue.setName( argv[ 4 ] );
/*
* Specify UserId and Password via MQCSP
*/
mgr.setAuthenticationType(MQCSP_AUTH_USER_ID_AND_PWD);
mgr.setUserId( myUserId );
mgr.setPassword( myPassword );
/*
* Connect to queue manager
*/
if ( ! mgr.connect( ) )
{
cout << "MQTest31: connect CC=" << mgr.completionCode()<< " : RC=" << mgr.reasonCode() <<endl;
return( 1 );
}
/* setup queue info */
queue.setConnectionReference( mgr );
queue.setOpenOptions(MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING);
queue.open( );
cout << "MQTest31: open CC=" << queue.completionCode()<< " : RC=" << queue.reasonCode() <<endl;
if ( queue.completionCode( ) == MQCC_OK )
{
msg.useEmptyBuffer( buffer, sizeof( buffer ) );
msg.setMessageId( );
msg.setCorrelationId( );
msg.setFormat( MQFMT_STRING ); /* character string format */
strcpy(buffer, testMsg);
msg.setMessageLength( (int)strlen( buffer ) );
queue.put(msg);
cout << "MQTest31: put CC=" << queue.completionCode()<< " : RC=" << queue.reasonCode() <<endl;
}
/* Close the queue */
queue.close( );
cout << "MQTest31: close CC=" << queue.completionCode()<< " : RC=" << queue.reasonCode() <<endl;
/* Disconnect from the queue manager */
mgr.disconnect( );
cout << "MQTest31: disconnect CC=" << mgr.completionCode()<< " : RC=" << mgr.reasonCode() <<endl;
/* clean up */
if ( pchannel )
{
mgr.setChannelReference( );
delete pchannel ;
}
cout << "MQTest31 Ending." <<endl;
return( 0 );
}