nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

Latest HEAD segfaults when compiling Aporia #9889

Closed stefanos82 closed 5 years ago

stefanos82 commented 5 years ago

Specs:

OS: GNU / Linux Debian testing 64-bit
Compiler: GCC 8.2.0
Nim version: 0.19.9 [Linux: amd64]
git hash: 19b367380481fba9f4e6f405c53b4110c948b411

I have tried to compile Aporia with the latest Nim HEAD and got the following error message:

stefanos@debian:~/tmp/Aporia [master]$ nimble build --verbose
   Warning: The .nimble file for this project could make use of additional features, if converted into the new NimScript format.
        ... For more details see:https://github.com/nim-lang/nimble#creating-packages
  Verifying dependencies for aporia@0.4.2
    Reading official package list
   Checking for gtk2@>= 1.3
      Info: Dependency on gtk2@>= 1.3 already satisfied
  Verifying dependencies for gtk2@1.3
    Reading official package list
   Checking for cairo@any version
      Info: Dependency on cairo@any version already satisfied
  Verifying dependencies for cairo@1.0
    Reading official package list
   Checking for dialogs@>= 1.1.1
      Info: Dependency on dialogs@>= 1.1.1 already satisfied
  Verifying dependencies for dialogs@1.1.1
    Reading official package list
   Checking for gtk2@>= 1.0
      Info: Dependency on gtk2@>= 1.0 already satisfied
  Verifying dependencies for gtk2@1.3
    Reading official package list
   Checking for cairo@any version
      Info: Dependency on cairo@any version already satisfied
  Verifying dependencies for cairo@1.0
   Building aporia/aporia using c backend
     Error: Build failed for package: aporia
        ... Details:
        ... Execution failed with exit code 1
        ... Command: "/home/stefanos/GIT_CODES/Nim/bin/nim" c --noBabelPath --path:"/home/stefanos/.nimble/pkgs/gtk2-1.3"  --path:"/home/stefanos/.nimble/pkgs/cairo-1.0"  --path:"/home/stefanos/.nimble/pkgs/dialogs-1.1.1"  --path:"/home/stefanos/.nimble/pkgs/gtk2-1.3"  --path:"/home/stefanos/.nimble/pkgs/cairo-1.0"  -o:"/home/stefanos/tmp/Aporia/aporia" "/home/stefanos/tmp/Aporia/aporia.nim"
        ... Output: Hint: used config file '/home/stefanos/GIT_CODES/Nim/config/nim.cfg' [Conf]
        ... Hint: used config file '/home/stefanos/tmp/Aporia/aporia.nim.cfg' [Conf]
        ... Hint: system [Processing]
        ... Hint: aporia [Processing]
        ... Hint: glib2 [Processing]
        ... Traceback (most recent call last)
        ... nim.nim(109)             nim
        ... nim.nim(73)              handleCmdLine
        ... cmdlinehelper.nim(91)    loadConfigsAndRunMainCommand
        ... main.nim(168)            mainCommand
        ... main.nim(78)             commandCompileToC
        ... modules.nim(134)         compileProject
        ... modules.nim(79)          compileModule
        ... passes.nim(200)          processModule
        ... passes.nim(86)           processTopLevelStmt
        ... sem.nim(603)             myProcess
        ... sem.nim(571)             semStmtAndGenerateGenerics
        ... semstmts.nim(1987)       semStmt
        ... semexprs.nim(915)        semExprNoType
        ... semexprs.nim(2598)       semExpr
        ... importer.nim(211)        evalImport
        ... importer.nim(181)        impMod
        ... importer.nim(153)        myImportModule
        ... modules.nim(92)          importModule
        ... modules.nim(79)          compileModule
        ... passes.nim(194)          processModule
        ... passes.nim(86)           processTopLevelStmt
        ... sem.nim(603)             myProcess
        ... sem.nim(571)             semStmtAndGenerateGenerics
        ... semstmts.nim(1987)       semStmt
        ... semexprs.nim(915)        semExprNoType
        ... semexprs.nim(2565)       semExpr
        ... semstmts.nim(1927)       semStmtList
        ... semexprs.nim(2570)       semExpr
        ... semstmts.nim(1193)       semTypeSection
        ... semstmts.nim(1060)       typeSectionRightSidePass
        ... semtypes.nim(1673)       semTypeNode
        ... semtypes.nim(1382)       semProcTypeWithScope
        ... pragmas.nim(1172)        pragma
        ... pragmas.nim(1141)        implicitPragmas
        ... pragmas.nim(1123)        mergePragmas
        ... SIGSEGV: Illegal storage access. (Attempt to read from nil?)
dom96 commented 5 years ago

It surely doesn't segfault when compiling anything, right? (just Aporia)

stefanos82 commented 5 years ago

Well, I have tested a few of my local demos and work just fine.

Do you have anything else to suggest?

dom96 commented 5 years ago

nah, as long as a simple thing compiles it's fine.

Araq commented 5 years ago

Btw, --noBabelPath? Is it 2014 again?

stefanos82 commented 5 years ago

I didn't add it myself @Araq, I just run nimble build --verbose, that's all.

demotomohiro commented 5 years ago

Traceback in this issue is same to #9886.

Araq commented 5 years ago

@stefanos82 I know, my point is somebody (@dom96) should update Aporia Nimble.

dom96 commented 5 years ago

@Araq that's not Aporia doing it, it's Nimble.

stefantalpalaru commented 5 years ago

Looks like this bug ended up in 0.19.2 without its fix: https://gist.github.com/stefantalpalaru/9d57b57e984a734edb9f947fcce29f37