My Haiku RISC-V port progress

I just disabled dynamic loading of kernel add-ons and loading progressed to rocket icon! Even first userland process “launch_daemon” is visible in KDL. Userland is almost not implemened so it is not expected to run. Currently is infinitely crash without stack trace.

Dynamic loading of kernel add-ons seems not working correctly, probably someting is not implemented (relocations types etc.). Modules preloaded by boot loader are fine.

screenshot42

21 Likes

Out of curiosity what needs to be implemented here for userland to work?

3 Likes

I have not yet investigated exactly, but at least following is needed:

  • Switch thread to user mode.
  • Change address space when switching thread.
  • Handle traps with mode change. Trap in user land should switch to kernel land and kernel address space/stack.
  • Implement user_memcpy() etc. Currently it just wraps memcpy() etc.
  • Implement syscalls. Currently only special machine-mode syscalls are supported (needed to control timer but currently also used to switch to supervisor mode).
  • Probably improve RISCV64VMTranslationMap.
  • commpage stuff.
5 Likes

I fixed some problems, now it crash when attempting to copy memory to userland (user_strlcpy). High addresses are currently used for userland, for example 0xffffffed13a66220.

arch_thread_init_kthread_stack(0x000000008129afc0(launch_daemon), 0x0000000080b2d000, 0x0000000080b31fb0, <kernel_riscv64> _ZL19common_thread_entryPv + 0, 0x0000000080b31fb0)
(24)
(25)
(26)
(27)
(28)
arch_thread_context_switch(0x000000008129be00(main2), 0x000000008129afc0(launch_daemon))
STrap(exception storePageFault)
  sstatus: (ie: {}, pie: {s}, spp: s)
  sepc: <kernel_riscv64> strlcpy + 46
  sie: {sExtern}
  sip: {}
  stval: 0xffffffed13a66220
Stack:
FP: 0x80b31950, PC: <kernel_riscv64> STrap + 409
FP: 0x80b31a50, PC: <kernel_riscv64> SVec + 81
FP: 0x80b31a70, PC: <kernel_riscv64> strlcpy + 45
FP: 0x80b31a90, PC: <kernel_riscv64> user_strlcpy.localalias.17 + 79
FP: 0x80b31f80, PC: <kernel_riscv64> _ZL33team_create_thread_start_internalPv + 125
FP: 0x80b31f90, PC: <kernel_riscv64> _ZL24team_create_thread_startPv + 11
FP: 0x80b31fb0, PC: <kernel_riscv64> _ZL19common_thread_entryPv + 49
FP: 0x0, PC: <kernel_riscv64> arch_thread_entry + 3
PANIC: unhandled STrap
Welcome to Kernel Debugging Land...
Thread 146 "launch_daemon" running on CPU 0
Stack:
FP: 0x80b31860, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80b318d0, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80b31910, PC: <kernel_riscv64> panic + 93
FP: 0x80b31a50, PC: <kernel_riscv64> SVec + 81
FP: 0x80b31a70, PC: <kernel_riscv64> strlcpy + 45
FP: 0x80b31a90, PC: <kernel_riscv64> user_strlcpy.localalias.17 + 79
FP: 0x80b31f80, PC: <kernel_riscv64> _ZL33team_create_thread_start_internalPv + 125
FP: 0x80b31f90, PC: <kernel_riscv64> _ZL24team_create_thread_startPv + 11
FP: 0x80b31fb0, PC: <kernel_riscv64> _ZL19common_thread_entryPv + 49
FP: 0x0, PC: <kernel_riscv64> arch_thread_entry + 3
11 Likes

Great progress, please continue!

3 Likes

Implemented and fixed parts up to arch_thread_enter_userspace (). runtime_loader is loaded.

Welcome to Kernel Debugging Land...
Thread 146 "launch_daemon" running on CPU 0
Stack:
FP: 0x80b348f0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80b34960, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80b349a0, PC: <kernel_riscv64> panic + 93
FP: 0x80b349f0, PC: <kernel_riscv64> arch_thread_enter_userspace + 19
FP: 0x80b34a30, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 135
FP: 0x80b34a90, PC: <kernel_riscv64> thread_enter_userspace_new_team + 53
FP: 0x80b34f80, PC: <kernel_riscv64> _ZL33team_create_thread_start_internalPv + 681
FP: 0x80b34f90, PC: <kernel_riscv64> _ZL24team_create_thread_startPv + 11
FP: 0x80b34fb0, PC: <kernel_riscv64> _ZL19common_thread_entryPv + 49
FP: 0x0, PC: <kernel_riscv64> arch_thread_entry + 3
kdebug> 
17 Likes

Maybe it help you

runtime_loader is executing in user mode!

execPageFault occurs because executable is memory mapped file and it is dynamically loaded from disk by page fault handler vm_page_fault().

arch_thread_enter_uspace(0x000000008129afc0(launch_daemon), 0xffffffecea269418, 0xffffffed13a66200, 0xffffffe99170e000)
STrap(exception execPageFault)
  sstatus: (ie: {u}, pie: {s}, spp: u, fs: 3, sum: 1)
  sepc: </boot/system/runtime_loader> 0x11418
  sie: {sExtern}
  sip: {}
  stval: </boot/system/runtime_loader> 0x11418
Stack:
FP: 0xffffffed13a65f00, PC: <kernel_riscv64> STrap + 447
FP: 0xffffffed13a66000, PC: <kernel_riscv64> SVec + 81
FP: 0x80b33a30, PC: </boot/system/runtime_loader> 0x11417
FP: 0x80b33a90, PC: <kernel_riscv64> thread_enter_userspace_new_team + 53
FP: 0x80b33f80, PC: <kernel_riscv64> _ZL33team_create_thread_start_internalPv + 547
FP: 0x80b33f90, PC: <kernel_riscv64> _ZL24team_create_thread_startPv + 11
FP: 0x80b33fb0, PC: <kernel_riscv64> _ZL19common_thread_entryPv + 49
FP: 0x0, PC: <kernel_riscv64> arch_thread_entry + 3
STrap(exception execPageFault)
  sstatus: (ie: {u}, pie: {s}, spp: u, fs: 3, sum: 1)
  sepc: </boot/system/runtime_loader> 0xa940
  sie: {sExtern}
  sip: {}
  stval: </boot/system/runtime_loader> 0xa940
Stack:
FP: 0xffffffed13a65ed0, PC: <kernel_riscv64> STrap + 447
FP: 0xffffffed13a65fd0, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffecea2733d0, PC: </boot/system/runtime_loader> 0xa93f
FP: 0x0, PC: 0xffffffe99170dfff
STrap(exception execPageFault)
  sstatus: (ie: {u}, pie: {s}, spp: u, fs: 3, sum: 1)
  sepc: </boot/system/runtime_loader> 0xea2e
  sie: {sExtern}
  sip: {}
  stval: </boot/system/runtime_loader> 0xea2e
Stack:
FP: 0xffffffed13a65ed0, PC: <kernel_riscv64> STrap + 447
FP: 0xffffffed13a65fd0, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffecea2733d0, PC: </boot/system/runtime_loader> 0xea2d
FP: 0x0, PC: 0xffffffe99170dfff
STrap(exception execPageFault)
  sstatus: (ie: {u}, pie: {s}, spp: u, fs: 3, sum: 1)
  sepc: </boot/system/runtime_loader> 0x135b0
  sie: {sExtern}
  sip: {}
  stval: </boot/system/runtime_loader> 0x135b0
Stack:
FP: 0xffffffed13a65e60, PC: <kernel_riscv64> STrap + 447
FP: 0xffffffed13a65f60, PC: <kernel_riscv64> SVec + 81
FP: 0x10000, PC: </boot/system/runtime_loader> 0x135af
STrap(exception loadPageFault)
  sstatus: (ie: {u}, pie: {}, spp: s, fs: 3, sum: 1)
  sepc: <kernel_riscv64> arch_debug_stack_trace + 58
  sie: {sExtern}
  sip: {}
  stval: 0xfff8
Stack:
FP: 0xffffffed13a65cd0, PC: <kernel_riscv64> STrap + 447
FP: 0xffffffed13a65dd0, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffed13a65e10, PC: <kernel_riscv64> arch_debug_stack_trace + 57
FP: 0xffffffed13a65e60, PC: <kernel_riscv64> STrap + 447
FP: 0xffffffed13a65f60, PC: <kernel_riscv64> SVec + 81
FP: 0x10000, PC: </boot/system/runtime_loader> 0x135af

Address decoding:

</boot/system/runtime_loader> 0x11418: runtime_loader (entry point)
</boot/system/runtime_loader> 0xa940: heap_init (PLT stub)
</boot/system/runtime_loader> 0xea2e: heap_init
</boot/system/runtime_loader> 0x135b0: _kern_generic_syscall

All syscalls points here. Syscalls seems to be not implemented.

  _kern_generic_syscall			
001135B0	0000 	ADDI FP, SP, 0
001135B2	0000 	ADDI FP, SP, 0
001135B4	0000 	ADDI FP, SP, 0
001135B6	0000 	ADDI FP, SP, 0
001135B8	0000 	ADDI FP, SP, 0
001135BA	0000 	ADDI FP, SP, 0
001135BC	0000 	ADDI FP, SP, 0
9 Likes

Userland process is invoking syscall in kernel (_kern_create_area):

arch_thread_enter_uspace(0x000000008129afc0(launch_daemon), 0xffffffd4456f0418, 0xffffffed13a66200, 0xffffffe99170e000)
STrap(exception execPageFault)
  sstatus: (ie: {u}, pie: {s}, spp: u, fs: 3, sum: 1)
  sepc: </boot/system/runtime_loader> 0x11418
  sie: {sExtern}
  sip: {}
  stval: </boot/system/runtime_loader> 0x11418
STrap(exception execPageFault)
  sstatus: (ie: {u}, pie: {s}, spp: u, fs: 3, sum: 1)
  sepc: </boot/system/runtime_loader> 0xa940
  sie: {sExtern}
  sip: {}
  stval: </boot/system/runtime_loader> 0xa940
STrap(exception execPageFault)
  sstatus: (ie: {u}, pie: {s}, spp: u, fs: 3, sum: 1)
  sepc: </boot/system/runtime_loader> 0xea2e
  sie: {sExtern}
  sip: {}
  stval: </boot/system/runtime_loader> 0xea2e
STrap(exception execPageFault)
  sstatus: (ie: {u}, pie: {s}, spp: u, fs: 3, sum: 1)
  sepc: </boot/system/runtime_loader> 0x141c0
  sie: {sExtern}
  sip: {}
  stval: </boot/system/runtime_loader> 0x141c0
STrap(exception uEcall)
  sstatus: (ie: {u}, pie: {s}, spp: u, fs: 3, sum: 1)
  sepc: </boot/system/runtime_loader> 0x141c4
  sie: {sExtern}
  sip: {}
  syscall 193(_kern_create_area)

Power off.
10 Likes

So cool!! Thank you for these updates :smile:

1 Like

Syscalls are basically working, but user trap frame (trap frames are called iframes in haiku kernel code) is currently pushed on user stack and syscall handler is running on user stack. That cause crash when kernel thread atemts to read object on stack created on syscall handler stack. Some special handling is needed for user -> kernel traps so stack will be immitiately switched to kernel stack and trap frame fill be pushed there.

arch_thread_enter_uspace(0x000000008129b400(launch_daemon), 0xfffffff214c56c22, 0xffffffed13a66200, 0xffffffe99170e000)
STrap(exception execPageFault)
  sepc: <runtime_loader_seg0ro> 0x11c22
  sepc: 0xfffffff214c56c22
  sie: {sExtern}
  sip: {}
  stval: <runtime_loader_seg0ro> 0x11c22
STrap(exception execPageFault)
  sepc: <runtime_loader_seg0ro> 0xa2f0
  sepc: 0xfffffff214c4f2f0
  sie: {sExtern}
  sip: {}
  stval: <runtime_loader_seg0ro> 0xa2f0
STrap(exception execPageFault)
  sepc: <runtime_loader_seg0ro> 0x152a0
  sepc: 0xfffffff214c5a2a0
  sie: {sExtern}
  sip: {}
  stval: <runtime_loader_seg0ro> 0x152a0
STrap(exception uEcall)
  sepc: <runtime_loader_seg0ro> 0x152a4
  sepc: 0xfffffff214c5a2a4
  sie: {sExtern}
  sip: {}
  syscall 245(_kern_debug_output)
Stack:
FP: 0xffffffed13a65ec0, PC: <kernel_riscv64> STrap + 327
FP: 0xffffffed13a65fc0, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffed13a66000, PC: <runtime_loader_seg0ro> 0x152a3
FP: 0x0, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
STrap(exception loadPageFault)
  sepc: <kernel_riscv64> strlcpy + 18
  sepc: 0x0000000080395698
  sie: {sExtern}
  sip: {}
  stval: <runtime_loader_seg0ro> 0x18c48
runtime_loader entry point
syscall_dispatcher: done with syscall 0xf5
  syscall 245(_kern_debug_output) result: 0
STrap(exception uEcall)
  sepc: <runtime_loader_seg0ro> 0x152a4
  sepc: 0xfffffff214c5a2a4
  sie: {sExtern}
  sip: {}
  syscall 245(_kern_debug_output)
Stack:
FP: 0xffffffed13a65ec0, PC: <kernel_riscv64> STrap + 327
FP: 0xffffffed13a65fc0, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffed13a66000, PC: <runtime_loader_seg0ro> 0x152a3
FP: 0x0, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
(1)
syscall_dispatcher: done with syscall 0xf5
  syscall 245(_kern_debug_output) result: 0
STrap(exception execPageFault)
  sepc: <runtime_loader_seg0ro> 0xefd0
  sepc: 0xfffffff214c53fd0
  sie: {sExtern}
  sip: {}
  stval: <runtime_loader_seg0ro> 0xefd0
STrap(exception execPageFault)
  sepc: <runtime_loader_seg0ro> 0x14f60
  sepc: 0xfffffff214c59f60
  sie: {sExtern}
  sip: {}
  stval: <runtime_loader_seg0ro> 0x14f60
STrap(exception uEcall)
  sepc: <runtime_loader_seg0ro> 0x14f64
  sepc: 0xfffffff214c59f64
  sie: {sExtern}
  sip: {}
  syscall 193(_kern_create_area)
Stack:
FP: 0xffffffed13a65e40, PC: <kernel_riscv64> STrap + 327
FP: 0xffffffed13a65f40, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffed13a65fc0, PC: <runtime_loader_seg0ro> 0x14f63
FP: 0xffffffed13a66000, PC: <runtime_loader_seg0ro> 0x11cd7
FP: 0x0, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
syscall_dispatcher: done with syscall 0xc1
  syscall 193(_kern_create_area) result: 346
STrap(exception storePageFault)
  sepc: <runtime_loader_seg0ro> 0xec52
  sepc: 0xfffffff214c53c52
  sie: {sExtern}
  sip: {}
  stval: <rld heap> 0x0
STrap(exception execPageFault)
  sepc: <runtime_loader_seg0ro> 0x10c58
  sepc: 0xfffffff214c55c58
  sie: {sExtern}
  sip: {}
  stval: <runtime_loader_seg0ro> 0x10c58
STrap(exception execPageFault)
  sepc: <runtime_loader_seg0ro> 0xc2ea
  sepc: 0xfffffff214c512ea
  sie: {sExtern}
  sip: {}
  stval: <runtime_loader_seg0ro> 0xc2ea
STrap(exception uEcall)
  sepc: <runtime_loader_seg0ro> 0x14f64
  sepc: 0xfffffff214c59f64
  sie: {sExtern}
  sip: {}
  syscall 193(_kern_create_area)
Stack:
FP: 0xffffffed13a65e90, PC: <kernel_riscv64> STrap + 327
FP: 0xffffffed13a65f90, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffed13a65fc0, PC: <runtime_loader_seg0ro> 0x14f63
FP: 0xffffffed13a66000, PC: <runtime_loader_seg0ro> 0x11ce5
FP: 0x0, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
syscall_dispatcher: done with syscall 0xc1
  syscall 193(_kern_create_area) result: 347
