-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Labels
Description
Summary
Found a potential C FFI regression with 1.6.2. A library of mine that has been in use for years has started crashing on 1.6.2. Tried turning off the GC with gc:none but the crash still happens, hence I think it's an FFI regression.
I can't really isolate it easily, but it's very easy to compile and run an example app included in the project that will result in a crash. No dependencies are required whatsoever.
Tested on
Win 10 (x64) and Mac OS X Big Sur 10.6.2 with Nim 1.6.2 and Nim 1.6.0
How to reproduce
- Check out this repo: https://github.com/johnnovak/nim-nanovg
- Compile & run the example with 1.6.2:
nimble examplesGL3Debug
cd examples
example_gl3.exe
- The program will immediately crash with the following error:
Traceback (most recent call last)
D:\Work\Code\nim-nanovg\examples\example_gl3.nim(161) example_gl3
D:\Work\Code\nim-nanovg\examples\example_gl3.nim(116) main
D:\Work\Code\nim-nanovg\examples\demo.nim(1017) renderDemo
D:\Work\Code\nim-nanovg\examples\demo.nim(305) drawEyes
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
- Repeat with 1.6.2 with
gc:noneor any other GC setting -- the exact same crash will happen - Repeat with 1.6.0 with any GC setting -- the program will run correctly (it will open a window with some OpenGL demo graphics)