We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following snippet makes the compiler crash.
It is due to the use of low instead of lo in the asm, Nim tries to check the return type and crashes in ccgtypes.
low
lo
# GCC/Clang only proc getticks(): int64 {.inline.} = var lo, hi: int64 # Notice "low" instead of lo in the inline assembly {.emit: """asm volatile( "lfence\n" "rdtsc\n" : "=a"(`low`), "=d"(`hi`) : : "memory" );""".} return (hi shl 32) or lo echo getticks()
Error:
fatal.nim(39) sysFatal Error: unhandled exception: ccgtypes.nim(196, 17) `false` mapType [AssertionError]
Full stacktrace with debug on the proc names insterted just before genProcParams:
Nim/compiler/ccgtypes.nim
Lines 956 to 957 in 42e83ac
>>> Debug START<<< nimZeroMem >>> Debug END<<< >>> Debug START<<< nimZeroMem >>> Debug END<<< >>> Debug START<<< nimSetMem_zxfKBYntu9cBapkhrCOk1fgmemory >>> Debug END<<< >>> Debug START<<< nimSetMem_zxfKBYntu9cBapkhrCOk1fgmemory >>> Debug END<<< >>> Debug START<<< getticks_DaT0GSRtc9apiDAhLpobrrwcrash_comp >>> Debug END<<< >>> Debug START<<< getticks_DaT0GSRtc9apiDAhLpobrrwcrash_comp >>> Debug END<<< >>> Debug START<<< low_Rm7OrJxNFFg9aSwESSN9bnXQ >>> Debug END<<< /home/beta/Programming/Nim/Nim/compiler/nim.nim(106) nim /home/beta/Programming/Nim/Nim/compiler/nim.nim(83) handleCmdLine /home/beta/Programming/Nim/Nim/compiler/cmdlinehelper.nim(92) loadConfigsAndRunMainCommand /home/beta/Programming/Nim/Nim/compiler/main.nim(198) mainCommand /home/beta/Programming/Nim/Nim/compiler/main.nim(94) commandCompileToC /home/beta/Programming/Nim/Nim/compiler/modules.nim(147) compileProject /home/beta/Programming/Nim/Nim/compiler/modules.nim(88) compileModule /home/beta/Programming/Nim/Nim/compiler/passes.nim(208) processModule /home/beta/Programming/Nim/Nim/compiler/passes.nim(86) processTopLevelStmt /home/beta/Programming/Nim/Nim/compiler/cgen.nim(1883) myProcess /home/beta/Programming/Nim/Nim/compiler/ccgstmts.nim(1284) genStmts /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2583) expr /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2242) genMagicExpr /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(1056) genEcho /home/beta/Programming/Nim/Nim/compiler/cgen.nim(599) initLocExpr /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2603) expr /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2374) genArrayConstr /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2589) expr /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(1598) genMagicExpr /home/beta/Programming/Nim/Nim/compiler/cgen.nim(599) initLocExpr /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2591) expr /home/beta/Programming/Nim/Nim/compiler/ccgcalls.nim(557) genCall /home/beta/Programming/Nim/Nim/compiler/ccgcalls.nim(195) genPrefixCall /home/beta/Programming/Nim/Nim/compiler/cgen.nim(599) initLocExpr /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2524) expr /home/beta/Programming/Nim/Nim/compiler/cgen.nim(1182) genProc /home/beta/Programming/Nim/Nim/compiler/cgen.nim(1116) genProcNoForward /home/beta/Programming/Nim/Nim/compiler/cgen.nim(1022) genProcAux /home/beta/Programming/Nim/Nim/compiler/ccgstmts.nim(1284) genStmts /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2621) expr /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2398) genStmtList /home/beta/Programming/Nim/Nim/compiler/ccgstmts.nim(1284) genStmts /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2679) expr /home/beta/Programming/Nim/Nim/compiler/ccgstmts.nim(1189) genPragma /home/beta/Programming/Nim/Nim/compiler/ccgstmts.nim(1152) genEmit /home/beta/Programming/Nim/Nim/compiler/ccgstmts.nim(1091) genAsmOrEmitStmt /home/beta/Programming/Nim/Nim/compiler/cgen.nim(599) initLocExpr /home/beta/Programming/Nim/Nim/compiler/ccgexprs.nim(2524) expr /home/beta/Programming/Nim/Nim/compiler/cgen.nim(1182) genProc /home/beta/Programming/Nim/Nim/compiler/cgen.nim(1141) genProcNoForward /home/beta/Programming/Nim/Nim/compiler/cgen.nim(1079) genProcPrototype /home/beta/Programming/Nim/Nim/compiler/ccgtypes.nim(960) genProcHeader /home/beta/Programming/Nim/Nim/compiler/ccgtypes.nim(448) genProcParams /home/beta/Programming/Nim/Nim/compiler/ccgtypes.nim(224) isInvalidReturnType /home/beta/Programming/Nim/Nim/compiler/ccgtypes.nim(166) mapType /home/beta/Programming/Nim/Nim/compiler/ccgtypes.nim(196) mapType /home/beta/Programming/Nim/Nim/lib/system/assertions.nim(27) failedAssertImpl /home/beta/Programming/Nim/Nim/lib/system/assertions.nim(20) raiseAssert /home/beta/Programming/Nim/Nim/lib/system/fatal.nim(39) sysFatal Error: unhandled exception: /home/beta/Programming/Nim/Nim/compiler/ccgtypes.nim(196, 17) `false` mapType [AssertionError] FAILURE
The text was updated successfully, but these errors were encountered:
revert profiling debug tests for nim-lang/Nim#11892
6b30500
Current error message with Nim devel 1.1.1:
Error: unhandled exception: index out of bounds, the container is empty [IndexError]
Sorry, something went wrong.
fix nim-lang#11892
ccdf22f
Successfully merging a pull request may close this issue.
The following snippet makes the compiler crash.
It is due to the use of
low
instead oflo
in the asm, Nim tries to check the return type and crashes in ccgtypes.Error:
Full stacktrace with debug on the proc names insterted just before genProcParams:
Nim/compiler/ccgtypes.nim
Lines 956 to 957 in 42e83ac
The text was updated successfully, but these errors were encountered: