Skip to content

Commit ff2e7a6

Browse files
committed
reenable on windows
we're about to terminate anyway
1 parent 7be3c42 commit ff2e7a6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/system/excpt.nim

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -655,11 +655,13 @@ when not defined(noSignalHandler) and not defined(useNimRtl):
655655
when defined(memtracker):
656656
logPendingOps()
657657
# On windows, it is common that the signal handler is called from a non-Nim
658-
# thread - until `rawWriteStackTrace` and friends learns to not allocate
659-
# memory, we'll skip the memory allocation and avoid crashes this way
660-
# On other platforms, the memory allocation may still cause crashes, but
661-
# not as frequently. YOLO.
662-
when hasSomeStackTrace and not defined(windows):
658+
# thread and any allocation will (likely) cause a crash.
659+
# On other platforms, if memory needs to be allocated and the signal happens
660+
# during memory allocation, we'll alos (likely) see a crash and corrupt the
661+
# memory allocator - less frequently than on windows but still.
662+
# However, since we're about to go down anyway, YOLO.
663+
664+
when hasSomeStackTrace:
663665
when not usesDestructors: GC_disable()
664666
rawWriteStackTrace(sigHandlerBuf)
665667
processSignal(sign, sigHandlerBuf.add) # nice hu? currying a la Nim :-)

0 commit comments

Comments
 (0)