You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use the main processing loop of a C-library, which implements specific functionality in callbacks.
The callbacks shall be implemented in Julia. The following MWE demonstrates the difficulties, when the callback functions are invoked from POSIX-threads, which have been launched in C.
make run
/home/crusius/julia/julia --startup-file=no callmtcb.jl
called f1()
signal (11): Segmentation fault
in expression starting at /home/crusius/dev/FuseApi/test/embed/callmtcb.jl:11
Allocations: 2749 (Pool: 2739; Big: 10); GC: 0
make: *** [Makefile:18: run] Segmentation fault (core dumped)
A gdb session revealed, that the callback to f2 propagates into the call to exit(99) and then fails.
Actually the threads local variable jl_pgcstack is not initialized, so the Julia runtime has no chance to succeed.
I want to use the main processing loop of a C-library, which implements specific functionality in callbacks.
The callbacks shall be implemented in Julia. The following MWE demonstrates the difficulties, when the callback functions are invoked from POSIX-threads, which have been launched in C.
callmtcb.jl
libmtcb.c
Result of execution:
A
gdb
session revealed, that the callback tof2
propagates into the call toexit(99)
and then fails.Actually the threads local variable
jl_pgcstack
is not initialized, so the Julia runtime has no chance to succeed.The test files and the setup for a debug session are found here: https://github.com/KlausC/FuseApi.jl/blob/main/test/embed/
There is a
Makefile
withrun
anddebug
targets to explore the example under Linux and Gnome.The text was updated successfully, but these errors were encountered: