blob: d0b09673cd0c34e807a2fa3210f17ba93df3736b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
The crash occurs when running a conftest program on qemu-sh4 that works correctly on a real SH7785LCR board. The issue seems to be related to how the setcontext function is handled in QEMU for the SH4 architecture.
Looking at the provided code, it's using `ucontext.h` and `pthread.h`, which are standard libraries for context switching and threading. The test sets up a thread with TLS (Thread Local Storage) and uses `makecontext` and `setcontext` to switch execution contexts.
The error message from QEMU indicates an "Unhandled trap: 0x180" at the instruction pointer `pc=0x7f69235e`. This suggests that during the execution of the context switch, an unexpected exception or interrupt is being triggered. On the real hardware, this doesn't happen, implying that either QEMU's emulation isn't handling the SH4 architecture correctly in this scenario or there's a bug in how the setcontext function is implemented or used.
Given that the problem arises during runtime when executing specific instructions (the context switch), and since it works on real hardware but not in QEMU, it points towards an issue with QEMU's handling of the SH4 architecture for certain operations, possibly related to exception handling or stack switching.
Therefore, this bug falls under the **instruction** category as it involves a problem with how instructions are executed in the emulator.
|