nim-lang / nimsuggest

idetools for the nim language
MIT License
42 stars 9 forks source link

Still crash with generics #73

Open StefanSalewski opened 6 years ago

StefanSalewski commented 6 years ago
Latest version from git

$ nim -v
Nim Compiler Version 0.17.3 [Linux: amd64]
Copyright (c) 2006-2017 by Andreas Rumpf

git hash: b7e69e7cbbf6139316841bcc7c596e93ac78d994
active boot switches: -d:release

nimsuggest -v
Nim Compiler Version 0.17.3 [Linux: amd64]
Copyright (c) 2006-2017 by Andreas Rumpf

git hash: b7e69e7cbbf6139316841bcc7c596e93ac78d994
active boot switches: -d:release --gc:markAndSweep
git clone https://github.com/StefanSalewski/RTree.git

cd RTree/

nimsuggest --stdin rtree.nim

def rtree.nim:363:12
Segmentation fault (core dumped)
StefanSalewski commented 6 years ago

Update: After latest RTree commit new secure crash position is:

> def rtree.nim:584:12
Segmentation fault (core dumped)
narimiran commented 5 years ago

I couldn't reproduce the segfault on v0.19.9. Can you confirm that segfault is gone?

StefanSalewski commented 5 years ago

Seems the critical line numbers are moving. I am using my NEd editor as a detector, as it is designed to crash when nimsuggest crashes. With latest nim/nimsuggest one crash position seems to be line 567, see

$ nim -v
Nim Compiler Version 0.19.9 [Linux: amd64]
Compiled at 2019-03-28
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: e904b3f952011ad9531b0923c2000398373af687
active boot switches: -d:release
stefan@nuc ~/RTree $ nimsuggest -v
Nim Compiler Version 0.19.9 [Linux: amd64]
Compiled at 2019-03-28
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: e904b3f952011ad9531b0923c2000398373af687
active boot switches: -d:release --gc:markAndSweep

stefan@nuc ~/RTree $ nimsuggest --stdin rtree.nim

> def rtree.nim:567:12
../lib/system/fatal.nim(37) sysFatal
Error: unhandled exception: /home/stefan/Nim/compiler/sigmatch.nim(366, 13) `false` cannot resolve type: H[condenseTree.M, condenseTree.D, condenseTree.RT, condenseTree.LT] [AssertionError]
SIGABRT: Abnormal termination.

But don't waste your time, I guess there are more important issues available, RTree modules uses generics, that may be too hard for nimsuggest.

OH, I just noticed that rtree.nim does not compile with latest nim devel:

rtree.nim(65, 20) Error: undeclared identifier: 'SomeReal'

Will fix that soon. maybe saturday.

StefanSalewski commented 5 years ago

Just fixed compile error:

elif r[0].a is SomeFloat: # SomeReal:

But makes no difference, crash on line 567. Will fix the compiler warnings soon, and maybe will make a nimble package of it later.

Araq commented 5 years ago

@narimiran Note that nimsuggest has special logic that tries to help within generic code that nim check does not do.

saem commented 3 years ago

I can't replicate this with the latest nimsuggest.

@StefanSalewski can you still replicate it?