Skip to content

Commit 0f26ad8

Browse files
mgorges0-8-15
authored andcommitted
LANGUAGES: Fix silent segfault due to module dependency in part-cw#330
Using "(not safe)" in languages/scm.sh causes a segfault whenever apps include scheduler before ln_glgui in their MODULE list. This was extremely hard to debug as there is no crash dump, lldb only shows a jump error and it doesn't happen in debug mode. In the end the actual problem is (#!unbound2 frame-period-custom: '#<procedure #2>) caused by (glgui-timings-at-10msec!) being called in a function-exists? in modules/scheduler/scheduler.scm, while glgui-timings-set! is an internally declared function pointing to timings-set!, which is only initialized after the define of glgui-event runs. The solution is to either ensure scheduler is never listed before ln_glgui in MODULES, or fixing this by making it a scm_coremodules, which this change does. It is possible that this order change causes other problems for custom modules that need to be run before ln_glgui, but are not a scm_coremodules but the ones we ship are fine.
1 parent f0e039f commit 0f26ad8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

languages/scm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ compile_payload_scm()
2626
done
2727
# -------
2828
# generate list of source (scheme) files
29-
scm_coremodules=" syntax-case config eventloop ln_core ln_glcore "
29+
scm_coremodules=" syntax-case config eventloop ln_core ln_glcore ln_glgui "
3030
scm_coresrcs=
3131
scm_auxsrcs=
3232
for m in $modules; do

0 commit comments

Comments
 (0)