qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aamir.moham...@aon.ca
Subject FieldTable decoding not working on ppc64?
Date Mon, 24 Nov 2008 17:13:05 GMT
Hello,

I have compiled qpid (trunk) on the ppc64 architecture. I have 
successfully run the "direct" example in a number of different 
configurations (qpid broker running on x86 and clients running on ppc, and 
vice versa). 

Then I made the following modifications to the "direct" example. In 
direct_producer.cpp, I changed the messages to:

for (int i=0; i<count; i++) { 
        FieldTable flds;
        flds.setDouble("foo", 0.99999999);
 
        char* buff = new char[128];
        Buffer buffer(buff, 128);
        flds.encode(buffer);

        string data;
        data.assign(buffer.getPointer(), buffer.getSize());
        message.setData(data);

        session.messageTransfer(arg::content=message, 
arg::destination="amq.direct");
}


In "listener.cpp" I changed the following method:

void Listener::received(Message& message) {
        string msg = message.getData();
 
        char* buff = new char[msg.size()];
        memcpy(buff, msg.data(), msg.size());
        Buffer buffer(buff, msg.size());

        FieldTable flds;
        flds.decode(buffer);
 
        double x;
        flds.getDouble("foo", x);
        std::cout << x << std::endl;
}


I have successfully run this code in the following configurations:

1. x86 message broker, x86 direct_producer, x86 listener
2. ppc64 message broker, ppc64 direct_producer, x86 listener
3. ppc64 message broker, ppc64 direct_producer, x86 listener

However, my listener.cpp compiled on ppc64 does not work at all. On ppc64, 
the listener program seg faults on the line getDouble("foo")  ... 
Something inside FieldTable is failing on ppc64. Does anyone know where 
the bug might be? Could qpid be decoding to the wrong endianess on ppc?

Thanks,
Aamir



**********************************************************************************
This communication (and any attachments) is directed in confidence to the addressee(s) listed
above, and may not otherwise be distributed, copied or used.  The contents of this communication
may also be subject to privilege, and all rights to that privilege are expressly claimed and
not waived.  If you have received this communication in error, please notify us by reply e-mail
or by telephone and delete this communication (and any attachments) without making a copy.
 Thank you.

***************
La présente communication (et tout fichier rattaché) s'adresse uniquement au(x) destinataire(s)
précité(s) et ne peut être autrement distribuée, copiée ou utilisée.  Le contenu de
cette communication peut être assujetti au privilège.  Tout droit à ce privilège est expressément
revendiqué et nullement abandonné.  Si vous avez reçu cette communication par erreur, veuillez
nous en avertir immédiatement en répondant à ce courriel ou en nous appelant.  Veuillez
également effacer cette communication (et tout fichier rattaché) sans en conserver une copie.
 Merci.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message