nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.58k stars 1.47k forks source link

critbits.nim `rawGet` causes `FieldDefect: field 'key' is not accessible for type 'NodeObj' using 'isLeaf = 255'` when run multiple times with `-mm:orc` #20400

Open PhilippMDoerner opened 2 years ago

PhilippMDoerner commented 2 years ago

What happened?

I have a larger web application I am writing with the prologue framework, which makes use of hasKey from critbits.nim which in turn makes use of rawGet. Normally everything works perfectly fine, all HTTP endpoints are perfect.

However, when making multiple requests in short succession, under some circumstances (namely when triggering the /sessionaudio and /timestamp routes together repeatedly) it causes the error:

Exception message: field 'key' is not accessible for type 'NodeObj' using 'isLeaf = 255'

I have no understanding of what causes this bug, as it does a) not appear consistently and b) does not occur in code that I have any understanding of.

I can say the following:

  1. This error does not occur when using refc instead of orc
  2. This error does not occur when using asynchttpserver

Thus the error appears to be specific to orc and httpx (?).

Nim Version

Nim Compiler Version 1.7.1 [Linux: amd64] Compiled at 2022-08-23 Copyright (c) 2006-2022 by Andreas Rumpf

git hash: 8fc19b9e1291017b89148a3747fa77efdaf040e2 active boot switches: -d:release

Current Standard Output Logs

nswebserver       | DEBUG TINYPOOL: AFTER RECYCLE - Number of connections in pool: 8
nswebserver       | DEBUG 200 OK {"duration-milliseconds": @["13"], "content-type": @["application/json"], "content-encoding": @["deflate"]}
nswebserver       | DEBUG socket: 52 is closed!
nswebserver       | DEBUG GET /sessionaudio/Aldrune/1/72/
nswebserver       | ERROR FieldDefect: field 'key' is not accessible for type 'NodeObj' using 'isLeaf = 255'
nswebserver       | Async traceback:
nswebserver       |   /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |   /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |   /home/philipp/dev/nimstoryfont/src/middleware/timingMiddleware.nim(8)                anonymousIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |   /home/philipp/dev/nimstoryfont/src/middleware/compressionMiddleware.nim(8)           anonymousIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/cors.nim(67)          anonymousIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(51)      switchIter
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/route.nim(504)               findHandler
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/route.nim(482)               findHandler
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/route.nim(470)               findHandler
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/collections/critbits.nim(87) hasKey
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/collections/critbits.nim(74) rawGet
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/system/fatal.nim(53)              sysFatal
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/timingMiddleware.nim(8)                anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/compressionMiddleware.nim(8)           anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/timingMiddleware.nim(8)                anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/compressionMiddleware.nim(8)           anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/timingMiddleware.nim(8)                anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/timingMiddleware.nim(8)                anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       | Exception message: field 'key' is not accessible for type 'NodeObj' using 'isLeaf = 255'
nswebserver       | 
nswebserver       | DEBUG 500 Internal Server Error {"content-type": @["text/plain; charset=UTF-8"]}
nswebserver       | DEBUG socket: 52 is closed!
nswebserver       | DEBUG GET /timestamp/Aldrune/1/72/
nswebserver       | ERROR FieldDefect: field 'key' is not accessible for type 'NodeObj' using 'isLeaf = 255'
nswebserver       | Async traceback:
nswebserver       |   /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |   /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |   /home/philipp/dev/nimstoryfont/src/middleware/timingMiddleware.nim(8)                anonymousIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |   /home/philipp/dev/nimstoryfont/src/middleware/compressionMiddleware.nim(8)           anonymousIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/cors.nim(67)          anonymousIter
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(51)      switchIter
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/route.nim(504)               findHandler
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/route.nim(482)               findHandler
nswebserver       |   /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/route.nim(470)               findHandler
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/collections/critbits.nim(87) hasKey
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/collections/critbits.nim(74) rawGet
nswebserver       |   /home/philipp/.choosenim/toolchains/nim-#devel/lib/system/fatal.nim(53)              sysFatal
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/timingMiddleware.nim(8)                anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/compressionMiddleware.nim(8)           anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/timingMiddleware.nim(8)                anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/compressionMiddleware.nim(8)           anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/timingMiddleware.nim(8)                anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/dev/nimstoryfont/src/middleware/timingMiddleware.nim(8)                anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/middlewares/staticfile.nim(31)    anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/middlewaresbase.nim(48)      switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          :anonymous
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           anonymousNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          anonymousIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       |   #[
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(484)                                eventLoop
nswebserver       |     /home/philipp/.nimble/pkgs/httpx-0.2.8/httpx.nim(400)                                processEvents
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(531)         :anonymous
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(498)         handleRequest
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          handleContext
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(28)           handleContextNimAsyncContinue
nswebserver       |     /home/philipp/.nimble/pkgs/prologue-0.6.0/prologue/core/application.nim(457)         handleContextIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(242)          switch
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(31)           switchNimAsyncContinue
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncmacro.nim(134)          switchIter
nswebserver       |     /home/philipp/.choosenim/toolchains/nim-#devel/lib/pure/asyncfutures.nim(389)        read
nswebserver       |   ]#
nswebserver       | Exception message: field 'key' is not accessible for type 'NodeObj' using 'isLeaf = 255'
nswebserver       |

Expected Standard Output Logs

No response

Possible Solution

I have troubleshot the passages together with ringabout. We narrowed the issue down to the proc rawGet. We further found a solution, as apparently all it takes is modifying rawGet a little bit to look like this:

# Before - Aka the broken version
proc rawGet[T](c: CritBitTree[T], key: string): Node[T]=
  var it = c.root
  while it != nil:
    if not it.isLeaf:
      let ch = if it.byte < key.len: key[it.byte] else: '\0'
      let dir = (1 + (ch.ord or it.otherBits.ord)) shr 8
      it = it.child[dir]
    else:
      return if it.key == key: it else: nil

# After - Aka the functional version, changes start after the line `it = it.child[dir]`
proc rawGet[T](c: CritBitTree[T], key: string): Node[T]=
  var it = c.root
  while it != nil:
    if not it.isLeaf:
      let ch = if it.byte < key.len: key[it.byte] else: '\0'
      let dir = (1 + (ch.ord or it.otherBits.ord)) shr 8
      it = it.child[dir]
    else:
      let itKey = it.key
      if itKey == key:
        return it
      else:
        return nil

As I have no understanding on why this actually fixes things, I'll quote ringabout here:

I guess ORC doesn't like complex expressions. return if it.key == key: it else: nil I guess the root cause is that it gets moved wrongly in the while loop and this if statement.

Additional Information

We essentially already have the solution (though I still don't know why that's a bug/problem) thanks to ringabout! I'll write up the PR to apply their change.

oakes commented 1 year ago

We may be hitting the same bug. While trying to integrate immutable data structures into pararules we're seeing this:

Error: unhandled exception: field 'nodes' is not accessible for type 'MapNode' using 'kind = 1' [FieldDefect]

I don't have anything close to a minimal repro unfortunately. You have to clone this fork and in the parazoa branch run:

nim r -d:useMalloc tests/test1.nim

It fails without useMalloc too but the error is more obscured. If you change tests/config.nims to use refc the tests run successfully.

Araq commented 1 year ago

I need a reproducible test case.

ul commented 1 year ago

Doesn't @oakes's message contain one? Here is the direct link to the branch of interest: https://github.com/ul/pararules/tree/parazoa

I understand it's not a minimal case but reproducible nevertheless.