Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
unexpected behavior from cglobal pointers #2501
I was playing around with the NCurses bindings and ran into an issue with a cglobal pointer.
ncurses exports a variable pointer $stdscr, which is in turn accessed in the NCurses module by cglobal. (returning a class which
The standard ncurses
The program unexpectedly crashes.
Output (run with
Steps to Reproduce
The issue with NCurses can be reproduced with the following code:
The corresponding C code compiles and executes correctly.
I seem to be able to avoid the problem if I avoid using cglobal pointers. The following executes as expected:
OK, after playing around, I have a better minimal example:
in libtest.c (compiled with
No segfault this time, but the cglobal pointer in