|
From: | Eric Noulard |
Subject: | Re: [certi-dev] Memory issues |
Date: | Sat, 29 Aug 2015 15:48:00 +0200 |
Ok, I found the bug.
It was obvious, but it seems I'm rustier in C++ than I though.
In OwnershipManagement::attributeOwnedByFederate in files RTIA/OwnershipManagement.cc, the return type is const char*
The address returned belongs to rep->label. rep is auto_ptr, thus when leaving the function rep goes out of scope and so does label
and the address is no longer valid ....
I fixed by simply returning a std::string, I'll create a git commit and push it on my github soon.
David.
rep
did you test whether if the message was Tagged in the first place before trying
to consult the tag?
see rep.isTagged()
may be BasicMessage class should be fixed in order to initialize strings member
(e.g. tag and wtag in your case) to default values in the default protected constructor.
I can reproduce the bug, I'll try to figure it tomorrow.
I'm not sure if that issue is linked to the strict aliasing rule
I doubt it, but who knows... :-)
Thank you very much for hunting those bugs.
--
CERTI-Devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/certi-devel
--
Eric
--
CERTI-Devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/certi-devel
[Prev in Thread] | Current Thread | [Next in Thread] |