dom96 / jester

A sinatra-like web framework for Nim.
MIT License
1.57k stars 120 forks source link

Runtime SIGBUS: #305

Open ynfle opened 1 year ago

ynfle commented 1 year ago
import jester

const cookies = {
  "a": "a",
  "b": "b",
  "c": "c",
  "d": "d",
  "e": "e",
  "f": "f"
}.toTable

proc myrouter(request: Request): Future[ResponseData] {.async.} =
  block route:
    for name, cookie in cookies:
      setCookie(name, cookie)
    resp Http200

var j = initJester myrouter
j.serve

fails at runtime when the endpoint is hit with SIGBUS: Illegal storage access. (Attempt to read from nil?)

This is only with the refc gc, but linux and Windows don't have the crash with orc. macOS still crashes, though

ArikRahman commented 1 year ago

I actually have that same error with orc. It works occasionally, just a timing issue, I have to spam execute the server executable until it works. There is some conversation about it here as well:

https://forum.nim-lang.org/t/9767