Can't understand what's causes SIGSEGV in this code?
    
    
    import std/[httpcore, asynchttpserver, asyncnet, tables, asyncdispatch]
    
    proc build_http_handler(): proc (req: Request): Future[void] {.async, 
gcsafe.} =
      proc http_handler(req: Request): Future[void] {.async, gcsafe.} =
        await req.respond(Http200, "ok")
    
    var server = new_async_http_server()
    async_check server.serve(Port(5000), build_http_handler(), "localhost")
    run_forever()
    
    
    Run
    
    
    nim c -r --mm:orc --threads:off play.nim
    Traceback (most recent call last)
    /alex/projects/nim/play.nim(11) play
    /nim/lib/pure/asyncdispatch.nim(1956) runForever
    /nim/lib/pure/asyncdispatch.nim(1653) poll
    /nim/lib/pure/asyncdispatch.nim(1394) runOnce
    /nim/lib/pure/asyncdispatch.nim(234) processPendingCallbacks
    /nim/lib/pure/asyncmacro.nim(31) processRequestNimAsyncContinue
    /nim/lib/pure/asynchttpserver.nim(330) processRequestIter
    SIGSEGV: Illegal storage access. (Attempt to read from nil?)
    Error: execution of an external program failed: 
'/alex/projects/nim/build/play '
    
    
    Run

Reply via email to