Bug 415621 - epoll_ctl reports for uninitialized padding
Summary: epoll_ctl reports for uninitialized padding
Status: RESOLVED DUPLICATE of bug 422623
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-27 20:03 UTC by Simon Richter
Modified: 2020-07-05 21:45 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Richter 2019-12-27 20:03:33 UTC
SUMMARY

On platforms where the epoll_event struct is padded (>= 64 bit architectures except amd64), the padding is reported uninitialized unless the program explicitly uses memset.

STEPS TO REPRODUCE
1. On powerpc64, compile and run

#include <sys/epoll.h>
int main(int, char **)
{
    epoll_event evt;
    evt.events = 0;
    evt.data.ptr = nullptr;
    epoll_ctl(0, EPOLL_CTL_ADD, 0, &evt);
}

OBSERVED RESULT

The padding is reported as uninitialized.

EXPECTED RESULT

No error, or an indication that this is mostly harmless.
Comment 1 Julian Seward 2019-12-28 19:27:28 UTC
Do you have a syscall wrapper patch that fixes this, by any chance?
Comment 2 Simon Richter 2019-12-28 19:44:21 UTC
Not yet, I'd need guidance on what would be the desired behaviour for uninitialized padding in the middle of a struct (which is harmless but might leak data if it is blindly copied around).

Is there a flag for hiding these warnings, or a separate reporting level?
Comment 3 Mark Wielaard 2020-07-05 21:45:08 UTC
I filed a similar bug which has a bit more information and a potential patch, marking this as a duplicate (sorry I missed it earlier).

*** This bug has been marked as a duplicate of bug 422623 ***