number itself is undefined.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2950
realloc1
realloc2
realloc3
+scalar
sigaltstack
signal2
+str_tester
supp1
supp2
suppfree
#include <stdlib.h>
#include <unistd.h>
+#include <sys/syscall.h>
int main(void)
{
// uninitialised, but we know pc[0] points to 0x0
char** pc = malloc(sizeof(char*));
- // Four errors: each of the scalar args are undefined, plus the 2nd arg
- // points to unaddressable memory.
- write(pi[0], pc[0], pi[0]+1);
+ // Five errors:
+ // - the syscall number itself is undefined (but we know it's
+ // 0 + __NR_write :)
+ // - each of the scalar args are undefined
+ // - the 2nd arg points to unaddressable memory.
+ syscall(pi[0]+__NR_write, pi[0], pc[0], pi[0]+1);
return 0;
}
+Syscall param (syscallno) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
Syscall param write(fd) contains uninitialised byte(s)
- at 0x........: write (in /...libc...)
+ at 0x........: syscall (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Syscall param write(buf) contains uninitialised byte(s)
- at 0x........: write (in /...libc...)
+ at 0x........: syscall (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Syscall param write(count) contains uninitialised byte(s)
- at 0x........: write (in /...libc...)
+ at 0x........: syscall (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Syscall param write(buf) points to unaddressable byte(s)
- at 0x........: write (in /...libc...)
+ at 0x........: syscall (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
foo2
Memcheck:Param
write(buf)
- fun:__write_nocancel
+ fun:syscall
fun:__libc_start_main
}
+Syscall param (syscallno) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
Syscall param write(fd) contains uninitialised byte(s)
- at 0x........: write (in /...libc...)
+ at 0x........: syscall (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Syscall param write(count) contains uninitialised byte(s)
- at 0x........: write (in /...libc...)
+ at 0x........: syscall (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...