Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEV with --mm:orc and --threads:on #213

Open
termermc opened this issue Mar 1, 2023 · 1 comment
Open

SIGSEV with --mm:orc and --threads:on #213

termermc opened this issue Mar 1, 2023 · 1 comment

Comments

@termermc
Copy link

termermc commented Mar 1, 2023

Descrption

Prologue applications SIGSEV when using ORC with threads enabled.

Test program

import prologue

proc hello*(ctx: Context) {.async.} =
  resp "<h1>Hello, Prologue!</h1>"

let app = newApp(settings = newSettings(debug = false))
app.get("/", hello)
app.run()

Command

nim r -d:release --mm:orc --threads:on src/prologuetest.nim

Steps to reproduce

  • Use the above code and command (adapted to your setup) to execute the program.
  • Send requests to the server concurrently.
    • I used bombardier with the command bombardier -c 3 -d 30s http://localhost:8080 to send requests with 3 connections for a maximum if 30 seconds (it crashed in a second or two, well before the 30s mark)
    • You can use wrk instead of bombardier if you want
  • Watch it SIGSEV

Command Output

This is the output of running the program, including when I started hitting it with requests:

/t/prologuetest ❯❯❯ nim r -d:release --mm:orc --threads:on src/prologuetest.nim
Hint: used config file '/home/termer/.choosenim/toolchains/nim-1.6.10/config/nim.cfg' [Conf]
Hint: used config file '/home/termer/.choosenim/toolchains/nim-1.6.10/config/config.nims' [Conf]
Hint: used config file '/tmp/prologuetest/config.nims' [Conf]
Hint: gc: orc; threads: on; opt: speed; options: -d:release
19464 lines; 0.019s; 16.555MiB peakmem; proj: /tmp/prologuetest/src/prologuetest.nim; out: /home/termer/.cache/nim/prologuetest_r/prologuetest_2C3ECAC42048EEF172BBC7FB007EB4C0E8841BAD [SuccessX]
Hint: /home/termer/.cache/nim/prologuetest_r/prologuetest_2C3ECAC42048EEF172BBC7FB007EB4C0E8841BAD  [Exec]
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Error: execution of an external program failed: '/home/termer/.cache/nim/prologuetest_r/prologuetest_2C3ECAC42048EEF172BBC7FB007EB4C0E8841BAD '

Notes

This is not an httpx or httpbeast problem, as running their benchmark programs with the same options and slamming them with concurrent requests does not cause any crashes.

@ITwrx
Copy link

ITwrx commented Dec 11, 2023

Just as another data point: I wrote a website (portfolio type with admin area for adding projects, blog posts, etc) using Prologue a couple years ago, and once deployed, it was crashing with this error, IIRC. I pulled off of nim for a year or so after that due to being burned, and not seeing a suitable alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants