]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Hopefully deal with system 252 (__NR_exit_group) correctly.
authorJulian Seward <jseward@acm.org>
Sun, 23 Feb 2003 03:26:08 +0000 (03:26 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 23 Feb 2003 03:26:08 +0000 (03:26 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1427

coregrind/vg_scheduler.c
coregrind/vg_syscalls.c

index 3f047cfa7b81f329201b8d90cdafc6d9117afa58..cd0d5e50242d0a010fe0a628dbd83ea7ab284edb 100644 (file)
@@ -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
index 332b570ed8560e1f647c2ee3b8e5a153d261d6d0..a3ff26b5f98390bbf23c8a897f94d79ff47616ac 100644 (file)
@@ -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;