When trying to run the Linux 8th binary (from https://8th-dev.com/) on FreeBSD I encountered: panic: proc_init: emuldata not found in exec case. cpuid = 3 time = 1507221404 KDB: stack backtrace: ... kassert_panic() linux_proc_exec() at linux_proc_exec+0x15a exec_new_vmspace() exec_elf64_imgact() kern_execve() sys_execve() amd64_syscall() Xfast_syscall() --- syscall (59, Linux ELF64, linux_execve), ...
When trying to run static docker binary (from https://download.docker.com/mac/static/stable/x86_64/docker-17.09.0-ce.tgz) on FreeBSD 12.0 CURRENT, I encountered: cpuid = 2 time = 1507320053 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe022d8eb310 vpanic() at vpanic+0x19c/frame 0xfffffe022d8eb390 kassert_panic() at kassert_panic+0x126/frame 0xfffffe022d8eb400 linux_proc_exec() at linux_proc_exec+0x15a/frame 0xfffffe022d8eb440 exec_new_vmspace() at exec_new_vmspace+0xc3/frame 0xfffffe022d8eb4a0 exec_elf64_imgact() at exec_elf64_imgact+0xcbd/frame 0xfffffe022d8eb5a0 kern_execve() at kern_execve+0x6bd/frame 0xfffffe022d8eb900 sys_execve() at sys_execve+0x4c/frame 0xfffffe022d8eb980 amd64_syscall() at amd64_syscall+0x79b/frame 0xfffffe022d8ebab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe022d8ebab0 --- syscall (59, Linux ELF64, linux_execve), rip = 0x63d5e0d23a, rsp = 0x7fffffffbe58, rbp = 0x7fffffffbf00 --- KDB: enter: panic
(In reply to Ed Maste from comment #0) dchagin@mordor> ~/linux/8th/bin/lin64./8th 8th 17.07 LIN64 Free (2497e172) custid: 601e580c ok> ok> ok> dd Exception: can't find: dd: at offset 3 in console: G:;;; ok> q Exception: can't find: q: at offset 2 in console: G:;;; ok> exit Exception: can't find: exit: at offset 5 in console: G:;;; ok> quit Exception: can't find: quit: at offset 5 in console: G:;;; ok> ok> )))) how to close this??? can't reproduce panic
(In reply to Heqing Yan from comment #1) please, rebuild a kernel with next opts: options KTR options ALQ options KTR_ALQ options KTR_COMPILE=(KTR_ALL) options KTR_ENTRIES=4096 options KTR_MASK=(KTR_SUBSYS) load linuxulator, set next (via root) sysctl debug.ktr.alq_file=/root/ktr.out sysctl debug.ktr.mask=32 sysctl debug.ktr.alq_enable=1 reproduce bug and _before_ unloading linux.ko do sysctl debug.ktr.alq_enable=0 ktrdump -ctH -e /boot/kernel/kernel -i /root/ktr.out -o /root/ktr.log path to ktr.out should be direct. please, send ktr.log to me
I see I tested this with the ASLR patch (D5603). I will try to investigate further & build a test kernel soon.
(In reply to Heqing Yan from comment #1) When trying to run static docker binary (from https://download.docker.com/mac/static/stable/x86_64/docker-17.09.0-ce.tgz) on FreeBSD ^^^^^^^^ mac??? could u please post a proper link?
(In reply to Dmitry Chagin from comment #2) I rebuilt kernel with the following setting, the kernel does not panic any more. options KTR options ALQ options KTR_ALQ options KTR_COMPILE=(KTR_ALL) options KTR_ENTRIES=4096 options KTR_MASK=(KTR_SUBSYS) load linuxulator, set next (via root) sysctl debug.ktr.alq_file=/root/ktr.out sysctl debug.ktr.mask=32 sysctl debug.ktr.alq_enable=1 ------------------------------------------ Since it did not panic anymore, I am not sure what to do with the following suggestion. reproduce bug and _before_ unloading linux.ko do sysctl debug.ktr.alq_enable=0 ktrdump -ctH -e /boot/kernel/kernel -i /root/ktr.out -o /root/ktr.log ----------------------------------------- (In reply to Dmitry Chagin from comment #5) Sorry, I posted the comment from a mac, it automatically redirected me to the mac binary page, the correct one I downloaded to my BSD machine binary is from (https://download.docker.com/linux/static/stable/x86_64/docker-17.09.0-ce.tgz).
Note that Heqing Yan and I are testing on the same kernel (with the ASLR patches included).
(In reply to Heqing Yan from comment #6) seems to me problem in linux_arch_prctl(), please revert r313993 and try again
This was due to the ASLR patch, https://reviews.freebsd.org/D5603. I will grab this PR for tracking and leave a note in that review.
fake PR, should be closed as ASLR in base
Running docker/docker from https://download.docker.com/linux/static/stable/x86_64/docker-17.09.0-ce.tgz does not panic. The binary segfaults at start but that's a different issue. 11149 ktrace RET ktrace 0 11149 ktrace CALL execve(0x7fffffffec72,0x7fffffffe9c8,0x7fffffffe9d8) 11149 ktrace NAMI "docker/docker" 11149 docker RET linux_execve JUSTRETURN 11149 docker CALL linux_arch_prctl(0x1002,0x1435e08) 11149 docker RET linux_arch_prctl 0 11149 docker PSIG SIGSEGV SIG_DFL code=SEGV_MAPERR 11149 docker NAMI "docker.core"
I think r345468 fixes this (docker)