SIGSEGV handler conflict with Wine's exception handler coordination question
- Dominant language
- C++
- Stars
- 8k
- Forks
- 351
- Avg merge
- 12h 31m
- Merged PRs (30d)
- 102
Description
I've been running into edge cases where FEX's signal handling and Wine's exception handling step on each other, and I wanted to check whether this is a known issue or expected behavior.
Setup: FEXcore (ARM64EC mode) inside Bannerlator, running Windows x86_64 games through Wine 9.x on Android 14 / Mali-G57 MC2.
The issue manifests as occasional game crashes that look like SIGSEGV being delivered to the wrong handler. From what I can tell from the code:
- FEX registers a SIGSEGV handler to catch faults inside translated x86_64 code and recover via emulation
- Wine also registers SIGSEGV handler for Windows SEH (Structured Exception Handling) and guard page handling
- Only one handler actually gets called per signal — depending on registration order, either FEX recovers when it shouldn't, or Wine tries to handle a FEX-internal fault
In practice this shows up as:
- Random game crashes after ~30 min of play
- Stack traces that don't make sense (Wine frames inside FEX JIT cache)
- Some games (MiSide in particular) crash reproducibly on certain operations that I suspect trigger SEH
I noticed FEX has `ConfigureSignalHandler` and there's some logic for chaining to the previous handler — but it's not clear to me whether Wine's handler is the "previous" one in this setup, or whether there's an explicit handshake between FEX and Wine that I'm missing.
Questions:
- Is FEX supposed to call the previous sigaction when the fault is outside translated code? As far as I can tell from `SignalDelegator.cpp` it does, but maybe there's an edge case.
- Does FEX test against Wine's signal handler specifically, or only against generic Linux apps?
- Any recommended env vars or config to make FEX more cooperative with Wine's exception model?
Not sure if this is a bug or just a documentation gap. Happy to provide logs / repro steps if useful.
Device: Realme 10 / Helio G99 / Android 14 / Wine 9.x.
Contributor guide
Research direction
Start with SignalDelegator.cpp and ConfigureSignalHandler, then reproduce the crash under the stated FEXcore ARM64EC, Wine 9.x, and Android 14 setup. Trace whether faults outside translated code reach the previous sigaction and whether FEX has Wine-specific handling or configuration. Done means a confirmed handler interaction, useful logs and repro steps, and either a focused fix or documented behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, cpp, linux
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100