mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
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 + git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13073
This commit is contained in:
parent
0df0a2725c
commit
979dc8596b
@ -180,6 +180,7 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
|
||||
10
memcheck/tests/sem.stderr.exp
Normal file
10
memcheck/tests/sem.stderr.exp
Normal file
@ -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)
|
||||
1
memcheck/tests/sem.vgtest
Normal file
1
memcheck/tests/sem.vgtest
Normal file
@ -0,0 +1 @@
|
||||
prog: ../../none/tests/sem
|
||||
@ -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 @@ int main(int argc, char **argv)
|
||||
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. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user