|
From: <sv...@va...> - 2012-10-21 18:46:17
|
philippe 2012-10-21 19:46:09 +0100 (Sun, 21 Oct 2012)
New Revision: 13073
Log:
Introduce a test to reproduce bug 123837 (semctl GETVAL false positive)
The test succeeds on amd64, but fails on x86, with the following diff:
+Syscall param semctl(arg) points to uninitialised byte(s)
+ at 0x........: semctl@@GLIBC_2.2 (semctl.c:109)
+ by 0x........: main (sem.c:36)
+ Address 0x........ is on thread 1's stack
+
+Syscall param semctl(arg) points to uninitialised byte(s)
+ at 0x........: semctl@@GLIBC_2.2 (semctl.c:109)
+ by 0x........: main (sem.c:43)
+ Address 0x........ is on thread 1's stack
+
Added files:
trunk/memcheck/tests/sem.stderr.exp
trunk/memcheck/tests/sem.vgtest
Modified files:
trunk/memcheck/tests/Makefile.am
trunk/none/tests/sem.c
Modified: trunk/memcheck/tests/Makefile.am (+1 -0)
===================================================================
--- trunk/memcheck/tests/Makefile.am 2012-10-21 15:37:14 +01:00 (rev 13072)
+++ trunk/memcheck/tests/Makefile.am 2012-10-21 19:46:09 +01:00 (rev 13073)
@@ -180,6 +180,7 @@
realloc2.stderr.exp realloc2.vgtest \
realloc3.stderr.exp realloc3.vgtest \
sbfragment.stdout.exp sbfragment.stderr.exp sbfragment.vgtest \
+ sem.stderr.exp sem.vgtest \
sh-mem.stderr.exp sh-mem.vgtest \
sh-mem-random.stderr.exp sh-mem-random.stdout.exp64 \
sh-mem-random.stdout.exp sh-mem-random.vgtest \
Added: trunk/memcheck/tests/sem.vgtest (+1 -0)
===================================================================
--- trunk/memcheck/tests/sem.vgtest 2012-10-21 15:37:14 +01:00 (rev 13072)
+++ trunk/memcheck/tests/sem.vgtest 2012-10-21 19:46:09 +01:00 (rev 13073)
@@ -0,0 +1 @@
+prog: ../../none/tests/sem
Modified: trunk/none/tests/sem.c (+15 -0)
===================================================================
--- trunk/none/tests/sem.c 2012-10-21 15:37:14 +01:00 (rev 13072)
+++ trunk/none/tests/sem.c 2012-10-21 19:46:09 +01:00 (rev 13073)
@@ -7,6 +7,7 @@
#include <sys/ipc.h>
#include <sys/sem.h>
#include <time.h>
+#include <unistd.h>
int main(int argc, char **argv)
{
int semid;
@@ -32,6 +33,20 @@
exit(1);
}
+ if (semctl(semid, 0, GETVAL) != 1)
+ {
+ perror("semctl GETVAL");
+ semctl(semid, 0, IPC_RMID);
+ exit(1);
+ }
+
+ if (semctl(semid, 0, GETPID) != getpid())
+ {
+ perror("semctl GETPID");
+ semctl(semid, 0, IPC_RMID);
+ exit(1);
+ }
+
/* The next call to semtimedop causes the program to hang on
ppc32-linux (Yellow Dog 4.0). I don't know why. Hence the
extended ifdef. */
Added: trunk/memcheck/tests/sem.stderr.exp (+10 -0)
===================================================================
--- trunk/memcheck/tests/sem.stderr.exp 2012-10-21 15:37:14 +01:00 (rev 13072)
+++ trunk/memcheck/tests/sem.stderr.exp 2012-10-21 19:46:09 +01:00 (rev 13073)
@@ -0,0 +1,10 @@
+
+
+HEAP SUMMARY:
+ in use at exit: 0 bytes in 0 blocks
+ total heap usage: 0 allocs, 0 frees, 0 bytes allocated
+
+For a detailed leak analysis, rerun with: --leak-check=full
+
+For counts of detected and suppressed errors, rerun with: -v
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
|