Bug 222800 - panic: proc_init: emuldata not found in exec case
Summary: panic: proc_init: emuldata not found in exec case
Status: Closed Unable to Reproduce
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-05 16:58 UTC by Ed Maste
Modified: 2019-05-19 10:28 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2017-10-05 16:58:37 UTC
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), ...
Comment 1 Heqing Yan 2017-10-06 20:10:45 UTC
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
Comment 2 Dmitry Chagin freebsd_committer freebsd_triage 2017-10-08 07:35:20 UTC
(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
Comment 3 Dmitry Chagin freebsd_committer freebsd_triage 2017-10-08 07:47:32 UTC
(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
Comment 4 Ed Maste freebsd_committer freebsd_triage 2017-10-10 15:18:32 UTC
I see I tested this with the ASLR patch (D5603). I will try to investigate further & build a test kernel soon.
Comment 5 Dmitry Chagin freebsd_committer freebsd_triage 2017-10-10 18:11:24 UTC
(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?
Comment 6 Heqing Yan 2017-10-10 18:26:24 UTC
(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).
Comment 7 Ed Maste freebsd_committer freebsd_triage 2017-10-10 18:29:56 UTC
Note that Heqing Yan and I are testing on the same kernel (with the ASLR patches included).
Comment 8 Dmitry Chagin freebsd_committer freebsd_triage 2017-10-13 20:54:31 UTC
(In reply to Heqing Yan from comment #6)

seems to me problem in linux_arch_prctl(), please revert r313993 and try again
Comment 9 Ed Maste freebsd_committer freebsd_triage 2018-03-12 21:03:08 UTC
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.
Comment 10 Dmitry Chagin freebsd_committer freebsd_triage 2019-05-06 20:07:21 UTC
fake PR, should be closed as ASLR in base
Comment 11 Ed Maste freebsd_committer freebsd_triage 2019-05-06 20:55:48 UTC
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"
Comment 12 Dmitry Chagin freebsd_committer freebsd_triage 2019-05-19 10:28:43 UTC
I think r345468 fixes this (docker)