Open timotheecour opened 6 years ago
This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions.
@timotheecour
It seems not to happen anymore. Though I couldn't find twalker.nim
. I will make a PR to show this/
It seems to be fixed by https://github.com/nim-lang/Nim/pull/15342
I think it is only related to two files
include "../tests/stdlib/tstdlib_various.nim"
include "../tests/stdlib/tmarshal.nim"
Gave:
abc
def
definition
prefix
xyz
def
definition
Hi Andreas! How do you feel, Rumpf?
@[0, 2, 1]
@[1, 0, 2]
@[1, 2, 0]
@[2, 0, 1]
@[2, 1, 0]
@[2, 0, 1]
@[1, 2, 0]
@[1, 0, 2]
@[0, 2, 1]
@[0, 1, 2]
055this should be the casehugh@["(", "+", " 1", " 2", ")"]
caught a crash!
caught a crash!
caught a crash!
caught a crash!
caught a crash!
caught a crash!
[5]
[4, 5]
[3, 4, 5]
[2, 3, 4, 5]
[2, 3, 4, 5, 6]
[1, 2, 3, 4, 5, 6]
true
<h1><a href="http://force7.de/nim">Nim</a></h1>
{"age": 12, "bio": "Я Cletus", "blob": [65, 66, 67, 128], "name": "Cletus"}
true
true
alpha 100
omega 200
Some(null)
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(175) run_bug
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(167) main
[[reraised from:
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(175) run_bug
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(167) main
]]
[[reraised from:
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(175) run_bug
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(167) main
]]
[[reraised from:
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(175) run_bug
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(167) main
]]
[[reraised from:
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(175) run_bug
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(167) main
]]
[[reraised from:
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(175) run_bug
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tstdlib_various.nim(167) main
]]
[[reraised from:
D:\QQPCmgr\Desktop\Nim\tests\stdlib\tmarshal.nim(142) run_bug
C:\Users\blue\.choosenim\toolchains\nim-#devel\lib\pure\marshal.nim(343) to
C:\Users\blue\.choosenim\toolchains\nim-#devel\lib\pure\marshal.nim(276) loadAny
C:\Users\blue\.choosenim\toolchains\nim-#devel\lib\pure\marshal.nim(196) loadAny
C:\Users\blue\.choosenim\toolchains\nim-#devel\lib\pure\marshal.nim(211) loadAny
C:\Users\blue\.choosenim\toolchains\nim-#devel\lib\core\typeinfo.nim(330) setPointer
C:\Users\blue\.choosenim\toolchains\nim-#devel\lib\system\assign.nim(139) genericAssign
C:\Users\blue\.choosenim\toolchains\nim-#devel\lib\system\assign.nim(134) genericAssignAux
]]
If I use devel, it works ad expected:
abc
def
definition
prefix
xyz
def
definition
Hi Andreas! How do you feel, Rumpf?
@[0, 2, 1]
@[1, 0, 2]
@[1, 2, 0]
@[2, 0, 1]
@[2, 1, 0]
@[2, 0, 1]
@[1, 2, 0]
@[1, 0, 2]
@[0, 2, 1]
@[0, 1, 2]
055this should be the casehugh@["(", "+", " 1", " 2", ")"]
caught a crash!
caught a crash!
caught a crash!
caught a crash!
caught a crash!
caught a crash!
[5]
[4, 5]
[3, 4, 5]
[2, 3, 4, 5]
[2, 3, 4, 5, 6]
[1, 2, 3, 4, 5, 6]
true
<h1><a href="http://force7.de/nim">Nim</a></h1>
{"age": 12, "bio": "Я Cletus", "blob": [65, 66, 67, 128], "name": "Cletus"}
true
true
alpha 100
omega 200
Some(null)
None[JsonNode]
(numeric: "")
@xflywind cool; if possible could you try to minimize a bit while maintaining the crash before that PR and succeeding after that PR?
Some tests are changing and doesn't work in Nim v 1.2.6 I will try to minimize that.
Instead remove import segfaults
from the tests, I don't want to support it further, it's stupid. At some point one has to let processes crash and invest some effort into testing one's code.
import segfaults
is useful I don't see why keeping at least 1 test is a maintenance burden.
I have real use cases for import segfaults
, including for a repl I'm working on (already usable), where the process can't crash.
The repl, unlike nim secret
, works at RT (so avoids some limitations of VM), and unlike inim
, doesn't recompile the whole program on each command, and is in particular faster.
There are other use cases for processes that can't crash that take user input such as shared library plugins.
I don't want to support it further, it's stupid. At some point one has to let processes crash and invest some effort into testing one's code.
Yes, and in an ideal world, you'd have all the time (and ability!) to produce code with zero bugs. It doesn't happen in the real world, though, does it?
It's not just about "processes" that you run on your machine, what about applications shipped to users? Being able to catch and log any error or segfault is an extremely useful (and I'd even say, essential) requirement for such apps; then the user can provide the crash log in the bug report.
This has been a standard feature of all high-level languages for decades. I know Nim is not exactly "high level" in the same sense, but we can still aim to be better than C in this regard.
FWIW, I wrote a branch which allowed to raise a Defect upon nil dereferencing (without resorting to signals, but instead by codegen instrumentation), which can help for debugging, in particular can give column info and is safe since doesn't rely on signals.
(exp_SIGSEGV_debug
, no PR ready though, but it did work)
(controlled by a flag)
Yes, and in an ideal world, you'd have all the time (and ability!) to produce code with zero bugs. It doesn't happen in the real world, though, does it?
Yeah, exactly. I haven't been able to write segfaults
without bugs and I don't have all the time to maintain it either. Ironic, isn't it.
Yes, and in an ideal world, you'd have all the time (and ability!) to produce code with zero bugs. It doesn't happen in the real world, though, does it?
Yeah, exactly. I haven't been able to write
segfaults
without bugs and I don't have all the time to maintain it either. Ironic, isn't it.
Good point, but I find this to be an important part of the core language.
/cc @Araq see reproducible test case here: https://github.com/nim-lang/Nim/pull/9751
these all work:
but this fails if importing all of the above:
with bug/run_bug.nim:
nim --version Nim Compiler Version 0.19.9 [MacOSX: amd64] Compiled at 2018-11-16 Copyright (c) 2006-2018 by Andreas Rumpf
git hash: 6279b0587a9551d8c205e682d28a731f2986c456 active boot switches: -d:release
note
I ran into this while working on https://github.com/nim-lang/Nim/issues/9581
note
wondering if it's because of
import segfaults
in tstdlib_various