nimsuggest icon indicating copy to clipboard operation
nimsuggest copied to clipboard

Still crash with generics

Open StefanSalewski opened this issue 8 years ago • 6 comments

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 avatar Jan 02 '18 18:01 StefanSalewski

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

> def rtree.nim:584:12
Segmentation fault (core dumped)

StefanSalewski avatar Jan 11 '18 14:01 StefanSalewski

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

narimiran avatar Mar 28 '19 13:03 narimiran

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 avatar Mar 28 '19 14:03 StefanSalewski

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.

StefanSalewski avatar Mar 28 '19 15:03 StefanSalewski

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

Araq avatar Mar 29 '19 19:03 Araq

I can't replicate this with the latest nimsuggest.

@StefanSalewski can you still replicate it?

saem avatar Jan 03 '21 20:01 saem