Bug 109426 - ppc: false positive in rt_sigaction
Summary: ppc: false positive in rt_sigaction
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-21 18:35 UTC by Craig Chaney
Modified: 2016-09-14 17:26 UTC (History)
2 users (show)

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


Attachments
sys_rt_sigaction patch (adopted from Paul's 2.4 ppc port) (12.41 KB, patch)
2005-07-21 18:39 UTC, Craig Chaney
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Chaney 2005-07-21 18:35:47 UTC
On ppc, Valgrind reports spurious errors in rt_sigaction.  For example:

$ valgrind /bin/ls
==12019== Memcheck, a memory error detector.
==12019== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
<snip>
==12019== Syscall param rt_sigaction(act) points to uninitialised byte(s)
==12019==    at 0x11A87D7C: __libc_sigaction (in /lib/tls/libpthread.so.0)
==12019==    by 0x11A7E940: __pthread_initialize_minimal (in
/lib/tls/libpthread.so.0)
==12019==    by 0x11A7E72C: (within /lib/tls/libpthread.so.0)
==12019==    by 0x1187BEE4: call_init (in /lib/ld-2.3.3.so)
==12019==    by 0x1187C018: _dl_init (in /lib/ld-2.3.3.so)
==12019==    by 0x118804B4: _start (in /lib/ld-2.3.3.so)
==12019==  Address 0x349FDD58 is on thread 1's stack
<snip>

The ppc implementation of sigaction doesn't ever read or write to the
sa_restorer field, so Valgrind is flagging it as an error.  See below for a
patch adopted from Paul's 2.4 port.
Comment 1 Craig Chaney 2005-07-21 18:39:14 UTC
Created attachment 11868 [details]
sys_rt_sigaction patch (adopted from Paul's 2.4 ppc port)

This patch makes the PRE & POST functions for sys_rt_sigaction platform
specific, so they are removed from syswrap-generic.c and added to the amd64,
ppc, and x86 version.  The ppc version is modified so that bogus values in the
sa_restorer fields in the parameters are not flagged as errors.

The patch also adds PRE and POST functions for sys_sigaction on ppc, and avoids
flagging bogus sa_restorer values there as well.

Tested on ppc and x86.