The first example
import serial
for port in listSerialPorts():
echo port
compile with
nim c --stacktrace:on example.nim
Compilation works es expected. But running the produced binary results in
Traceback (most recent call last)
/Users/martin/.nimble/pkgs2/serial-1.2.0-85079d0e3a6e3f1478357c016e03308b8ede3a05/serial/private/utils/list_serialports_mac.nim(96) example
/Users/martin/.nimble/pkgs2/serial-1.2.0-85079d0e3a6e3f1478357c016e03308b8ede3a05/serial/private/utils/list_serialports_mac.nim(84) getDeviceName
/usr/local/Cellar/nim/2.2.2/nim/lib/system/arc.nim(188) nimRawDispose
/usr/local/Cellar/nim/2.2.2/nim/lib/system/alloc.nim(1165) dealloc
/usr/local/Cellar/nim/2.2.2/nim/lib/system/alloc.nim(1063) rawDealloc
/usr/local/Cellar/nim/2.2.2/nim/lib/system/alloc.nim(815) addToSharedFreeListBigChunks
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Compiling with --mm:refc creates binary which works, but no serial ports are listed. (MacOS 15.3)