Open racerxdl opened 4 months ago
My wild guess is running out of memory or some internal buffers causing this null pointer.
Just checked memory usage, its suspicously high. The application crashed with almost 2GB of reserved memory, and my mapped memory is only about 256MB. Still, the host has plently of room (64GB).
I am encountering the same segfault in tb_set_jmp_target_arm
. I do notice that my memory usage also rises to about 2GB but I have about 32GB of ram on my host. I don't quite have a minimal reproduction code yet.
I encountered the segfault because I'm running emu_start
in a loop, and unicorn segfaults after the loop runs a few million times.
For what it's worth, my workaround is once every million times in the loop, save the context, destroy the emulator, create a new emulator, and restore the context. This seems to limit the memory usage and resolve whatever is causing the segfault.
I encountered the segfault because I'm running
emu_start
in a loop, and unicorn segfaults after the loop runs a few million times.For what it's worth, my workaround is once every million times in the loop, save the context, destroy the emulator, create a new emulator, and restore the context. This seems to limit the memory usage and resolve whatever is causing the segfault.
That's a clever way of avoiding the crash. I will use it :P - Thanks!
I was doing some emulation reverse engineering work with Unicorn Engine (emulating x86 realmode bootloader) and after a long time running the session I got this nullptr dereference (segfault). Sadly the payload I'm running is private (I can't share), but I might be able to fix, but I didnt find any reason why that would be null.
It seens that TranslationBlock got the tc.ptr as null, and that gave the dereference. I'm not sure what could be causing it. I was using the upstream version of unicorn with python bindings, but when I got the segfault (is consistenly, I will try run a session saving each code block it tries to execute to have a rough idea where it crashed), I got the latest dev branch and build in debug mode.
Backtrace: