https://github.com/iron-software/cefstackunwindingbug
Demonstrates a potential bug regarding CEF initialization via .NET interop on Linux machines
https://github.com/iron-software/cefstackunwindingbug
Last synced: 3 months ago
JSON representation
Demonstrates a potential bug regarding CEF initialization via .NET interop on Linux machines
- Host: GitHub
- URL: https://github.com/iron-software/cefstackunwindingbug
- Owner: iron-software
- Created: 2023-05-01T09:13:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-01T10:50:17.000Z (about 3 years ago)
- Last Synced: 2025-03-21T20:39:13.088Z (over 1 year ago)
- Language: C
- Size: 665 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CEF Interop / Stack Unwinding Bug Reproduction
_5/1/23_
## Build Steps
1. Build `CefInterop/CefInterop/CefInterop.csproj` for **net6.0/Debug/AnyCPU**
2. Build `CMakeLists.txt` in the root directory to generate native assets
3. Run `./copy.sh` from the root directory, to copy native assets into .NET app directory
4. Ensure the necessary Linux dependencies are installed (via apt-get) for CEF usage
5. Verify your .NET app runtime directory contains **CefInteropStackUnwinding.so, CefSubprocess, libcef.so**, and all of the other files necesssary for CEF runtime
## Run Steps
1. Either run CefInterop.dll via Visual Studio OR via command-line `dotnet CefInterop.dll`
## Expected Behavior
1. dotnet console app completes successfully without segmentation fault
2. dotnet console app prints `Successfully try/caught null ref!` TWO TIMES (once before Cef initialization, once afterwards)
## Observed Behavior
1. dotnet console app successfully catches any exceptions prior to CEF initialization, but fails to catch exceptions after CEF initialization
2. dotnet console app is unable to use breakpoints after CEF initialization (since `SIGTRAP` is just an exception anyway)
## Notes/Research
My best guess is that CEF breaks stack unwinding after intialization via interop, perhaps due to using `jmp` and/or the nature of the stack pointer during interop calls.