Bug 131186 - writev reports error in (vector[...])
Summary: writev reports error in (vector[...])
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.2.0
Platform: Debian testing Linux
: NOR wishlist
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-21 22:01 UTC by Magnus Fromreide
Modified: 2022-10-12 08:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Print the index of the faulty io_vec entry for writev (719 bytes, patch)
2006-07-21 22:06 UTC, Magnus Fromreide
Details

Note You need to log in before you can comment on or make changes to this bug.
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.