<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>415621</bug_id>
          
          <creation_ts>2019-12-27 20:03:33 +0000</creation_ts>
          <short_desc>epoll_ctl reports for uninitialized padding</short_desc>
          <delta_ts>2020-07-05 21:45:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Developer tools</classification>
          <product>valgrind</product>
          <component>memcheck</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>422623</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Simon Richter">Simon.Richter</reporter>
          <assigned_to name="Julian Seward">jseward</assigned_to>
          <cc>mark</cc>
    
    <cc>zbyszek</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1898915</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Richter">Simon.Richter</who>
    <bug_when>2019-12-27 20:03:33 +0000</bug_when>
    <thetext>SUMMARY

On platforms where the epoll_event struct is padded (&gt;= 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 &lt;sys/epoll.h&gt;
int main(int, char **)
{
    epoll_event evt;
    evt.events = 0;
    evt.data.ptr = nullptr;
    epoll_ctl(0, EPOLL_CTL_ADD, 0, &amp;evt);
}

OBSERVED RESULT

The padding is reported as uninitialized.

EXPECTED RESULT

No error, or an indication that this is mostly harmless.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1899099</commentid>
    <comment_count>1</comment_count>
    <who name="Julian Seward">jseward</who>
    <bug_when>2019-12-28 19:27:28 +0000</bug_when>
    <thetext>Do you have a syscall wrapper patch that fixes this, by any chance?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1899108</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Richter">Simon.Richter</who>
    <bug_when>2019-12-28 19:44:21 +0000</bug_when>
    <thetext>Not yet, I&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1941966</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Wielaard">mark</who>
    <bug_when>2020-07-05 21:45:08 +0000</bug_when>
    <thetext>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 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>