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

Jester is not working with nim version 2.0.0 #321

Closed
AritraBanik08 opened this issue Aug 19, 2023 · 4 comments
Closed

Jester is not working with nim version 2.0.0 #321

AritraBanik08 opened this issue Aug 19, 2023 · 4 comments

Comments

@AritraBanik08
Copy link

Reasently I updated to nim version 2.0.0 but all my jester code is not working and is providing the error "Illegal Storage use". It is also showing the error while only creating a "Hello World" page.

@hoangpq
Copy link

hoangpq commented Aug 20, 2023

Me too, got this error "SIGSEGV: Illegal storage access. (Attempt to read from nil?)" when trying Nim 2.0.0

Stacktrace

^CTraceback (most recent call last)
jester_ex.nim(5) jester_ex
~/.nimble/pkgs2/jester-0.6.0-4834f85e61ae39f6b6acfb74d3bbba62d8779b66/jester.nim(527) serve
~/.nimble/pkgs2/httpbeast-0.4.1-b23e57a401057dcb9b7fae1fb8279a6a2ce1d0b8/httpbeast.nim(546) run
~/.choosenim/toolchains/nim-2.0.0/lib/pure/asyncdispatch.nim(377) eventLoop
~/.choosenim/toolchains/nim-2.0.0/lib/pure/ioselects/ioselectors_kqueue.nim(467) selectInto

# example.nim
import htmlgen
import jester

routes:
  get "/":
    resp h1("Hello world")
Nim Compiler Version 2.0.0 [MacOSX: amd64]
Compiled at 2023-08-08
Copyright (c) 2006-2023 by Andreas Rumpf

Try to import std/segfaults and it working, not sure the error

import htmlgen
import jester
import std/segfaults

routes:
  get "/":
    resp h1("Hello world")

Result

INFO Jester is making jokes at http://0.0.0.0:5000
Starting 12 threads
Listening on port 5000

@ThomasTJdev
Copy link
Contributor

httpbeast
This is properbly due to httpbeast dom96/httpbeast#80 / nim-lang/Nim#21422. This should be fixed with PR dom96/httpbeast#89 which besides the startup-proc also implemented an addExitProc() for the threads.

You can test whether this solution works by cloning the httpbeast repo by manually installing it:

git clone [email protected]:dom96/httpbeast.git
cd httpbeast
nimble install

For jester to use this new PR it requires @dom96 to release a new tag in the httpbeast repo, before jester will use this version of httpbeast.

Temporary solution
You can compile with nim c -d:dev -d:useStdLib -r server.nim where -d:useStdLib forces jester to use the standard lib instead of httpbeast.

@hoangpq
Copy link

hoangpq commented Aug 20, 2023

@ThomasTJdev Thank you ;)

@AritraBanik08
Copy link
Author

thanks

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

3 participants