On 03/02/11 08:47, Baurzhan Ismagulov wrote:
> On Wed, Feb 02, 2011 at 05:55:30PM -0800, Steve Singh wrote:
>> ==28571== Syscall param msgsnd(msgp->mtext) points to uninitialised byte(s)
> ...
>> typedef _f_msg {
>> long mtype;
>> unsigned int quit_type;
>> char *quit_msg;
>> int prolong;
>> unsigned long prolong_count;
>> unsigned short prolong_type;
>> } f_msg;
>>
>> In my function, I definitely initialize every value in the structure (both
>> by clearing with memset and also individually), but I still get this
>> message.
>
> Assuming that msgp is f_msg *, I fail to see mtext in f_msg. Is it the
> right struct?
No, he is passing that struct as mtext.
The problem is that the struct has padding, which he won't be initialising.
That's not generally a major problem, so long as the machine receiving
the message is expecting padding in the same place, but as valgrind
knows nothing about his application's message structure it can't tell
that the uninitialised bytes are just structure padding.
It may also be a security issue because you don't know what information
may be in those padding bytes which are then transferred from the
message sender to the message receiver.
Tom
--
Tom Hughes ([email protected])
http://compton.nu/
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users