From: Nicholas N. <nj...@ca...> - 2003-04-29 18:41:13
|
On Tue, 29 Apr 2003, John Reiser wrote: > Where are the arguments to a system call checked for having defined values? > For instance, open() can take 3 arguments, yet case __NR_open in > coregrind/vg_syscalls.c does no checking regarding arg3. See testcase below. > > If trailing arguments to mmap2() [and/or other syscalls that take many] > are omitted, then shouldn't valgrind complain? It's not just open() and mmap2(). All direct system call args (integers, pointers, etc) aren't checked. Only blocks of memory pointed to by pointer arguments are checked. So Valgrind won't catch any undefined integer arguments to any system calls. I guess Julian did it this way because these kinds of errors will (presumably) be pretty uncommon compared to undefined blocks of memory -- you'd need an undefined stack variable or argument, and gcc -O picks up possibly undefined stack vars -- and it would be a pain to add all the extra checking. Maybe it should be there, but in practice I think these are pretty uncommon cases. Correct me if I'm wrong... N |