Bug 1151416
| Summary: | qpid exception text truncated if it would contain \x00 character | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | Pavel Moravec <pmoravec> | ||||
| Component: | qpid-cpp | Assignee: | Andrew Stitcher <astitcher> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | Messaging QE <messaging-qe-bugs> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 3.0 | CC: | iboverma, jross, mcressma | ||||
| Target Milestone: | --- | Keywords: | Reproducer | ||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2020-05-22 14:35:13 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Pavel Moravec
2014-10-10 11:06:11 UTC
Created attachment 945553 [details]
Reproducer script
Note it requires bitstring python library to work (see bz description for details).
*** IMPORTANT ***
for successfull reproducer, one has to add:
dtx-max-timeout=600
to broker options.
For developers:
The key problem is that calling Exception::what() returns const char* that truncates the string at the first occurence of \x00 character.
Possible fix has to rewrite what() function to either return std::string (if possible) or return char* object with \x00 chars replaced by "\x00" string everytime (maybe worth for any human unreadable char).
Some "workaround fix" is to replace e.what() by e.getMessage() like:
Index: src/qpid/amqp_0_10/SessionHandler.cpp
===================================================================
--- src/qpid/amqp_0_10/SessionHandler.cpp (revision 1628417)
+++ src/qpid/amqp_0_10/SessionHandler.cpp (working copy)
@@ -94,12 +94,12 @@
}
}
catch(const SessionException& e) {
- executionException(e.code, e.what());
+ executionException(e.code, /*e.what()*/ e.getMessage());
framing::AMQP_AllProxy::Execution execution(channel);
AMQMethodBody* m = f.getMethod();
SequenceNumber commandId;
if (getState()) commandId = getState()->receiverGetCurrent();
- execution.exception(e.code, commandId, m ? m->amqpClassId() : 0, m ? m->amqpMethodId() : 0, 0, e.what(), FieldTable());
+ execution.exception(e.code, commandId, m ? m->amqpClassId() : 0, m ? m->amqpMethodId() : 0, 0, /*e.what()*/ e.getMessage(), FieldTable());
detaching();
sendDetach();
}
but this leaves one log instance:
2014-10-14 10:26:51 [Broker] error Execution exception: invalid-argument: xid {Xid: format=1279348295; global-id=test
truncated (as classes derived from Exception like SessionException does not know getMessage mehtod, see cpp/src/qpid/broker/SessionHandler.cpp:46).
Anyway, here at least the client get the whole string from the broker, just one log record is truncated.
|