STrap(exception storePageFault)
  sepc: <runtime_loader_seg0ro> 0xc326
  sepc: 0xfffffff214c51326
  sie: {sExtern}
  sip: {}
  stval: <_rld_debug_> 0x0
STrap(exception execPageFault)
  sepc: <runtime_loader_seg0ro> 0xb67a
  sepc: 0xfffffff214c5067a
  sie: {sExtern}
  sip: {}
  stval: <runtime_loader_seg0ro> 0xb67a
STrap(exception execPageFault)
  sepc: <runtime_loader_seg0ro> 0x16c2e
  sepc: 0xfffffff214c5bc2e
  sie: {sExtern}
  sip: {}
  stval: <runtime_loader_seg0ro> 0x16c2e
STrap(exception uEcall)
  sepc: <runtime_loader_seg0ro> 0x14674
  sepc: 0xfffffff214c59674
  sie: {sExtern}
  sip: {}
  syscall 50(_kern_find_thread)
Stack:
FP: 0xffffffed13a65e40, PC: <kernel_riscv64> STrap + 327
FP: 0xffffffed13a65f40, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffed13a65f60, PC: <runtime_loader_seg0ro> 0x14673
FP: 0xffffffed13a65fc0, PC: <runtime_loader_seg0ro> 0xb699
FP: 0xffffffed13a66000, PC: <runtime_loader_seg0ro> 0x11cf5
FP: 0x0, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
syscall_dispatcher: done with syscall 0x32
  syscall 50(_kern_find_thread) result: 146
STrap(exception uEcall)
  sepc: <runtime_loader_seg0ro> 0x14a04
  sepc: 0xfffffff214c59a04
  sie: {sExtern}
  sip: {}
  syscall 107(_kern_open)
Stack:
FP: 0xffffffed13a64510, PC: <kernel_riscv64> STrap + 327
FP: 0xffffffed13a64610, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffed13a64a60, PC: <runtime_loader_seg0ro> 0x14a03
FP: 0xffffffed13a65f60, PC: <runtime_loader_seg0ro> 0xcacb
FP: 0xffffffed13a65fc0, PC: <runtime_loader_seg0ro> 0xb6b3
FP: 0xffffffed13a66000, PC: <runtime_loader_seg0ro> 0x11cf5
FP: 0x0, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
syscall_dispatcher: done with syscall 0x6b
  syscall 107(_kern_open) result: 0
STrap(exception uEcall)
  sepc: <runtime_loader_seg0ro> 0x149e4
  sepc: 0xfffffff214c599e4
  sie: {sExtern}
  sip: {}
  syscall 105(_kern_normalize_path)
Stack:
FP: 0xffffffed13a64960, PC: <kernel_riscv64> STrap + 327
FP: 0xffffffed13a64a60, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffed13a65f60, PC: <runtime_loader_seg0ro> 0x149e3
FP: 0xffffffed13a65fc0, PC: <runtime_loader_seg0ro> 0xb6b3
FP: 0xffffffed13a66000, PC: <runtime_loader_seg0ro> 0x11cf5
FP: 0x0, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
syscall_dispatcher: done with syscall 0x69
  syscall 105(_kern_normalize_path) result: 0
STrap(exception uEcall)
  sepc: <runtime_loader_seg0ro> 0x14c34
  sepc: 0xfffffff214c59c34
  sie: {sExtern}
  sip: {}
  syscall 142(_kern_read)
Stack:
FP: 0xffffffed13a64960, PC: <kernel_riscv64> STrap + 327
FP: 0xffffffed13a64a60, PC: <kernel_riscv64> SVec + 81
FP: 0xffffffed13a65f60, PC: <runtime_loader_seg0ro> 0x14c33
FP: 0xffffffed13a65fc0, PC: <runtime_loader_seg0ro> 0xb6b3
FP: 0xffffffed13a66000, PC: <runtime_loader_seg0ro> 0x11cf5
FP: 0x0, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
STrap(interrupt sExtern)
  sepc: <virtio_block> _ZL5do_ioPvP11IOOperation + 230
  sepc: 0x00000000809e85ac
  sie: {sExtern}
  sip: {sExtern}
STrap(exception loadPageFault)
  sepc: <kernel_riscv64> _ZNK9IORequest12HasCallbacksEv.localalias.8 + 6
  sepc: 0x00000000803325ce
  sie: {sExtern}
  sip: {}
  stval: 0xffffffed13a642f8
vm_page_fault: kernel thread accessing invalid user memory!
vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0xffffffed13a642f8, ip 0x803325ce, write 0, user 0, thread 0x8e
PANIC: vm_page_fault: unhandled page fault in kernel space at 0xffffffed13a642f8, ip 0x803325ce
Welcome to Kernel Debugging Land...
Thread 142 "virtio scheduler 1" running on CPU 0
Stack:
FP: 0xcd11faa0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0xcd11fb10, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0xcd11fb50, PC: <kernel_riscv64> panic + 93
FP: 0xcd11fc80, PC: <kernel_riscv64> vm_page_fault + 425
FP: 0xcd11fcc0, PC: <kernel_riscv64> STrap + 753
FP: 0xcd11fdc0, PC: <kernel_riscv64> SVec + 81
FP: 0xcd11fdd0, PC: <kernel_riscv64> _ZNK9IORequest12HasCallbacksEv.localalias.8 + 5
FP: 0xcd11fe60, PC: 0xcd11fe5f
FP: 0xcd11ffc0, PC: <kernel_riscv64> _ZN17IOSchedulerSimple10_SchedulerEv.localalias.2 + 1187
FP: 0xcd11ffe0, PC: <kernel_riscv64> _ZL19common_thread_entryPv + 49
FP: 0x0, PC: <kernel_riscv64> arch_thread_entry + 3
17 Likes

runtime_loader is loading modules, but libroot.so is currently crash because of NULL deference.

arch_thread_init_kthread_stack(0x000000008129b400(launch_daemon), 0x0000000080b2c000, 0x0000000080b30fb0, <kernel_riscv64> _ZL19common_thread_entryPv + 0, 0x0000000080b30fb0)
cache_prefetch_vnode(0x0, 0x1c000)
cache_prefetch_vnode(0x1b000, 0x2000)
arch_thread_init_tls(0x000000008129b400(launch_daemon))
arch_thread_enter_uspace(0x000000008129b400(launch_daemon), 0xfffffff214c56ea0, 0xffffffed13a66200, 0xffffffe99170e000)
runtime_loader entry point
(1)
rld: load /boot/system/servers/launch_daemon
malloc(1720) -> 0xffffffc50dacb008
PT_LOAD: 0x0, 0x30195
image->regions[0]: 0x0, 0x30195
PT_LOAD: 0x31198, 0x34818
image->regions[1]: 0x31198, 0x34760
image->dynamic_ptr: 0x0000000000032fa8
image->regions[0]: 0x0, 0x30195
image->regions[1]: 0x31198, 0x34760
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x31000)
"/boot/system/servers/launch_daemon" at 0xffffffe8d0ee9000, 0x31000 bytes (read-only)
malloc(56) -> 0xffffffc50dacb6c8
_user_map_file(0x30000)
cache_prefetch_vnode(0x30000, 0x4000)
"/boot/system/servers/launch_daemon" at 0xffffffe8d0f1a000, 0x4000 bytes (rw)
cleared 0xffffffe8d0f1d760 and the following 0x8a0 bytes
malloc(96) -> 0xffffffc50dacb708
malloc(48) -> 0xffffffc50dacb770
runtime_loader: search_container_in_path_list() libbe.so in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libbe.so
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libbe.so
runtime_loader: try_open_container(): /boot/system/lib/libbe.so
runtime_loader: open_executable(libbe.so): found at /boot/system/lib/libbe.so
malloc(1720) -> 0xffffffc50dacb7a8
PT_LOAD: 0x0, 0x2b7171
image->regions[0]: 0x0, 0x2b7171
PT_LOAD: 0x2b8178, 0x2e5570
image->regions[1]: 0x2b8178, 0x2e5038
image->dynamic_ptr: 0x00000000002cb630
image->regions[0]: 0x0, 0x2b7171
image->regions[1]: 0x2b8178, 0x2e5038
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x2b8000)
"/boot/system/lib/libbe.so" at 0xffffffe36c42f000, 0x2b8000 bytes (read-only)
_user_map_file(0x2b7000)
cache_prefetch_vnode(0x2b7000, 0x2e000)
"/boot/system/lib/libbe.so" at 0xffffffe36c6e7000, 0x2e000 bytes (rw)
cleared 0xffffffe36c714038 and the following 0xfc8 bytes
malloc(216) -> 0xffffffc50dacbe68
runtime_loader: search_container_in_path_list() libnetwork.so in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libnetwork.so
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libnetwork.so
runtime_loader: try_open_container(): /boot/system/lib/libnetwork.so
runtime_loader: open_executable(libnetwork.so): found at /boot/system/lib/libnetwork.so
malloc(1792) -> 0xffffffc50dacbf48
PT_LOAD: 0x0, 0x30837
image->regions[0]: 0x0, 0x30837
PT_LOAD: 0x31000, 0x38f00
image->regions[1]: 0x31000, 0x331b0
image->regions[2]: 0x31000, 0x36d50
image->dynamic_ptr: 0x0000000000032100
image->regions[0]: 0x0, 0x30837
image->regions[1]: 0x31000, 0x331b0
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x31000)
"/boot/system/lib/libnetwork.so" at 0xffffffd2dc863000, 0x31000 bytes (read-only)
_user_map_file(0x31000)
cache_prefetch_vnode(0x31000, 0x3000)
"/boot/system/lib/libnetwork.so" at 0xffffffd2dc894000, 0x3000 bytes (rw)
cleared 0xffffffd2dc8961b0 and the following 0xe50 bytes
malloc(168) -> 0xffffffc50dacc650
runtime_loader: search_container_in_path_list() libbnetapi.so in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libbnetapi.so
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libbnetapi.so
runtime_loader: try_open_container(): /boot/system/lib/libbnetapi.so
runtime_loader: open_executable(libbnetapi.so): found at /boot/system/lib/libbnetapi.so
malloc(1720) -> 0xffffffc50dacc700
PT_LOAD: 0x0, 0x5a59d
image->regions[0]: 0x0, 0x5a59d
PT_LOAD: 0x5b5a0, 0x5fae0
image->regions[1]: 0x5b5a0, 0x5fa18
image->dynamic_ptr: 0x000000000005d7a8
image->regions[0]: 0x0, 0x5a59d
image->regions[1]: 0x5b5a0, 0x5fa18
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x5b000)
"/boot/system/lib/libbnetapi.so" at 0xfffffffc2dc42000, 0x5b000 bytes (read-only)
_user_map_file(0x5a000)
cache_prefetch_vnode(0x5a000, 0x5000)
"/boot/system/lib/libbnetapi.so" at 0xfffffffc2dc9d000, 0x5000 bytes (rw)
cleared 0xfffffffc2dca1a18 and the following 0x5e8 bytes
malloc(168) -> 0xffffffc50daccdc0
runtime_loader: search_container_in_path_list() libstdc++.so.6 in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libstdc++.so.6
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libstdc++.so.6
runtime_loader: try_open_container(): /boot/system/lib/libstdc++.so.6
runtime_loader: open_executable(libstdc++.so.6): found at /boot/system/lib/libstdc++.so.6.0.25
malloc(1792) -> 0xffffffc50dacce70
PT_LOAD: 0x0, 0x15f650
image->regions[0]: 0x0, 0x15f650
PT_LOAD: 0x160650, 0x174730
image->regions[1]: 0x160650, 0x16ca08
image->regions[2]: 0x160650, 0x168378
malloc(128) -> 0xffffffc50dacd578
image->dynamic_ptr: 0x00000000001690c8
image->regions[0]: 0x0, 0x15f650
image->regions[1]: 0x160650, 0x16ca08
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x160000)
"/boot/system/lib/libstdc++.so.6.0.25" at 0xffffffe358e3f000, 0x160000 bytes (read-only)
_user_map_file(0x15f000)
cache_prefetch_vnode(0x15f000, 0xd000)
"/boot/system/lib/libstdc++.so.6.0.25" at 0xffffffe358f9f000, 0xd000 bytes (rw)
cleared 0xffffffe358faba08 and the following 0x5f8 bytes
malloc(96) -> 0xffffffc50dacd600
runtime_loader: search_container_in_path_list() libroot.so in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libroot.so
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libroot.so
runtime_loader: try_open_container(): /boot/system/lib/libroot.so
runtime_loader: open_executable(libroot.so): found at /boot/system/lib/libroot.so
malloc(1792) -> 0xffffffc50dacd668
PT_LOAD: 0x0, 0xd3868
image->regions[0]: 0x0, 0xd3868
PT_LOAD: 0xd4000, 0x125948
image->regions[1]: 0xd4000, 0xe14c8
image->regions[2]: 0xd4000, 0x118480
image->dynamic_ptr: 0x00000000000d8cf0
image->regions[0]: 0x0, 0xd3868
image->regions[1]: 0xd4000, 0xe14c8
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0xd4000)
"/boot/system/lib/libroot.so" at 0xffffffd35541b000, 0xd4000 bytes (read-only)
_user_map_file(0xd4000)
cache_prefetch_vnode(0xd4000, 0xe000)
"/boot/system/lib/libroot.so" at 0xffffffd3554ef000, 0xe000 bytes (rw)
cleared 0xffffffd3554fc4c8 and the following 0xb38 bytes
malloc(312) -> 0xffffffc50dacdd70
runtime_loader: search_container_in_path_list() libgcc_s.so.1 in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libgcc_s.so.1
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libgcc_s.so.1
runtime_loader: try_open_container(): /boot/system/lib/libgcc_s.so.1
runtime_loader: open_executable(libgcc_s.so.1): found at /boot/system/lib/libgcc_s.so.1
malloc(1720) -> 0xffffffc50dacdeb0
PT_LOAD: 0x0, 0xfe04
image->regions[0]: 0x0, 0xfe04
PT_LOAD: 0x10000, 0x10490
image->regions[1]: 0x10000, 0x103e0
image->dynamic_ptr: 0x0000000000010020
image->regions[0]: 0x0, 0xfe04
image->regions[1]: 0x10000, 0x103e0
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x10000)
"/boot/system/lib/libgcc_s.so.1" at 0xffffffec5bb9f000, 0x10000 bytes (read-only)
_user_map_file(0x10000)
cache_prefetch_vnode(0x10000, 0x1000)
"/boot/system/lib/libgcc_s.so.1" at 0xffffffec5bbaf000, 0x1000 bytes (rw)
cleared 0xffffffec5bbaf3e0 and the following 0xc20 bytes
malloc(360) -> 0xffffffc50dace570
malloc(72) -> 0xffffffc50dace6e0
runtime_loader: search_container_in_path_list() libicudata.so.57 in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libicudata.so.57
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libicudata.so.57
runtime_loader: try_open_container(): /boot/system/lib/libicudata.so.57
runtime_loader: open_executable(libicudata.so.57): found at /boot/system/lib/libicudata.so.57.2
malloc(1720) -> 0xffffffc50dace730
PT_LOAD: 0x0, 0x187f7b4
image->regions[0]: 0x0, 0x187f7b4
PT_LOAD: 0x18807b8, 0x1880968
image->regions[1]: 0x18807b8, 0x1880928
image->dynamic_ptr: 0x00000000018807d8
image->regions[0]: 0x0, 0x187f7b4
image->regions[1]: 0x18807b8, 0x1880928
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0xa00000)
"/boot/system/lib/libicudata.so.57.2" at 0xffffffd26beda000, 0x1880000 bytes (read-only)
_user_map_file(0x187f000)
cache_prefetch_vnode(0x187f000, 0x1000)
"/boot/system/lib/libicudata.so.57.2" at 0xffffffd26d75a000, 0x1000 bytes (rw)
cleared 0xffffffd26d75a928 and the following 0x6d8 bytes
runtime_loader: search_container_in_path_list() libicui18n.so.57 in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libicui18n.so.57
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libicui18n.so.57
runtime_loader: try_open_container(): /boot/system/lib/libicui18n.so.57
runtime_loader: open_executable(libicui18n.so.57): found at /boot/system/lib/libicui18n.so.57.2
malloc(1720) -> 0xffffffc50dacedf0
PT_LOAD: 0x0, 0x218441
image->regions[0]: 0x0, 0x218441
PT_LOAD: 0x219448, 0x22ddf0
image->regions[1]: 0x219448, 0x22d708
image->dynamic_ptr: 0x0000000000225a70
image->regions[0]: 0x0, 0x218441
image->regions[1]: 0x219448, 0x22d708
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x219000)
"/boot/system/lib/libicui18n.so.57.2" at 0xffffffc4c9b6b000, 0x219000 bytes (read-only)
_user_map_file(0x218000)
cache_prefetch_vnode(0x218000, 0x15000)
"/boot/system/lib/libicui18n.so.57.2" at 0xffffffc4c9d84000, 0x15000 bytes (rw)
cleared 0xffffffc4c9d98708 and the following 0x8f8 bytes
runtime_loader: search_container_in_path_list() libicuio.so.57 in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libicuio.so.57
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libicuio.so.57
runtime_loader: try_open_container(): /boot/system/lib/libicuio.so.57
runtime_loader: open_executable(libicuio.so.57): found at /boot/system/lib/libicuio.so.57.2
malloc(1720) -> 0xffffffc50dacf4b0
PT_LOAD: 0x0, 0xd00d
image->regions[0]: 0x0, 0xd00d
PT_LOAD: 0xe010, 0xf468
image->regions[1]: 0xe010, 0xf380
image->dynamic_ptr: 0x000000000000edd0
image->regions[0]: 0x0, 0xd00d
image->regions[1]: 0xe010, 0xf380
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0xe000)
"/boot/system/lib/libicuio.so.57.2" at 0xffffffffcd7e8000, 0xe000 bytes (read-only)
_user_map_file(0xd000)
cache_prefetch_vnode(0xd000, 0x2000)
"/boot/system/lib/libicuio.so.57.2" at 0xffffffffcd7f6000, 0x2000 bytes (rw)
cleared 0xffffffffcd7f7380 and the following 0xc80 bytes
runtime_loader: search_container_in_path_list() libicutu.so.57 in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libicutu.so.57
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libicutu.so.57
runtime_loader: try_open_container(): /boot/system/lib/libicutu.so.57
runtime_loader: open_executable(libicutu.so.57): found at /boot/system/lib/libicutu.so.57.2
malloc(1792) -> 0xffffffc50dacfb70
PT_LOAD: 0x0, 0x2b936
image->regions[0]: 0x0, 0x2b936
PT_LOAD: 0x2c000, 0x5f920
image->regions[1]: 0x2c000, 0x2db08
image->regions[2]: 0x2c000, 0x5de18
image->dynamic_ptr: 0x000000000002cda8
image->regions[0]: 0x0, 0x2b936
image->regions[1]: 0x2c000, 0x2db08
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x2c000)
"/boot/system/lib/libicutu.so.57.2" at 0xfffffff2088df000, 0x2c000 bytes (read-only)
_user_map_file(0x2c000)
cache_prefetch_vnode(0x2c000, 0x2000)
"/boot/system/lib/libicutu.so.57.2" at 0xfffffff20890b000, 0x2000 bytes (rw)
cleared 0xfffffff20890cb08 and the following 0x4f8 bytes
malloc(72) -> 0xffffffc50dad0278
runtime_loader: search_container_in_path_list() libicuuc.so.57 in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libicuuc.so.57
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libicuuc.so.57
runtime_loader: try_open_container(): /boot/system/lib/libicuuc.so.57
runtime_loader: open_executable(libicuuc.so.57): found at /boot/system/lib/libicuuc.so.57.2
malloc(1720) -> 0xffffffc50dad02c8
PT_LOAD: 0x0, 0x15f573
image->regions[0]: 0x0, 0x15f573
PT_LOAD: 0x160578, 0x1746c8
image->regions[1]: 0x160578, 0x174088
image->dynamic_ptr: 0x00000000001709c0
image->regions[0]: 0x0, 0x15f573
image->regions[1]: 0x160578, 0x174088
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x160000)
"/boot/system/lib/libicuuc.so.57.2" at 0xffffffcd876fa000, 0x160000 bytes (read-only)
_user_map_file(0x15f000)
cache_prefetch_vnode(0x15f000, 0x15000)
"/boot/system/lib/libicuuc.so.57.2" at 0xffffffcd8785a000, 0x15000 bytes (rw)
cleared 0xffffffcd8786e088 and the following 0xf78 bytes
malloc(72) -> 0xffffffc50dad0988
runtime_loader: search_container_in_path_list() libz.so.1 in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libz.so.1
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libz.so.1
runtime_loader: try_open_container(): /boot/system/lib/libz.so.1
runtime_loader: open_executable(libz.so.1): found at /boot/system/lib/libz.so.1.2.11
malloc(1720) -> 0xffffffc50dad09d8
PT_LOAD: 0x0, 0x1af5c
image->regions[0]: 0x0, 0x1af5c
PT_LOAD: 0x1b000, 0x1b4e0
image->regions[1]: 0x1b000, 0x1b4a0
image->dynamic_ptr: 0x000000000001b170
image->regions[0]: 0x0, 0x1af5c
image->regions[1]: 0x1b000, 0x1b4a0
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x1b000)
"/boot/system/lib/libz.so.1.2.11" at 0xffffffd710904000, 0x1b000 bytes (read-only)
_user_map_file(0x1b000)
cache_prefetch_vnode(0x1b000, 0x1000)
"/boot/system/lib/libz.so.1.2.11" at 0xffffffd71091f000, 0x1000 bytes (rw)
cleared 0xffffffd71091f4a0 and the following 0xb60 bytes
malloc(360) -> 0xffffffc50dad1098
malloc(32) -> 0xffffffc50dad1208
runtime_loader: search_container_in_path_list() libbsd.so in %A/lib:/boot/system/non-packaged/lib:/boot/system/lib
runtime_loader: try_open_container(): /boot/system/servers/lib/libbsd.so
runtime_loader: try_open_container(): /boot/system/non-packaged/lib/libbsd.so
runtime_loader: try_open_container(): /boot/system/lib/libbsd.so
runtime_loader: open_executable(libbsd.so): found at /boot/system/lib/libbsd.so
malloc(1720) -> 0xffffffc50dad1230
PT_LOAD: 0x0, 0x4f90
image->regions[0]: 0x0, 0x4f90
PT_LOAD: 0x5000, 0x5550
image->regions[1]: 0x5000, 0x5468
image->dynamic_ptr: 0x0000000000005038
image->regions[0]: 0x0, 0x4f90
image->regions[1]: 0x5000, 0x5468
_user_map_file(0x0)
cache_prefetch_vnode(0x0, 0x5000)
"/boot/system/lib/libbsd.so" at 0xffffffd25b2cf000, 0x5000 bytes (read-only)
_user_map_file(0x5000)
cache_prefetch_vnode(0x5000, 0x1000)
"/boot/system/lib/libbsd.so" at 0xffffffd25b2d4000, 0x1000 bytes (rw)
cleared 0xffffffd25b2d4468 and the following 0xb98 bytes
malloc(96) -> 0xffffffc50dad18f0
malloc(80) -> 0xffffffc50dad1958
malloc(24) -> 0xffffffc50dad19b0
malloc(24) -> 0xffffffc50dad19d0
malloc(24) -> 0xffffffc50dad19f0
malloc(32) -> 0xffffffc50dad1a10
malloc(40) -> 0xffffffc50dad1a38
malloc(40) -> 0xffffffc50dad1a68
malloc(24) -> 0xffffffc50dad1a98
malloc(24) -> 0xffffffc50dad1ab8
malloc(24) -> 0xffffffc50dad1ad8
malloc(112) -> 0xffffffc50dad1af8
malloc(1512) -> 0xffffffc50dad1b70
malloc(1512) -> 0xffffffc50dad2160
malloc(24) -> 0xffffffc50dad2750
free(0xffffffc50dad2750)
free(0xffffffc50dad1b70)
free(0xffffffc50dad2160)
malloc(21632) -> 0xffffffc50dad1b70
malloc(21632) -> 0xffffffd3c06ef008
malloc(344) -> 0xffffffd3c06f4490
free(0xffffffd3c06f4490)
free(0xffffffc50dad1b70)
free(0xffffffd3c06ef008)
malloc(48000) -> 0xffffffd629f63008
malloc(48000) -> 0xffffffd66cbab008
malloc(752) -> 0xffffffd629f6eb90
free(0xffffffd629f6eb90)
free(0xffffffd629f63008)
free(0xffffffd66cbab008)
malloc(64) -> 0xffffffd3c06ef008
malloc(64) -> 0xffffffd3c06ef050
malloc(24) -> 0xffffffd3c06ef098
free(0xffffffd3c06ef098)
free(0xffffffd3c06ef008)
free(0xffffffd3c06ef050)
malloc(26816) -> 0xffffffd3c06ef008
malloc(26816) -> 0xffffffc50dad1b70
malloc(424) -> 0xffffffd3c06f58d0
free(0xffffffd3c06f58d0)
free(0xffffffd3c06ef008)
free(0xffffffc50dad1b70)
malloc(61616) -> 0xffffffd629f63008
malloc(61616) -> 0xffffffd66cbab008
malloc(968) -> 0xffffffd629f720c0
free(0xffffffd629f720c0)
free(0xffffffd629f63008)
free(0xffffffd66cbab008)
malloc(1272) -> 0xffffffd3c06ef008
malloc(1272) -> 0xffffffd3c06ef508
malloc(24) -> 0xffffffd3c06efa08
free(0xffffffd3c06efa08)
free(0xffffffd3c06ef008)
free(0xffffffd3c06ef508)
malloc(4360) -> 0xffffffd3c06ef008
malloc(4360) -> 0xffffffd3c06f0118
malloc(72) -> 0xffffffd3c06f1228
free(0xffffffd3c06f1228)
free(0xffffffd3c06ef008)
free(0xffffffd3c06f0118)
malloc(944) -> 0xffffffd3c06ef008
malloc(944) -> 0xffffffd3c06ef3c0
malloc(24) -> 0xffffffd3c06ef778
free(0xffffffd3c06ef778)
free(0xffffffd3c06ef008)
free(0xffffffd3c06ef3c0)
malloc(97464) -> 0xffffffd6e35d9008
malloc(97464) -> 0xffffffd703247008
malloc(1528) -> 0xffffffd3c06ef008
free(0xffffffd3c06ef008)
free(0xffffffd6e35d9008)
free(0xffffffd703247008)
malloc(1056) -> 0xffffffd3c06ef008
malloc(1056) -> 0xffffffd3c06ef430
malloc(24) -> 0xffffffd3c06ef858
free(0xffffffd3c06ef858)
free(0xffffffd3c06ef008)
free(0xffffffd3c06ef430)
malloc(5040) -> 0xffffffd3c06ef008
malloc(5040) -> 0xffffffd3c06f03c0
malloc(80) -> 0xffffffd3c06f1778
free(0xffffffd3c06f1778)
free(0xffffffd3c06ef008)
free(0xffffffd3c06f03c0)
malloc(14800) -> 0xffffffd3c06ef008
malloc(14800) -> 0xffffffd3c06f29e0
malloc(232) -> 0xffffffd3c06f63b8
free(0xffffffd3c06f63b8)
free(0xffffffd3c06ef008)
free(0xffffffd3c06f29e0)
malloc(8872) -> 0xffffffd3c06ef008
malloc(8872) -> 0xffffffd3c06f12b8
malloc(144) -> 0xffffffd3c06f3568
free(0xffffffd3c06f3568)
free(0xffffffd3c06ef008)
free(0xffffffd3c06f12b8)
free(0xffffffc50dad1af8)
malloc(112) -> 0xffffffd3c06ef008
146: init dependencies
146:  init: libgcc_s.so.1
146:  init: libroot.so
vm_soft_fault: va 0x0 not covered by area in address space
vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x0, ip 0xffffffd3554513ba, write 0, user 1, thread 0x92
PANIC: user_debug_exception_occurred(2, 11)
Welcome to Kernel Debugging Land...
Thread 146 "launch_daemon" running on CPU 0
Stack:
FP: 0x80b305d0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80b30640, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80b30680, PC: <kernel_riscv64> panic + 93
FP: 0x80b30720, PC: <kernel_riscv64> user_debug_exception_occurred + 31
FP: 0x80b30810, PC: <kernel_riscv64> vm_page_fault + 405
FP: 0x80b308f0, PC: <kernel_riscv64> STrap + 537
FP: 0x80b309f0, PC: <kernel_riscv64> SVecU + 111
FP: 0xffffffed13a65f60, PC: <libroot.so_seg0ro> 0x363b9
FP: 0xffffffed13a65fc0, PC: <runtime_loader_seg0ro> 0xb751
FP: 0xffffffed13a66000, PC: <runtime_loader_seg0ro> 0x11f73
FP: 0x0, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
kdebug> 
11 Likes

