]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Fix crash if a process sends itself a SIGTRAP. Just forward it as expected.
authorbdrewery <bdrewery@FreeBSD.org>
Mon, 5 Oct 2015 21:39:07 +0000 (21:39 +0000)
committerbdrewery <bdrewery@FreeBSD.org>
Mon, 5 Oct 2015 21:39:07 +0000 (21:39 +0000)
MFC after: 2 weeks [needs rewrite]
Relnotes: yes

usr.bin/truss/setup.c

index 74008e40258256a348b58eedb12324943c42c39b..74678e6ac2df7522b04fb367bbe3f1ceaa7137d1 100644 (file)
@@ -564,15 +564,12 @@ eventloop(struct trussinfo *info)
                        }
                        find_thread(info, si.si_pid, pl.pl_lwpid);
 
-                       if (si.si_status == SIGTRAP) {
+                       if (si.si_status == SIGTRAP &&
+                           (pl.pl_flags & (PL_FLAG_SCE|PL_FLAG_SCX)) != 0) {
                                if (pl.pl_flags & PL_FLAG_SCE)
                                        enter_syscall(info, &pl);
                                else if (pl.pl_flags & PL_FLAG_SCX)
                                        exit_syscall(info, &pl);
-                               else
-                                       errx(1,
-                  "pl_flags %x contains neither PL_FLAG_SCE nor PL_FLAG_SCX",
-                                           pl.pl_flags);
                                pending_signal = 0;
                        } else if (pl.pl_flags & PL_FLAG_CHILD) {
                                if ((info->flags & COUNTONLY) == 0)