From 18cf12f622e530663857553673b4fee3df2ef7b9 Mon Sep 17 00:00:00 2001 From: Ivan FB Date: Fri, 12 Jun 2026 00:26:31 +0200 Subject: [PATCH] debug: enable Nim signal handler for libsds traceback on SIGSEGV Co-Authored-By: Claude Opus 4.8 --- sds.nimble | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sds.nimble b/sds.nimble index 80a9d29..2293e83 100644 --- a/sds.nimble +++ b/sds.nimble @@ -38,8 +38,11 @@ proc buildLibrary( " --threads:on --app:lib --opt:size --noMain --mm:refc --header --nimMainPrefix:libsds -d:noSignalHandler " & extra_params & " " & srcDir & name & ".nim" else: + # TEMP DEBUG: enable Nim's signal handler (drop -d:noSignalHandler, pass the + # nim-ffi guard via -d:ffiAllowSignalHandler) + stack/line traces so a SIGSEGV + # prints a Nim file:line traceback instead of being swallowed by Go's handler. exec "nim c" & " --out:build/" & outLibNameAndExt & - " --threads:on --app:lib --opt:size --noMain --mm:refc --header --nimMainPrefix:libsds -d:noSignalHandler " & + " --threads:on --app:lib --opt:size --noMain --mm:refc --header --nimMainPrefix:libsds -d:ffiAllowSignalHandler --stackTrace:on --lineTrace:on " & extra_params & " " & srcDir & name & ".nim" proc getMyCpu(): string =