PANIC: page fault, but interrupts were disabled
|Reported by:||th-otto||Owned by:||nobody|
|Has a Patch:||no||Platform:||x86-64|
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.