https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213778

            Bug ID: 213778
           Summary: stable/11 -r307797 on BPi-M3 (cortex-a7): truss gets
                    segmentation fault for handling SIGSYS
           Product: Base System
           Version: 11.0-STABLE
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: mar...@dsl-only.net

In trying to build lang/gcc6 xgcc's cc1 got some SIGSYS examples. In trying to
track things down I ran into truss getting a SIGSEGV when it tries to handle
the situation. . .

In truss's enter_syscall there is (from a live gdb on truss, after the
segmentation fault):

380             t->cs.name = sysdecode_syscallname(t->proc->abi->abi,
t->cs.number);
381             if (t->cs.name == NULL)
(gdb) 
382                     fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n",
383                         t->proc->abi->type, t->cs.number);
384     
385             sc = get_syscall(t->cs.name, narg);
386             t->cs.nargs = sc->nargs;
387             assert(sc->nargs <= nitems(t->cs.s_args));
388     
389             t->cs.sc = sc;

(gdb) print *t
$2 = {entries = {le_next = 0x0, le_prev = 0x20617070}, proc = 0x20617060, tid =
100150, in_syscall = 1, cs = {sc = 0x0, name = 0x0, number = 580828064, args =
0x2061b0c0, nargs = 0, 
    s_args = 0x2061b0ec}, before = {tv_sec = 1477418265, tv_nsec = 492342263},
after = {tv_sec = 1477418265, tv_nsec = 492496630}}

(gdb) print sc
$3 = (struct syscall *) 0x0

So line 386 listed above gets a segmentation fault for sc->nargs when
t->cs.name is a NULL pointer: sc ends up NULL.

Looking at the two things that the fprintf on lines 382 and 383 would report:

(gdb) print t->proc->abi->type
$4 = 0x10166 "FreeBSD ELF32"

(gdb) print t->cs.number
$5 = 580828064

(gdb) print narg
$6 = 0

(that last is for context for the get_syscall arguments).

FYI: 580828064 = 0x229EBBA0


Context:

root@bananapi-m3:/usr/ports # uname -apKU
FreeBSD bananapi-m3 11.0-STABLE FreeBSD 11.0-STABLE #0 r307797M: Mon Oct 24
00:41:16 PDT 2016    
markmi@FreeBSDx64:/usr/local/src/crochet/work/obj/arm.armv6/usr/src/sys/ALLWINNER
 arm armv6 1100505 1100505

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to