-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Stack overflow in stress test of asynchttpserver on Windows [DEBUG] #3919
Comments
Caused by proc nimFrame(s: PFrame) {.compilerRtl, inl, exportc: "nimFrame".} =
s.calldepth = if framePtr == nil: 0 else: framePtr.calldepth+1
s.prev = framePtr
framePtr = s
if s.calldepth == 2000: stackOverflow() @Araq, by the way, maybe there must be the compiler switch, that defines maximum calldepth? |
What was the code that you used for this on the client and server side? |
Server side is asynchttpserver.nim's code.
Client side is wrk's https://github.com/wg/wrk default request.
|
Looks like a problem with GC, try |
@dom96, problem is not in GC. Now i'm completely sure that problem is here: |
@dom96 this is reminder comment for you. The best place to put callSoon() would be https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L260. I have already tested this variant and it works good, the only problem is strange errors and big amount of warnings... So please do it for yourself. |
Introduce `callSoon` procedure to dispatch user callbacks in pool() context.
I made wrk's stress test from Linux VM (guest) to Windows (host) asynchttpserver.nim.
And got an error.
There 4 compilation variants i have tested.
wrk options was "wrk -d 10"
All tests was performed on current devel version of nim repository.
x86_64-w64-mingw32 (4.8.3) / "nim c asynchttpserver.nim"
HOST:
GUEST:
x86_64-w64-mingw32 (4.8.3) / "nim c -d:release asynchttpserver.nim"
HOST:
NO ERROR
GUEST:
vcc (19.00.23506 for x64) / "nim c asynchttpserver.nim"
HOST:
GUEST:
vcc (19.00.23506 for x64) / "nim c -d:release asynchttpserver.nim"
HOST:
NO ERROR
GUEST:
The text was updated successfully, but these errors were encountered: