Skip to content

nimsuggest segfaults when sug #25435

@Q-Master

Description

@Q-Master

Nim Version

Nim Compiler Version 2.2.6 [Linux: amd64]
Compiled at 2025-10-31
Copyright (c) 2006-2025 by Andreas Rumpf

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

Also checked in 2.2.4 and devel

Description

All available lsps are failing with nimsuggest segfault. The code is compiled perfectly and works, only nimsuggest fails on it:
`
Starting program: nimsuggest error.nim
[New LWP 987965]
usage: sug|con|def|use|dus|chk|mod|highlight|outline|known|project 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

sug error.nim 87 8

Thread 1 "nimsuggest" received signal SIGSEGV, Segmentation fault.
0x000000000052ad6a in checkRaisesSpec__OOZcompilerZsempass2_u7660 ()
(gdb) bt
#0 0x000000000052ad6a in checkRaisesSpec__OOZcompilerZsempass2_u7660 ()
#1 0x000000000052b2e4 in checkMethodEffects__OOZcompilerZsempass2_u7802 ()
#2 0x00000000005531da in methodDef__OOZcompilerZcgmeth_u198 ()
#3 0x00000000005d72e6 in semProcAux__OOZcompilerZsem_u20790.part.0 ()
#4 0x00000000005f2a8a in semMethod__OOZcompilerZsem_u21306 ()
#5 0x00000000005c34af in semExpr__OOZcompilerZsem_u56 ()
#6 0x00000000005c688d in semStmtList__OOZcompilerZsem_u21570 ()
#7 0x00000000005c2cbd in semExpr__OOZcompilerZsem_u56 ()
#8 0x00000000005f821f in semStmtAndGenerateGenerics__OOZcompilerZsem_u29457 ()
#9 0x00000000005f8593 in semWithPContext__OOZcompilerZsem_u29524 ()
#10 0x00000000005faf00 in processModule__OOZcompilerZpasses_u206.part.0 ()
#11 0x00000000005fb39a in compileModule__OOZcompilerZpasses_u281 ()
#12 0x00000000006f60b9 in executeNoHooks__nimsuggest_u2488 ()
#13 0x00000000006f6e20 in execCmd__nimsuggest_u2796 ()
#14 0x00000000006f75c2 in mainThread__nimsuggest_u2968 ()
#15 0x00000000006f79b2 in mainCommand__nimsuggest_u3159 ()
#16 0x00000000006f7c91 in handleCmdLine__nimsuggest_u4957 ()
#17 0x00000000006f7ce4 in NimMainInner ()
#18 0x00000000006f8586 in NimMain ()
#19 0x000000000040039d in main ()
`
Attached minimal error code:
error.nim.gz

Seems removing sockets from code leads to error to disappear completely.

Current Output


Expected Output


Known Workarounds

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions