planety / prologue

Powerful and flexible web framework written in Nim
https://planety.github.io/prologue
Apache License 2.0
1.24k stars 47 forks source link

Trouble running with --threads:on #203

Closed guzba closed 1 year ago

guzba commented 1 year ago

Hello, I'm reporting some trouble I've been having trying to run Prologue with --threads:on

Here is my basic server:

import prologue

proc hello*(ctx: Context) {.async.} =
  resp "abcdefghijklmnopqrstuvwxyz"

let app = newApp()
app.get("/", hello)
app.run()

Then I test the server with wrk -t10 -c100 -d10s http://localhost:8080

Everything works as expected with:

nim c --mm:orc --threads:off -d:release -r tests/wrk_prologue.nim

However, the server segfaults when built with --threads:on

nim c --mm:orc --threads:on -d:release -r tests/wrk_prologue.nim

This is being built and run on an Ubuntu 22.04 server.

Nim Compiler Version 1.6.10 [Linux: amd64]
Compiled at 2022-11-21
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: f1519259f85cbdf2d5ff617c6a5534fcd2ff6942
active boot switches: -d:release

Is this maybe just happening for me? I'll try again in a while and see if things repeat.

ringabout commented 1 year ago

Perhaps some kind of ORC bug, it works with ARC.

guzba commented 1 year ago

Ah ok, yeah I was using orc. I'll close this since it sounds like the root cause may not be here.