NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/57624: bpfjit failure when running sparc userland on sparc64



>Number:         57624
>Category:       kern
>Synopsis:       bpfjit failure when running sparc userland on sparc64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 21 10:05:00 +0000 2023
>Originator:     Martin Husemann
>Release:        NetBSD 10.99.8
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD nelly.aprisoft.de 10.99.8 NetBSD 10.99.8 (NELLY) #61: Tue Sep 19 11:12:43 CEST 2023 martin%seven-days-to-the-wolves.aprisoft.de@localhost:/work/src/sys/arch/sparc64/compile/NELLY sparc
Architecture: sparc
Machine: sparc
>Description:

Trying to run the bpfjit tests with sparc (32bit) userland on a sparc64
kernel causes a few failures like this:

> cd /usr/tests/net/bpfjit
> gdb ./t_bpfjit
GNU gdb (GDB) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "sparc--netbsdelf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./t_bpfjit...
Reading symbols from /usr/libdata/debug//usr/tests/net/bpfjit/t_bpfjit.debug...
(gdb) break rumpuser_anonmmap
Function "rumpuser_anonmmap" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (rumpuser_anonmmap) pending.
(gdb) run bpfjit_abc_ja
Starting program: /usr/tests/net/bpfjit/t_bpfjit bpfjit_abc_ja
t_bpfjit: WARNING: Running test cases without atf-run(1) is unsupported
t_bpfjit: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4)
[   1.0000000] entropy: ready
[New LWP 577 of process 1919]
[New LWP 587 of process 1919]
[New LWP 1259 of process 1919]
[New LWP 1725 of process 1919]
[New LWP 1388 of process 1919]
[New LWP 624 of process 1919]
[New LWP 1841 of process 1919]
[New LWP 1842 of process 1919]
[New LWP 1459 of process 1919]
[New LWP 1140 of process 1919]
[New LWP 949 of process 1919]
[New LWP 1782 of process 1919]
[New LWP 1336 of process 1919]
[New LWP 1918 of process 1919]
[New LWP 430 of process 1919]
[New LWP 1718 of process 1919]
[New LWP 1267 of process 1919]
[New LWP 1244 of process 1919]
[New LWP 591 of process 1919]
[New LWP 582 of process 1919]
[New LWP 1017 of process 1919]
[New LWP 586 of process 1919]

Thread 1 "" hit Breakpoint 1, rumpuser_anonmmap (prefaddr=0x0, size=65536, 
    alignbit=12, exec=32, memp=0xffffd494)
    at /work/src/lib/librumpuser/rumpuser_mem.c:79
79      /work/src/lib/librumpuser/rumpuser_mem.c: No such file or directory.
(gdb) bt
#0  rumpuser_anonmmap (prefaddr=0x0, size=65536, alignbit=12, exec=32, 
    memp=0xffffd494) at /work/src/lib/librumpuser/rumpuser_mem.c:79
#1  0x203ac3a8 in uvm_km_alloc (map=0x2040b000 <module_map_store>, size=65536, 
    align=4096, flags=49)
    at /work/src/lib/librump/../../sys/rump/librump/rumpkern/vm.c:880
#2  0x200a3560 in alloc_chunk (size=65536)
    at /work/src/sys/rump/kern/lib/libsljit/../../../../external/bsd/sljit/dist/sljit_src/sljitExecAllocator.c:110
#3  sljit_malloc_exec (size=320)
    at /work/src/sys/rump/kern/lib/libsljit/../../../../external/bsd/sljit/dist/sljit_src/sljitExecAllocator.c:232
#4  0x200a3e8c in sljit_generate_code (compiler=0x2047cd08)
    at /work/src/sys/rump/kern/lib/libsljit/../../../../external/bsd/sljit/dist/sljit_src/sljitNativeSPARC_common.c:298
#5  0x20081d74 in bpfjit_generate_code (bc=<optimized out>, 
    insns=<optimized out>, insn_count=<optimized out>)
    at /work/src/sys/rump/net/lib/libbpfjit/../../../../net/bpfjit.c:2293
#6  0x000195c8 in atfu_bpfjit_abc_ja_body (tc=0x3bc10 <atfu_bpfjit_abc_ja_tc>)
    at /work/src/tests/net/bpfjit/t_bpfjit.c:3988
#7  0x2048954c in atf_tc_run (tc=0x3bc10 <atfu_bpfjit_abc_ja_tc>, 
    resfile=0x20096020 "/dev/stdout")
    at /work/src/external/bsd/atf/dist/atf-c/tc.c:1024
#8  0x20485910 in run_tc (exitcode=<synthetic pointer>, p=0xffffd788, 
    tp=0xffffd77c)
    at /work/src/external/bsd/atf/dist/atf-c/detail/tp_main.c:510
#9  controlled_main (exitcode=<synthetic pointer>, 
    add_tcs_hook=0x12f2c <atfu_tp_add_tcs>, argv=<optimized out>, 
    argc=<optimized out>)
    at /work/src/external/bsd/atf/dist/atf-c/detail/tp_main.c:580
