-
-
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
memory corrupted; possibly by try/catch using import segfaults
#9752
Comments
import segfaults
import segfaults
import segfaults
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. |
It seems not to happen anymore. Though I couldn't find |
I think it is only related to two files include "../tests/stdlib/tstdlib_various.nim"
include "../tests/stdlib/tmarshal.nim" Gave:
If I use devel, it works ad expected:
|
@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 |
Instead remove |
There are other use cases for processes that can't crash that take user input such as shared library plugins. |
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. ( |
Yeah, exactly. I haven't been able to write |
Good point, but I find this to be an important part of the core language. |
/cc @Araq
see reproducible test case here: #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: 6279b05
active boot switches: -d:release
note
I ran into this while working on #9581
note
wondering if it's because of
import segfaults
in tstdlib_variousThe text was updated successfully, but these errors were encountered: