Opened 16 months ago

Closed 6 months ago

#14017 closed bug (duplicate)

PANIC: page fault, but interrupts were disabled

Reported by: th-otto Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/Kernel Version: R1/Development
Keywords: Cc: jua
Blocked By: #14711 Blocking:
Has a Patch: no Platform: x86-64

Description

While trying to implement JIT in ARAnyM (https://github.com/aranym/aranym), i get the above mentioned panic message.

JIT compiled code in ARAnyM works by catching SIGSEGVs on I/O addresses that are deliberately marked as anonymous. To make this work, a signal handler is installed that takes the extra sigcontext_t and ucontext_t parameters. The handler then either emulates the faulting instruction (if it was a valid I/O address), or jumps back to the main execution loop. This approach currently works on linux, all flavours of BSD, macOS, Win32 etc. Porting that code to Haiku just required to take the different layout of the ucontext_t structure into account. However, when i run the executable, i enter KDL.

The attached small program illustrates the basics of how the code should work. That small program works as expected, though, and does not panic.

To reproduce the problem:

  • clone the git repository https://github.com/aranym/aranym.git
  • apply the small patch attached below (the configure script currently disables JIT configuration on Haiku, because of the crash)
  • recreate the scripts, and configure for JIT: $ ./autogen.sh --prefix=/boot/system --disable-sdl2 --enable-jit-compiler

You will also need some TOS image to run aranym, otherwise it won't do anything. For legal reasons, it cannot be attached here, but EmuTOS (https://github.com/emutos/emutos/archive/VERSION_0_9_9_1.tar.gz) will do.

System was build from a nightly iso image a few days ago, updated to hrev51826. Compiler in use is GCC 5.4. All components were installed from HaikuDepot. The system runs in VirtualBox 5.2.6, on a linux host.

Attachments (3)

segv.c (1.5 KB) - added by th-otto 16 months ago.
Small sample code
aranym-JIT-KDL.png (19.1 KB) - added by th-otto 16 months ago.
Screenshot of panic message
aranym-git.patch (550 bytes) - added by th-otto 16 months ago.
Patch to enable jit compilation on Haiku

Download all attachments as: .zip

Change History (5)

Changed 16 months ago by th-otto

Attachment: segv.c added

Small sample code

Changed 16 months ago by th-otto

Attachment: aranym-JIT-KDL.png added

Screenshot of panic message

comment:1 Changed 16 months ago by waddlesplash

Cc: jua added

Julian touched this kernel component recently, perhaps he might have some idea of what a fix would be?

Changed 16 months ago by th-otto

Attachment: aranym-git.patch added

Patch to enable jit compilation on Haiku

comment:2 Changed 6 months ago by waddlesplash

Blocked By: 14711 added
Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.