Hi,
I'm currently trying getting the following code to work:
import httpclient
import threadpool
proc check() =
discard newHttpClient()
spawn check()
it compiles successfully but crashes as soon as it reaches the newHttpClient() line. I already tried using different GC's, current command: nim c -r --threads:on -d:ssl --mm:arc test.nim
It indeed segfaults for me as well.
Traceback (most recent call last)
/home/davide/.choosenim/toolchains/nim-1.6.4/lib/pure/concurrency/threadpool.nim(368) slave
/tmp/a.nim(7) checkWrapper
/home/davide/.choosenim/toolchains/nim-1.6.4/lib/pure/httpclient.nim(569) check
/home/davide/.choosenim/toolchains/nim-1.6.4/lib/pure/httpclient.nim(338) getDefaultSSL
/home/davide/.choosenim/toolchains/nim-1.6.4/lib/pure/net.nim(631) newContext
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Error: execution of an external program failed: '/home/davide/.cache/nim/a_d/a_03FD62631F8DC94835C55F6A6528282F2E572963 '
Nim version: 1.6.4. OS: Arch Linux.
The issue is caused by newCTX being nil at line 631 of net.nim.
It works fine this way:
import httpclient
import threadpool
proc check() =
discard newHttpClient()
parallel:
spawn check()