Skip to content
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

nimsuggest SIGSEGV when passing some unknown files #101

Open
timotheecour opened this issue Nov 20, 2018 · 8 comments
Open

nimsuggest SIGSEGV when passing some unknown files #101

timotheecour opened this issue Nov 20, 2018 · 8 comments

Comments

@timotheecour
Copy link
Member

/cc @Araq
now that nim-lang/Nim#9757 was merged, the caveats I had mentioned in that PR hold:

nimsuggest --stdin /Users/timothee/git_clone/nim/Nim/lib/system.nim
def /Users/timothee/git_clone/nim/Nim/lib/system.nim:106:22
def /Users/timothee/git_clone/nim/Nim/compiler/modules.nim:69:63
gives SIGSEGV
see stacktrace here:
nim-lang/Nim#9715 (comment)

@alaviss
Copy link

alaviss commented Nov 21, 2018

@timotheecour Here's the nimsuggest bug tracker: https://github.com/nim-lang/nimsuggest. I'd recommend migrating this issue there.

@krux02 krux02 transferred this issue from nim-lang/Nim Nov 22, 2018
@nc-x
Copy link

nc-x commented Dec 17, 2018

Can't reproduce for system.nim

And the line 69 in modules.nim has changed now and the line at the time this issue was opened (https://github.com/timotheecour/Nim/blob/1c71b0be2ffa378945c61927d9351b88b5033b08/compiler/modules.nim#L69) does not exist anymore.

@timotheecour
Copy link
Member Author

timotheecour commented Dec 27, 2018

Can't reproduce for system.nim

no, def /Users/timothee/git_clone/nim/Nim/lib/system.nim:106:22 worked, since that file is given on cmd line that starts nimsuggest

And the line 69 in modules.nim has changed now and the line at the time this issue was opened

regardless, it still SIGSEGV's:
on latest devel:
git rev-parse HEAD
513a287c61e6e461b013e75a7f5dbfa0136b606c

nimsuggest --stdin /Users/timothee/git_clone/nim/Nim/lib/system.nim
Hint: used config file '/Users/timothee/git_clone/nim/Nim/config/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/.config/nim/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/git_clone/nim/Nim/config/config.nims' [Conf]
usage: sug|con|def|use|dus|chk|mod|highlight|outline|known file.nim[;dirtyfile.nim]:line:col
type 'quit' to quit
type 'debug' to toggle debug mode on/off
type 'terse' to toggle terse mode on/off
> def /Users/timothee/git_clone/nim/Nim/lib/system.nim:106:22
def     skType  system.SomeInteger      SomeInteger     /Users/timothee/git_clone/nim/Nim/lib/system.nim        96      2       "type class matching all integer types" 100

> def /Users/timothee/git_clone/nim/Nim/compiler/modules.nim:69:63
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

@nc-x
Copy link

nc-x commented Dec 28, 2018

No crash if def /Users/timothee/git_clone/nim/Nim/lib/system.nim:106:22 is not executed first.
Otherwise (nimsuggest compiled in debug mode) -

> def lib/system.nim:106:22
def     skType  system.SomeInteger      SomeInteger     C:\Nim\lib\sys
        96      2       "type class matching all integer types" 100

> def compiler/modules.nim:69:40
nimsuggest.nim(622)      nimsuggest
nimsuggest.nim(619)      handleCmdLine
cmdlinehelper.nim(92)    loadConfigsAndRunMainCommand
nimsuggest.nim(531)      mainCommand
nimsuggest.nim(479)      mainThread
nimsuggest.nim(445)      execCmd
nimsuggest.nim(209)      execute
nimsuggest.nim(183)      executeNoHooks
modules.nim(134)         compileProject
modules.nim(79)          compileModule
passes.nim(197)          processModule
passes.nim(86)           processTopLevelStmt
sem.nim(609)             myProcess
sem.nim(572)             semStmtAndGenerateGenerics
semstmts.nim(2048)       semStmt
semexprs.nim(915)        semExprNoType
semexprs.nim(2602)       semExpr
importer.nim(212)        evalImport
importer.nim(182)        impMod
importer.nim(154)        myImportModule
modules.nim(92)          importModule
modules.nim(79)          compileModule
passes.nim(200)          processModule
passes.nim(86)           processTopLevelStmt
sem.nim(609)             myProcess
sem.nim(572)             semStmtAndGenerateGenerics
semstmts.nim(2048)       semStmt
semexprs.nim(915)        semExprNoType
semexprs.nim(2602)       semExpr
importer.nim(212)        evalImport
importer.nim(182)        impMod
importer.nim(154)        myImportModule
modules.nim(92)          importModule
modules.nim(79)          compileModule
passes.nim(197)          processModule
passes.nim(86)           processTopLevelStmt
sem.nim(609)             myProcess
sem.nim(572)             semStmtAndGenerateGenerics
semstmts.nim(2048)       semStmt
semexprs.nim(915)        semExprNoType
semexprs.nim(2602)       semExpr
importer.nim(212)        evalImport
importer.nim(182)        impMod
importer.nim(154)        myImportModule
modules.nim(92)          importModule
modules.nim(79)          compileModule
passes.nim(200)          processModule
passes.nim(86)           processTopLevelStmt
sem.nim(609)             myProcess
sem.nim(572)             semStmtAndGenerateGenerics
semstmts.nim(2048)       semStmt
semexprs.nim(915)        semExprNoType
semexprs.nim(2602)       semExpr
importer.nim(212)        evalImport
importer.nim(182)        impMod
importer.nim(154)        myImportModule
modules.nim(92)          importModule
modules.nim(79)          compileModule
passes.nim(197)          processModule
passes.nim(86)           processTopLevelStmt
sem.nim(609)             myProcess
sem.nim(572)             semStmtAndGenerateGenerics
semstmts.nim(2048)       semStmt
semexprs.nim(915)        semExprNoType
semexprs.nim(2602)       semExpr
importer.nim(212)        evalImport
importer.nim(182)        impMod
importer.nim(154)        myImportModule
modules.nim(92)          importModule
modules.nim(79)          compileModule
passes.nim(197)          processModule
passes.nim(86)           processTopLevelStmt
sem.nim(609)             myProcess
sem.nim(572)             semStmtAndGenerateGenerics
semstmts.nim(2048)       semStmt
semexprs.nim(915)        semExprNoType
semexprs.nim(2602)       semExpr
importer.nim(212)        evalImport
importer.nim(182)        impMod
importer.nim(154)        myImportModule
modules.nim(92)          importModule
modules.nim(79)          compileModule
passes.nim(194)          processModule
passes.nim(86)           processTopLevelStmt
sem.nim(609)             myProcess
sem.nim(572)             semStmtAndGenerateGenerics
semstmts.nim(2048)       semStmt
semexprs.nim(915)        semExprNoType
semexprs.nim(2569)       semExpr
semstmts.nim(1988)       semStmtList
semexprs.nim(2611)       semExpr
semstmts.nim(1912)       evalInclude
semstmts.nim(1892)       incMod
semstmts.nim(2048)       semStmt
semexprs.nim(915)        semExprNoType
semexprs.nim(2569)       semExpr
semstmts.nim(1988)       semStmtList
semexprs.nim(2493)       semExpr
semexprs.nim(2124)       semWhen
sem.nim(354)             semConstExpr
vm.nim(1894)             evalConstExpr
vm.nim(1890)             evalConstExprAux
vm.nim(1541)             rawExecute
system.nim(2985)         sysFatal
Error: unhandled exception: node is not accessible [FieldError]

@timotheecour
Copy link
Member Author

@krux02 I see you transferred the issue to here, thanks! is there any way to transfer the set of all labels too? (i know, some may not be relevant, but may be simpler to reuse same labels)

@FedericoCeratto
Copy link
Member

nimsuggest --debug --log . crashes with SIGSEGV: Illegal storage access. (Attempt to read from nil?) from a build from the current Nim devel repo

@saem
Copy link

saem commented Jan 3, 2021

Is this still a bug because I can't seem to replciate it?

@timotheecour
Copy link
Member Author

timotheecour commented Jan 3, 2021

if, fixed, please add a regression test case in a PR before closing this issue, thanks!

(the test case obviously should be such that it would fail using an older nim, eg the one right after nim-lang/Nim#9757)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants