guzba / mummy

An HTTP and WebSocket server for Nim that returns to the ancient ways of threads.
MIT License
281 stars 11 forks source link

Segfault while a wrk test #8

Closed sungchulTW closed 1 year ago

sungchulTW commented 1 year ago

Hello. I am trying this awesome framework. Thank you for this package.

Today, I met an error (sigsegv) with the simple example server. with a nim version from the #devel channel

nim c --mm:orc --threads:on -d:release -r mum.nim Hint: used config file '/home/username/.choosenim/toolchains/nim-#devel/config/nim.cfg' [Conf] Hint: used config file '/home/username/.choosenim/toolchains/nim-#devel/config/config.nims' [Conf] Hint: mm: orc; threads: on; opt: speed; options: -d:release 10069 lines; 0.020s; 10.484MiB peakmem; proj: /home/username/Local/momtest/mum.nim; out: /home/username/Local/momtest/mum [SuccessX] Hint: /home/username/Local/momtest/mum [Exec] Serving on http://localhost:8080 Traceback (most recent call last) /home/username/.nimble/pkgs/mummy-0.1.0/mummy.nim(508) workerProc /home/username/.nimble/pkgs/mummy-0.1.0/mummy.nim(427) runTask /home/username/Local/momtest/mum.nim(9) handler /home/username/.nimble/pkgs/mummy-0.1.0/mummy.nim(307) respond /home/username/.choosenim/toolchains/nim-#devel/lib/system/arc.nim(66) nimNewObj /home/username/.choosenim/toolchains/nim-#devel/lib/system/alloc.nim(1048) alloc /home/username/.choosenim/toolchains/nim-#devel/lib/system/alloc.nim(854) rawAlloc /home/username/.choosenim/toolchains/nim-#devel/lib/system/alloc.nim(791) compensateCounters /home/username/.choosenim/toolchains/nim-#devel/lib/system/alloc.nim(764) addToSharedFreeList SIGSEGV: Illegal storage access. (Attempt to read from nil?) Segmentation fault (core dumped) Error: execution of an external program failed: '/home/username/Local/momtest/mum'

guzba commented 1 year ago

Hello and thanks for the report. On Nim's devel branch there is an issue with the allocator. The Nim team is aware of this and it'll hopefully be fixed soon. In the meantime I have heard that -d:useMalloc works on devel.