Bug 131186

Summary: writev reports error in (vector[...])
Product: [Developer tools] valgrind Reporter: Magnus Fromreide <valgrind>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: wishlist CC: pjfloyd
Priority: NOR    
Version First Reported In: 3.2.0   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Print the index of the faulty io_vec entry for writev

Description Magnus Fromreide 2006-07-21 22:01:27 UTC
I have a buggy program that calls writev with an io_vec that points to
some uninitialized memory.

Valgrind happily reports that as:

Syscall param writev(vector[...]) points to uninitialised byte(s)

But I think it would be helpful if it told witch io_vec element it is that is faulty
Comment 1 Magnus Fromreide 2006-07-21 22:06:47 UTC
Created attachment 17060 [details]
Print the index of the faulty io_vec entry for writev

With the attached patch the printout becomes:

Syscall param writev(vector[2]) points to uninitialised byte(s)

The drawback is that it increases the run cost significantly.
Another enhancement vould be to fix readv, sendmsg and recvmsg as well.
Comment 2 Paul Floyd 2022-10-12 08:24:14 UTC
I don't see why this should cause much of a slowdown.

commit 2dde5c405b020c96c0595222045475d195939a2b (HEAD -> master, origin/master, origin/HEAD)
Author: Paul Floyd <pjfloyd@wanadoo.fr>
Date:   Wed Oct 12 08:34:51 2022 +0200

    Bug 131186 - writev reports error in (vector[...])
    
    Use the index rather than ...
    Also done for readv.