Comments (17)
No, that's great news! Makes it much easier to fix.
from nim.
I'm really sorry for that,
from nim.
Works for me. Does it start to work with -d:useMalloc
for you?
from nim.
Does it start to work with
-d:useMalloc
for you?
Yes, no problem with -d:useMalloc
from nim.
Should be fixed by #23758
If not, please reopen.
from nim.
nope, same
nim r -f .\play.nim
output
CC: play.nim
Hint: [Link]
Hint: mm: orc; threads: on; opt: none (DEBUG BUILD, `-d:release` generates faster code)
68866 lines; 12.628s; 114.539MiB peakmem; proj: C:\Users\HamidB80\Documents\programming\Enterprise_Computing\play.nim; out: C:\Users\HamidB80\nimcache\play_d\play_91241B8910B9117BF80A2135A8BC4658211A04CC.exe [SuccessX]
Hint: C:\Users\HamidB80\nimcache\play_d\play_91241B8910B9117BF80A2135A8BC4658211A04CC.exe [Exec]
Serving on http://localhost:6001/
Traceback (most recent call last)
C:\Users\HamidB80\Documents\programming\Enterprise_Computing\play.nim(16) play
C:\Users\HamidB80\.nimble\pkgs2\mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6\mummy.nim(1441) serve
C:\Users\HamidB80\.nimble\pkgs2\mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6\mummy.nim(1345) loopForever
C:\Users\HamidB80\.nimble\pkgs2\mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6\mummy.nim(1067) afterRecv
C:\Users\HamidB80\.choosenim\toolchains\nim-#devel\lib\std\envvars.nim(217) afterRecvHttp
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Error: execution of an external program failed: 'C:\Users\HamidB80\nimcache\play_d\play_91241B8910B9117BF80A2135A8BC4658211A04CC.exe'
Nim Version
PS C:\Users\HamidB80\Documents\programming\Enterprise_Computing> nim -v
Nim Compiler Version 2.1.1 [Windows: amd64]
Compiled at 2024-06-26
Copyright (c) 2006-2024 by Andreas Rumpf
active boot switches: -d:release
PS C:\Users\HamidB80\Documents\programming\Enterprise_Computing>
from nim.
If not, please reopen.
seems like I cannot reopen this issue, due to changes in Github
from nim.
Is this problem reproducible on Linux?
from nim.
Is this problem reproducible on Linux?
unfortunately yes,
CC: play.nim
Hint: [Link]
Hint: mm: orc; threads: on; opt: none (DEBUG BUILD, `-d:release` generates faster code)
69976 lines; 6.888s; 114.988MiB peakmem; proj: /home/hamidb80/Documents/programming/play/play.nim; out: /home/hamidb80/.cache/nim/play_d/play_A868D214FBFE7FA0D1C492875840D762FD8CA67C [SuccessX]
Hint: /home/hamidb80/.cache/nim/play_d/play_A868D214FBFE7FA0D1C492875840D762FD8CA67C
[Exec]
Serving on http://localhost:6001/
Traceback (most recent call last)
/home/hamidb80/.nimble/pkgs2/mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6/mummy.nim(518) workerProc
/home/hamidb80/.nimble/pkgs2/mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6/mummy.nim(449) runTask
/home/hamidb80/.nimble/pkgs2/mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6/mummy/routers.nim(221) :anonymous
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)
Error: execution of an external program failed: '/home/hamidb80/.cache/nim/play_d/play_A868D214FBFE7FA0D1C492875840D762FD8CA67C'
$ nim -v
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-06-26
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 948fc29bb20018437678e7c11019f1f2455c3a72
active boot switches: -d:release
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
from nim.
Cannot reproduce on Linux either. Even compiling with -d:useSysAssert
is fine. Try it with -d:useSysAssert
please.
from nim.
I don't use Insomnia though, I simply use my browser and navigate to http://localhost:6001/
.
from nim.
Hey, I truly appreciate your time and attention,
here's the modified code (I've made it single threaded by workerThreads = 1
)
import std/os
import mummy, mummy/routers
proc index(req: Request) =
sleep 300
req.respond 200, emptyHttpHeaders(), "Hello, World!"
proc initRouter: Router =
result.get "/", index
let server = newServer(initRouter(), workerThreads = 1)
when isMainModule:
echo "Serving on http://localhost:6001/"
serve server, Port 6001, "localhost"
Result
1. Sometimes without -d:useSysAssert
$ nim -f r play.nim
/home/hamidb80/Documents/programming/play/play.nim(16) play
/home/hamidb80/.nimble/pkgs2/mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6/mummy.nim(1441) serve
/home/hamidb80/.nimble/pkgs2/mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6/mummy.nim(1345) loopForever
/home/hamidb80/.nimble/pkgs2/mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6/mummy.nim(1067) afterRecv
/home/hamidb80/.choosenim/toolchains/nim-#devel/lib/std/envvars.nim(217) afterRecvHttp
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)
2. Sometimes without -d:useSysAssert
$ nim -f r play.nim
/home/hamidb80/.nimble/pkgs2/mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6/mummy.nim(1441) serve
/home/hamidb80/.nimble/pkgs2/mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6/mummy.nim(1345) loopForever
/home/hamidb80/.nimble/pkgs2/mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6/mummy.nim(1067) afterRecv
/home/hamidb80/.nimble/pkgs2/mummy-0.4.2-2c3d0bdf8525a27ff1eae97e9f23695022eabbb6/mummy.nim(908) afterRecvHttp
/home/hamidb80/.choosenim/toolchains/nim-#devel/lib/pure/strutils.nim(50) cmpIgnoreCase
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)
3.always with d:useSysAssert
$ nim -f -d:useSysAssert r play.nim
[Exec]
Serving on http://localhost:6001/
Dropped response to disconnected client
[SYSASSERT] rawAlloc 3
Nim Version
$ nim -v
im Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-06-26
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 948fc29bb20018437678e7c11019f1f2455c3a72
active boot switches: -d:release
from nim.
I don't use Insomnia though, I simply use my browser and navigate to
http://localhost:6001/
.
no problem, just hit Ctrl
+R
multiple times
from nim.
no problem, just hit Ctrl+R multiple times
That's what I do, but as I said, cannot reproduce. Probably I should use wrk
and run a stress test.
from nim.
but as I said, cannot reproduce
strange, does my Nim's git hash matches yours?
948fc29bb20018437678e7c11019f1f2455c3a72
can anyone else give it a try?
from nim.
You need:
commit 8096fa4
Date: Wed Jun 26 05:09:05 2024 +0200
fixes #23725; Size computations work better when they are correct (#23758)
[backport]
from nim.
I thought choosenim update devel
downloaded latest Nim version
from nim.
Related Issues (20)
- Using waitForExit with timeout from multiple threads simultaneously hangs HOT 1
- Cyclic proc calls causes infinite memory usage HOT 12
- Custom iterator is not found if used in template function, if used from a third file HOT 1
- bisecting 2.2.0 rc1 HOT 17
- cursor optimizer doesn't understand that distinct cstring can be an owning type
- Cross compilation with mingw for cpu=i386 from linux/macos fails with time_t bug HOT 2
- Type error when sink added to parameters HOT 2
- Nim `devel` nightly `i386` build failing HOT 1
- `koch pdf` produces a warning about unknown substitution 'nimversion'
- `nim gendepend` does not work with var-less destructors
- When JS, operations on pointer casted from ref object raises Runtime-Errors
- Regression - cannot instantiate Maybe generic arguments are missing HOT 5
- Identifier expected or compiler segfault with templates over generic type in type section HOT 3
- Nested generic/static parameter: undeclared identifier in typesections HOT 2
- 2.2.0 rc1 regression with cdecl functions
- Warnings missing when compiling the same file twice HOT 4
- `genericsOpenSym` not working when additional generally non-matching symbol with same name is present HOT 2
- nimsuggest crashes when using `--mm:arc/orc` and if an object that contains `string` or `seq` is constructed HOT 2
- ARC hooks missing when sinking generic typeclass HOT 3
- Generic concepts not compatible with openarray HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nim.