I already expect full blown desktop screenshot everytime i open this topic :slight_smile: you made a big progress, keep up the good job!

13 Likes

This port seems to be already most progressing non-x86 platform port for now. I started to implement libroot.so architecture-specific parts that a still stubs for all architectures except x86.

15 Likes

libroot.so initialization passes, but it currently crash in initialization of libstdc++.so.6.0.25. Crash is at following position (argument 8 seems to be NULL and it is dereferenced). 3rd party libraries are annoying. Also it is compiled with -fomit-frame-pointer that breaks stack trace.

<libstdc++.so.6.0.25> _ZNK10__cxxabiv121__vmi_class_type_info12__do_dyncastElNS_17__class_type_info10__sub_kindEPKS1_PKvS4_S6_RNS1_16__dyncast_resultE

Log:

arch_thread_init_kthread_stack(0x000000008129b400(launch_daemon), 0x0000000080b2d000, 0x0000000080b31fb0, <kernel_riscv64> _ZL19common_thread_entryPv + 0, 0x0000000080b31fb0)
arch_thread_init_tls(0x000000008129b400(launch_daemon))
  thread->user_local_storage: 0xffffffed13a66000)
arch_thread_enter_uspace(0x000000008129b400(launch_daemon), 0xfffffff214c56e24, 0xffffffed13a66200, 0xffffffe99170e000)
  sscratch: 0x8129b780, 0x8129b780
runtime_loader entry point
TLS: 0xffffffed13a66000
image->regions[1]: 31000, 345c8
image->regions[1]: 2b8178, 2e5038
image->regions[1]: 31000, 331b0
image->regions[2]: 31000, 36d50
image->regions[1]: 5b5a0, 5fa18
image->regions[1]: 160650, 16ca08
image->regions[2]: 160650, 168378
image->regions[1]: de000, eb4c8
image->regions[2]: de000, 122480
image->regions[1]: 10000, 103e0
image->regions[1]: 18807b8, 1880928
image->regions[1]: 219448, 22d708
image->regions[1]: e010, f380
image->regions[1]: 2c000, 2db08
image->regions[2]: 2c000, 5de18
image->regions[1]: 160578, 174088
image->regions[1]: 1b000, 1b4a0
image->regions[1]: 5000, 5468
unhandled relocation type R_RISCV_TLS_DTPMOD64
Last message repeated 2 times.
unhandled relocation type R_RISCV_TLS_DTPREL64
unhandled relocation type R_RISCV_TLS_DTPMOD64
unhandled relocation type R_RISCV_TLS_DTPREL64
+init: libgcc_s.so.1
(1)
(2)
(3)
(4)
-init: libgcc_s.so.1
+init: libroot.so
(1)
(2)
init_array[0]: 0xfffffff8fe470136
init_array[1]: 0xfffffff8fe470100
init_array[2]: 0xfffffff8fe4701d0
init_array[3]: 0xfffffff8fe47019a
init_array[4]: 0xfffffff8fe470164
init_array[5]: 0xfffffff8fe470206
init_array[6]: 0xfffffff8fe4702ac
(3)
(4)
-init: libroot.so
+init: libstdc++.so.6
(1)
(2)
init_array[0]: 0xffffffe358ed8bac
init_array[1]: 0xffffffe358ed8c20
init_array[2]: 0xffffffe358ed8c92
init_array[3]: 0xffffffe358ed8dbe
init_array[4]: 0xffffffe358ed8e8e
init_array[5]: 0xffffffe358ed8ece
init_array[6]: 0xffffffe358ed8f70
init_array[7]: 0xffffffe358ed9012
init_array[8]: 0xffffffe358ed9104
(3)
(4)
-init: libstdc++.so.6
+init: libicudata.so.57
(1)
(2)
(3)
(4)
-init: libicudata.so.57
+init: libicuuc.so.57
(1)
(2)
(3)
(4)
-init: libicuuc.so.57
+init: libicui18n.so.57
(1)
(2)
init_array[0]: 0xffffffc4c9c44760
(3)
(4)
-init: libicui18n.so.57
+init: libicuio.so.57
(1)
(2)
(3)
(4)
-init: libicuio.so.57
+init: libicutu.so.57
(1)
(2)
init_array[0]: 0xfffffff2088ec310
vm_soft_fault: va 0x0 not covered by area in address space
vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x18, ip 0xffffffe358edc8ec, write 0, user 1, thread 0x92
PANIC: user_debug_exception_occurred(2, 11)
Welcome to Kernel Debugging Land...
Thread 146 "launch_daemon" running on CPU 0
Stack:
FP: 0x80b315a0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80b31610, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80b31650, PC: <kernel_riscv64> panic + 93
FP: 0x80b316f0, PC: <kernel_riscv64> user_debug_exception_occurred + 31
FP: 0x80b317e0, PC: <kernel_riscv64> vm_page_fault + 405
FP: 0x80b318c0, PC: <kernel_riscv64> STrap + 539
FP: 0x80b319c0, PC: <kernel_riscv64> SVecU + 109
FP: 0xffffffe358fb2468, PC: <libstdc++.so.6.0.25_seg0ro> 0x9d8eb
FP: 0x43, PC: 0xffffffffffffffff
kdebug> 
7 Likes

I feel that it is easier to throw away ICU than investigating why it crash.

2 Likes

I removed ICU dependency from libbe.so, but crash seems to be the same. It seems to crash when calling constructor of global variable std::__ioinit.

UPDATE: I found that std::__ioinit is inserted by #include <iostream>. Deleting #include <iostream> from libbe.so code fixes issue. It seems to be never actually used.

arch_thread_init_kthread_stack(0x000000008129b400(launch_daemon), 0x0000000080b2d000, 0x0000000080b31fb0, <kernel_riscv64> _ZL19common_thread_entryPv + 0, 0x0000000080b31fb0)
arch_thread_init_tls(0x000000008129b400(launch_daemon))
  thread->user_local_storage: 0xffffffed13a66000)
arch_thread_enter_uspace(0x000000008129b400(launch_daemon), 0xfffffff214c56e24, 0xffffffed13a66200, 0xffffffe99170e000)
  sscratch: 0x8129b780, 0x8129b780
runtime_loader entry point
TLS: 0xffffffed13a66000
image->regions[1]: 31000, 345c8
image->regions[1]: 2d7000, 303730
image->regions[1]: 31000, 331b0
image->regions[2]: 31000, 36d50
image->regions[1]: 5b5a0, 5fa18
image->regions[1]: 160650, 16ca08
image->regions[2]: 160650, 168378
image->regions[1]: de000, eb4c8
image->regions[2]: de000, 122480
image->regions[1]: 10000, 103e0
image->regions[1]: 1b000, 1b4a0
image->regions[1]: 5000, 5468
image->regions[1]: 18807b8, 1880928
image->regions[1]: 219448, 22d708
image->regions[1]: e010, f380
image->regions[1]: 2c000, 2db08
image->regions[2]: 2c000, 5de18
image->regions[1]: 160578, 174088
unhandled relocation type R_RISCV_TLS_DTPMOD64
Last message repeated 2 times.
unhandled relocation type R_RISCV_TLS_DTPREL64
unhandled relocation type R_RISCV_TLS_DTPMOD64
unhandled relocation type R_RISCV_TLS_DTPREL64
+init: libgcc_s.so.1
(1)
(2)
(3)
(4)
-init: libgcc_s.so.1
+init: libroot.so
(1)
(2)
init_array[0]: 0xfffffff8fe470136
init_array[1]: 0xfffffff8fe470100
init_array[2]: 0xfffffff8fe4701d0
init_array[3]: 0xfffffff8fe47019a
init_array[4]: 0xfffffff8fe470164
init_array[5]: 0xfffffff8fe470206
init_array[6]: 0xfffffff8fe4702ac
(3)
(4)
-init: libroot.so
+init: libstdc++.so.6
(1)
(2)
init_array[0]: 0xffffffe3df587bac
init_array[1]: 0xffffffe3df587c20
init_array[2]: 0xffffffe3df587c92
init_array[3]: 0xffffffe3df587dbe
init_array[4]: 0xffffffe3df587e8e
init_array[5]: 0xffffffe3df587ece
init_array[6]: 0xffffffe3df587f70
init_array[7]: 0xffffffe3df588012
init_array[8]: 0xffffffe3df588104
(3)
(4)
-init: libstdc++.so.6
+init: libz.so.1
(1)
(2)
(3)
(4)
-init: libz.so.1
+init: libbe.so
(1)
(2)
init_array[0]: 0xffffffe6b1a7743a
init_array[1]: 0xffffffe6b1a77404
init_array[2]: 0xffffffe6b1a773c6
init_array[3]: 0xffffffe6b1a77356
init_array[4]: 0xffffffe6b1a77620
init_array[5]: 0xffffffe6b1a775b2
init_array[6]: 0xffffffe6b1a77580
init_array[7]: 0xffffffe6b1a7754a
vm_soft_fault: va 0x0 not covered by area in address space
vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x18, ip 0xffffffe3df58b8ec, write 0, user 1, thread 0x92
PANIC: user_debug_exception_occurred(2, 11)
Welcome to Kernel Debugging Land...
Thread 146 "launch_daemon" running on CPU 0
Stack:
FP: 0x80b315a0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80b31610, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80b31650, PC: <kernel_riscv64> panic + 93
FP: 0x80b316f0, PC: <kernel_riscv64> user_debug_exception_occurred + 31
FP: 0x80b317e0, PC: <kernel_riscv64> vm_page_fault + 405
FP: 0x80b318c0, PC: <kernel_riscv64> STrap + 539
FP: 0x80b319c0, PC: <kernel_riscv64> SVecU + 109
FP: 0xffffffe3df661468, PC: <libstdc++.so.6.0.25_seg0ro> 0x9d8eb
FP: 0x43, PC: 0xffffffffffffffff
7 Likes

Dependencies are loaded and initalized. launch_daemon entry point is called. Something is broken then launch_daemon created new thread.

UPDATE: seems to unrelated to threads, someone is attempting to execute heap memory.

arch_thread_init_kthread_stack(0x000000008129b400(launch_daemon), 0x0000000080b2d000, 0x0000000080b31fb0, <kernel_riscv64> _ZL19common_thread_entryPv + 0, 0x0000000080b31fb0)
arch_thread_init_tls(0x000000008129b400(launch_daemon))
  thread->user_local_storage: 0xffffffed13a66000)
arch_thread_enter_uspace(0x000000008129b400(launch_daemon), 0xfffffff214c56e24, 0xffffffed13a66200, 0xffffffe99170e000)
  sscratch: 0x8129b780, 0x8129b780
