> The correct fix for this problem is to set "--partial-loads-ok=yes".

Perhaps not for all purposes.   The original traceback for _this_ case:

    ==21946== Invalid read of size 8
    ==21946==    at 0x4ECA554: __stpncpy_sse2_unaligned 
(strcpy-sse2-unaligned.S:297)

implicates hand-written assembly-language code (note the filename ending in 
".S")
for a closed subroutine (stpncpy) which shares many of the properties of strcpy
and strncpy.

memcheck implements intercepting re-directs for both strcpy and strncpy.
The re-directs remove the possibility of any false positive complaints,
and also are significantly faster than emulating instructions.
Therefore, I suggest that the best fix for _this_ case is for memcheck
to implement a re-direct for stpncpy.

>   Except that doesn't work because "--partial-loads-ok=yes" does not support 
> 16-bit loads (SSE operations).
> 
> I would suggest (a) verify that "--partial-loads-ok=yes" does not fix your 
> problem; (b) attach your test case as an additional example on bug 294285; 
> (c) add your vote to bug 294285.  (But then again, I am biased because it is 
> my own report.)
> 
> The smarter the compiler, the more likely it is to emit code like this.

The code which triggered _this_ complaint from memcheck
was not generated by a compiler program.  Although "--partial-loads-ok=yes"
might remove the false positive complaint, it would also tend to hide the
performance problem with the emulation of stpncpy.

-- 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to