#10 atf_tp_main (argc=<optimized out>, argv=<optimized out>, 
    add_tcs_hook=0x12f2c <atfu_tp_add_tcs>)
    at /work/src/external/bsd/atf/dist/atf-c/detail/tp_main.c:610
#11 0x00010b7c in ___start ()
#12 0x000108c0 in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) c
Continuing.
[   1.0500050] panic: uvm_km_alloc failed
[   1.0500050] rump kernel halting...
halted

Thread 1 "" received signal SIGABRT, Aborted.
abort () at /work/src/lib/libc/stdlib/abort.c:80
80      /work/src/lib/libc/stdlib/abort.c: No such file or directory.
(gdb) bt
#0  abort () at /work/src/lib/libc/stdlib/abort.c:80
#1  0x20427cec in rumpuser_exit (rv=-1)
    at /work/src/lib/librumpuser/rumpuser.c:236
#2  0x203b3a10 in cpu_reboot (howto=4, bootstr=0x0)
    at /work/src/lib/librump/../../sys/rump/librump/rumpkern/emul.c:444
#3  0x20352138 in kern_reboot (howto=4, bootstr=0x0)
    at /work/src/lib/librump/../../sys/rump/../kern/kern_reboot.c:73
#4  0x20351390 in vpanic (fmt=0x203cbc88 "uvm_km_alloc failed", ap=0xffffd478)
    at /work/src/lib/librump/../../sys/rump/../kern/subr_prf.c:288
#5  0x2035146c in panic (fmt=0x203cbc88 "uvm_km_alloc failed")
    at /work/src/lib/librump/../../sys/rump/../kern/subr_prf.c:209
#6  0x203ac3c0 in uvm_km_alloc (map=<optimized out>, size=65536, align=4096, 
    flags=49) at /work/src/lib/librump/../../sys/rump/librump/rumpkern/vm.c:890
#7  0x200a3560 in alloc_chunk (size=65536)
    at /work/src/sys/rump/kern/lib/libsljit/../../../../external/bsd/sljit/dist/sljit_src/sljitExecAllocator.c:110
#8  sljit_malloc_exec (size=320)
    at /work/src/sys/rump/kern/lib/libsljit/../../../../external/bsd/sljit/dist/sljit_src/sljitExecAllocator.c:232
#9  0x200a3e8c in sljit_generate_code (compiler=0x2047cd08)
    at /work/src/sys/rump/kern/lib/libsljit/../../../../external/bsd/sljit/dist/sljit_src/sljitNativeSPARC_common.c:298
#10 0x20081d74 in bpfjit_generate_code (bc=<optimized out>, 
    insns=<optimized out>, insn_count=<optimized out>)
    at /work/src/sys/rump/net/lib/libbpfjit/../../../../net/bpfjit.c:2293
#11 0x000195c8 in atfu_bpfjit_abc_ja_body (tc=0x3bc10 <atfu_bpfjit_abc_ja_tc>)
    at /work/src/tests/net/bpfjit/t_bpfjit.c:3988
#12 0x2048954c in atf_tc_run (tc=0x3bc10 <atfu_bpfjit_abc_ja_tc>, 
    resfile=0x20096020 "/dev/stdout")
    at /work/src/external/bsd/atf/dist/atf-c/tc.c:1024
#13 0x20485910 in run_tc (exitcode=<synthetic pointer>, p=0xffffd788, 
    tp=0xffffd77c)
    at /work/src/external/bsd/atf/dist/atf-c/detail/tp_main.c:510
#14 controlled_main (exitcode=<synthetic pointer>, 
    add_tcs_hook=0x12f2c <atfu_tp_add_tcs>, argv=<optimized out>, 
    argc=<optimized out>)
    at /work/src/external/bsd/atf/dist/atf-c/detail/tp_main.c:580
#15 atf_tp_main (argc=<optimized out>, argv=<optimized out>, 
    add_tcs_hook=0x12f2c <atfu_tp_add_tcs>)
    at /work/src/external/bsd/atf/dist/atf-c/detail/tp_main.c:610
#16 0x00010b7c in ___start ()
#17 0x000108c0 in _start ()


The same test passes on sparc userland running under a sparc (32bit) kernel:

$ cd /usr/tests/net/bpfjit         
$ ./t_bpfjit bpfjit_abc_ja
t_bpfjit: WARNING: Running test cases without atf-run(1) is unsupported
t_bpfjit: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4)
[   1.0000000] entropy: ready
passed

The call to rumpuser_anonmmap() gets the same arguments there (so it is not
fallout from the different page size):

Thread 1 "" hit Breakpoint 1, 0xeddb3e58 in rumpuser_anonmmap ()
   from /usr/lib/librumpuser.so.0
(gdb) info reg
[..]
i0             0x0                 0
i1             0x10000             65536
i2             0xc                 12
i3             0x20                32
i4             0xeffff4d4          -268438316


Something wrong with netbsd32_mmap?

>How-To-Repeat:
s/a

>Fix:
n/a



Home | Main Index | Thread Index | Old Index