runtime_loader entry point
TLS: 0xffffffed13a66000
image->regions[1]: 31000, 345c8
image->regions[1]: 2d70d8, 3037c0
image->regions[1]: 31000, 331b0
image->regions[2]: 31000, 36d50
image->regions[1]: 600f0, 644e8
image->regions[1]: 160650, 16ca08
image->regions[2]: 160650, 168378
image->regions[1]: de000, eb4c8
image->regions[2]: de000, 122480
image->regions[1]: 10000, 103e0
image->regions[1]: 1b000, 1b4a0
image->regions[1]: 6428, 6890
unhandled relocation type R_RISCV_TLS_DTPMOD64
Last message repeated 2 times.
unhandled relocation type R_RISCV_TLS_DTPREL64
unhandled relocation type R_RISCV_TLS_DTPMOD64
unhandled relocation type R_RISCV_TLS_DTPREL64
INIT: launch_daemon started
+init: libgcc_s.so.1
(1)
(2)
(3)
(4)
-init: libgcc_s.so.1
+init: libroot.so
(1)
(2)
init_array[0]: 0xfffffffe01b7c136
init_array[1]: 0xfffffffe01b7c100
init_array[2]: 0xfffffffe01b7c1d0
init_array[3]: 0xfffffffe01b7c19a
init_array[4]: 0xfffffffe01b7c164
init_array[5]: 0xfffffffe01b7c206
init_array[6]: 0xfffffffe01b7c2ac
(3)
(4)
-init: libroot.so
+init: libstdc++.so.6
(1)
(2)
init_array[0]: 0xffffffe3df587bac
init_array[1]: 0xffffffe3df587c20
init_array[2]: 0xffffffe3df587c92
init_array[3]: 0xffffffe3df587dbe
init_array[4]: 0xffffffe3df587e8e
init_array[5]: 0xffffffe3df587ece
init_array[6]: 0xffffffe3df587f70
init_array[7]: 0xffffffe3df588012
init_array[8]: 0xffffffe3df588104
(3)
(4)
-init: libstdc++.so.6
+init: libz.so.1
(1)
(2)
(3)
(4)
-init: libz.so.1
+init: libbe.so
(1)
(2)
init_array[0]: 0xffffffe6b1a7729a
init_array[1]: 0xffffffe6b1a77264
init_array[2]: 0xffffffe6b1a77226
init_array[3]: 0xffffffe6b1a771b6
init_array[4]: 0xffffffe6b1a7744a
init_array[5]: 0xffffffe6b1a773dc
init_array[6]: 0xffffffe6b1a773aa
init_array[7]: 0xffffffe6b1a77374
init_array[8]: 0xffffffe6b1a77306
init_array[9]: 0xffffffe6b1a772d0
init_array[10]: 0xffffffe6b1a7749c
init_array[11]: 0xffffffe6b1a77466
init_array[12]: 0xffffffe6b1a774d2
(3)
(4)
-init: libbe.so
+init: libbsd.so
(1)
(2)
(3)
(4)
-init: libbsd.so
+init: libnetwork.so
(1)
(2)
init_array[0]: 0xffffffd2dc86fc90
(3)
(4)
-init: libnetwork.so
+init: libbnetapi.so
(1)
(2)
init_array[0]: 0xffffffd1dfbf4540
init_array[1]: 0xffffffd1dfbf45b8
init_array[2]: 0xffffffd1dfbf45ee
init_array[3]: 0xffffffd1dfbf4636
(3)
(4)
-init: libbnetapi.so
+init: _APP_
(1)
(2)
init_array[0]: 0xffffffe8d0f05214
init_array[1]: 0xffffffe8d0f0524c
init_array[2]: 0xffffffe8d0f05308
(3)
(4)
-init: _APP_
runtime_loader: call entry point
launch_daemon entry point
arch_thread_init_kthread_stack(0x000000008129c180(main worker), 0x000000008098a000, 0x000000008098efb0, <kernel_riscv64> _ZL19common_thread_entryPv + 0, 0x000000008098efb0)
load_driver_settings("/safemode/")
load_driver_settings("kernel")
instruction fetch attempted on execute-protected area 0x175 at 0xfffffff72151b000
vm_page_fault: vm_soft_fault returned error 'Permission denied' on fault at 0xfffffff72151b0c8, ip 0xfffffff72151b0c8, write 0, user 1, thread 0x92
PANIC: user_debug_exception_occurred(2, 11)
Welcome to Kernel Debugging Land...
Thread 146 "launch_daemon" running on CPU 0
Stack:
FP: 0x80b315a0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80b31610, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80b31650, PC: <kernel_riscv64> panic + 93
FP: 0x80b316f0, PC: <kernel_riscv64> user_debug_exception_occurred + 31
FP: 0x80b317e0, PC: <kernel_riscv64> vm_page_fault + 405
FP: 0x80b318c0, PC: <kernel_riscv64> STrap + 539
FP: 0x80b319c0, PC: <kernel_riscv64> SVecU + 109
FP: 0x0, PC: <heap> 0x170c7
7 Likes

I solved mystery with strtoull(). It was another miscompilation caused by version declaration (__asm__(".symver ...")). In this case this is fstat(). Currently .symver directive should be never used because it cause disastrous results such as jumping to some random code locations and corrupting stack. Hopefully BeOS compatibility in RISC-V is not needed because BeOS was never run on RISC-V.

13 Likes

Userland symbol name resolving is working, but it is extremely slow (I use default kernel symbol name resolver).

Also after removing all .symver that cause miscompilation, launch_daemon is continiously executing without crashes and it now switching user threads. But I currently don’t know what it exactly doing, it supposed to enter idle loop bylocking on something, but it is continuously invoking syscalls.

I enabled generic user_memcpy() etc. implementation found in arch/generic/user_memory.h, it works perfectly and it allows to avoid recursive kernel crashes when displaying stack trace of corrupted stack.

STrap(exception uEcall)
  sstatus: (ie: {u}, pie: {s}, spp: u, fs: 3, sum: 1)
  sepc: <libroot.so> _kern_find_thread + 4
  sie: {sExtern}
  sip: {}
  sscratch: 0x32, 0x8129b780
  tp: 0x8129b400(launch_daemon)
  trap level: 0x1
  syscall 50(_kern_find_thread)
Stack:
FP: 0x80b318c0, PC: <kernel_riscv64> STrap + 1491
FP: 0x80b319c0, PC: <kernel_riscv64> SVecU + 109
FP: 0xffffffed13a655a0, PC: <libroot.so> _kern_find_thread + 3
FP: 0xffffffed13a655d0, PC: <libroot.so> realloc + 97
FP: 0xffffffed13a65600, PC: <libbe.so> _ZN7BString7_ResizeEi + 65
FP: 0xffffffed13a65620, PC: <libbe.so> _ZN7BString13_MakeWritableEib + 103
FP: 0xffffffed13a65650, PC: <libbe.so> _ZN7BString9_DoAppendEPKci + 51
FP: 0xffffffed13a65670, PC: <libbe.so> _ZN7BStringpLEPKc + 53
FP: 0xffffffed13a65720, PC: <libbe.so> _ZN8BPrivate14DefaultCatalog25ReadFromStandardLocationsEv + 167
FP: 0xffffffed13a65800, PC: <libbe.so> _ZN8BPrivate14DefaultCatalogC1ERK9entry_refPKcj + 327
FP: 0xffffffed13a65830, PC: <libbe.so> _ZN8BPrivate14DefaultCatalog11InstantiateERK9entry_refPKcj + 51
FP: 0xffffffed13a65970, PC: <libbe.so> _ZNK8BPrivate19MutableLocaleRoster11LoadCatalogERK9entry_refPKci + 213
FP: 0xffffffed13a659c0, PC: <libbe.so> _ZN8BCatalog5SetToERK9entry_refPKcj + 71
FP: 0xffffffed13a65ea0, PC: <libbe.so> _ZNK8BPrivate19MutableLocaleRoster17LoadSystemCatalogEP8BCatalog + 189
FP: 0xffffffed13a65f60, PC: </boot/system/runtime_loader> 0xb001
FP: 0xffffffed13a65fc0, PC: </boot/system/runtime_loader> 0xb783
FP: 0xffffffed13a66000, PC: </boot/system/runtime_loader> 0x11ef9
FP: 0x80b319f0, PC: <kernel_riscv64> arch_thread_enter_userspace + 161
FP: 0x80b31a30, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
FP: 0x80b31a90, PC: <kernel_riscv64> thread_enter_userspace_new_team + 53
FP: 0x80b31f80, PC: <kernel_riscv64> _ZL33team_create_thread_start_internalPv + 547
FP: 0x80b31f90, PC: <kernel_riscv64> _ZL24team_create_thread_startPv + 11
FP: 0x80b31fb0, PC: <kernel_riscv64> _ZL19common_thread_entryPv + 49
FP: 0x0, PC: <kernel_riscv64> arch_thread_entry + 3
8 Likes