From: Julian Seward Date: Sun, 23 Feb 2003 03:26:08 +0000 (+0000) Subject: Hopefully deal with system 252 (__NR_exit_group) correctly. X-Git-Tag: svn/VALGRIND_1_9_4~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9065d62ecc27f71023cdeca37b13b149c0bc17e2;p=thirdparty%2Fvalgrind.git Hopefully deal with system 252 (__NR_exit_group) correctly. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1427 --- diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c index 3f047cfa7b..cd0d5e5024 100644 --- a/coregrind/vg_scheduler.c +++ b/coregrind/vg_scheduler.c @@ -1433,7 +1433,11 @@ VgSchedReturnCode VG_(scheduler) ( void ) __libc_freeres does some invalid frees which crash the unprotected malloc/free system. */ - if (VG_(threads)[tid].m_eax == __NR_exit) { + if (VG_(threads)[tid].m_eax == __NR_exit +# if defined(__NR_exit_group) + || VG_(threads)[tid].m_eax == __NR_exit_group +# endif + ) { /* If __NR_exit, remember the supplied argument. */ VG_(exitcode) = VG_(threads)[tid].m_ebx; /* syscall arg1 */ @@ -1467,7 +1471,14 @@ VgSchedReturnCode VG_(scheduler) ( void ) } /* We've dealt with __NR_exit at this point. */ - vg_assert(VG_(threads)[tid].m_eax != __NR_exit); + { Bool b + = VG_(threads)[tid].m_eax != __NR_exit +# if defined(__NR_exit_group) + && VG_(threads)[tid].m_eax != __NR_exit_group +# endif + ; + vg_assert(b); + } /* Trap syscalls to __NR_sched_yield and just have this thread yield instead. Not essential, just an diff --git a/coregrind/vg_syscalls.c b/coregrind/vg_syscalls.c index 332b570ed8..a3ff26b5f9 100644 --- a/coregrind/vg_syscalls.c +++ b/coregrind/vg_syscalls.c @@ -462,6 +462,12 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid ) switch (syscallno) { +# if defined(__NR_exit_group) + case __NR_exit_group: + VG_(core_panic)("syscall exit_group() not caught by the scheduler?!"); + break; +# endif + case __NR_exit: VG_(core_panic)("syscall exit() not caught by the scheduler?!"); break;