[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[LTP] New stat() test cases, please comment
Back in September we stumbled over the EFAULT/SIGSEGV dilemma that glibc
produced. The short story is that the kernel returns EFAULT if it gets
a bad pointer, but glibc will send SIGSEGV if it gets a bad pointer
while doing syscall related work. I think I may have found a workaround
that will at least help testing.
Signal handlers for SIGSEGV can't return to the code gracefully. They
can however force their way back with a longjmp(). I add a new signal
handler before the expected segfault and call setjmp(). The signal
handler will catch SIGSEGV and throw us back to the setjmp() point where
we kindly follow the other path and report the error.
I've added code to do this to the new test program stat06. Please take
a look at it and tell me if this is an acceptable hack. I've created a
new tarball that includes the new test case.
Nate Straz email@example.com
sgi, inc http://www.sgi.com/
Linux Test Project http://oss.sgi.com/projects/ltp/