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

followup #16400; use use -d:nimCompilerStackraceHints in more places #18282

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Jun 16, 2021

followup #16400

this helped me a lot to reduce the bug in #18278 (original failure was from complicated code in nimterop in which stacktrace contained no useful hint as to where it originated from in user code).

The design I'm following is to add setFrameMsg in key places in the compiler that are often visited, which increases chances we find the relevant location in user code.

with --stacktrace:on --stacktracemsgs -d:nimCompilerStackraceHints:

before PR

...
/Users/timothee/git_clone/nim/Nim_devel/compiler/semexprs.nim(1039) semDirectOp
/Users/timothee/git_clone/nim/Nim_devel/compiler/semexprs.nim(870) semOverloadedCallAnalyseEffects
/Users/timothee/git_clone/nim/Nim_devel/compiler/semcall.nim(582) semOverloadedCall
/Users/timothee/git_clone/nim/Nim_devel/compiler/semcall.nim(365) resolveOverloads
/Users/timothee/git_clone/nim/Nim_devel/compiler/semcall.nim(95) pickBestCandidate
/Users/timothee/git_clone/nim/Nim_devel/compiler/sigmatch.nim(2551) matches
/Users/timothee/git_clone/nim/Nim_devel/compiler/sigmatch.nim(2485) matchesAux
/Users/timothee/git_clone/nim/Nim_devel/compiler/sigmatch.nim(2207) paramTypesMatch
/Users/timothee/git_clone/nim/Nim_devel/compiler/sigmatch.nim(2032) paramTypesMatchAux
/Users/timothee/git_clone/nim/Nim_devel/compiler/sem.nim(338) tryConstExpr
/Users/timothee/git_clone/nim/Nim_devel/compiler/vm.nim(2213) evalConstExpr
/Users/timothee/git_clone/nim/Nim_devel/compiler/vm.nim(2201) evalConstExprAux
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(2179) genExpr
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(2043) gen
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(1139) genMagic
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(815) genVarargsABC
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(293) gen
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(2099) gen
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(2009) gen
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(1670) genRdVar
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(1460) genAsgn
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(305) genx
/Users/timothee/git_clone/nim/Nim_devel/compiler/vmgen.nim(2009) gen
/Users/timothee/git_clone/nim/Nim_devel/compiler/msgs.nim(612) genRdVar
/Users/timothee/git_clone/nim/Nim_devel/compiler/msgs.nim(599) internalErrorImpl
/Users/timothee/git_clone/nim/Nim_devel/compiler/msgs.nim(555) liMessage
/Users/timothee/git_clone/nim/Nim_devel/compiler/msgs.nim(413) handleError
/Users/timothee/git_clone/nim/Nim_devel/compiler/msgs.nim(402) quit

after PR

...
/Users/timothee/git_clone/nim/Nim_prs/compiler/semexprs.nim(1039) semDirectOp
/Users/timothee/git_clone/nim/Nim_prs/compiler/semexprs.nim(870) semOverloadedCallAnalyseEffects
/Users/timothee/git_clone/nim/Nim_prs/compiler/semcall.nim(582) semOverloadedCall
/Users/timothee/git_clone/nim/Nim_prs/compiler/semcall.nim(365) resolveOverloads
/Users/timothee/git_clone/nim/Nim_prs/compiler/semcall.nim(95) pickBestCandidate
/Users/timothee/git_clone/nim/Nim_prs/compiler/sigmatch.nim(2551) matches
/Users/timothee/git_clone/nim/Nim_prs/compiler/sigmatch.nim(2485) matchesAux
/Users/timothee/git_clone/nim/Nim_prs/compiler/sigmatch.nim(2207) paramTypesMatch
/Users/timothee/git_clone/nim/Nim_prs/compiler/sigmatch.nim(2032) paramTypesMatchAux
/Users/timothee/git_clone/nim/Nim_prs/compiler/sem.nim(338) tryConstExpr
/Users/timothee/git_clone/nim/Nim_prs/compiler/vm.nim(2213) evalConstExpr
/Users/timothee/git_clone/nim/Nim_prs/compiler/vm.nim(2201) evalConstExprAux
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(2184) genExpr
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(2048) gen /Users/timothee/git_clone/nim/timn/tests/nim/all/t12412.nim(33, 23) nkCall {}
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(1142) genMagic
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(818) genVarargsABC
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(296) gen
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(2104) gen /Users/timothee/git_clone/nim/timn/tests/nim/all/t12412.nim(33, 20) nkStmtListExpr {}
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(2014) gen /Users/timothee/git_clone/nim/timn/tests/nim/all/t12412.nim(33, 20) nkSym {}
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(1673) genRdVar
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(1463) genAsgn
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(308) genx
/Users/timothee/git_clone/nim/Nim_prs/compiler/vmgen.nim(2014) gen /Users/timothee/git_clone/nim/timn/tests/nim/all/t12412.nim(33, 20) nkSym {}
/Users/timothee/git_clone/nim/Nim_prs/compiler/msgs.nim(612) genRdVar
/Users/timothee/git_clone/nim/Nim_prs/compiler/msgs.nim(599) internalErrorImpl
/Users/timothee/git_clone/nim/Nim_prs/compiler/msgs.nim(555) liMessage
/Users/timothee/git_clone/nim/Nim_prs/compiler/msgs.nim(413) handleError
/Users/timothee/git_clone/nim/Nim_prs/compiler/msgs.nim(402) quit

@timotheecour timotheecour added Easy Ready For Review (please take another look): ready for next review round labels Jun 16, 2021
@timotheecour timotheecour merged commit 3c854e8 into nim-lang:devel Jun 17, 2021
@timotheecour timotheecour deleted the pr_nimCompilerStackraceHints_followup branch June 17, 2021 06:04
@timotheecour
Copy link
Member Author

@Araq I'm merging this; same as the previous related PRs and has no effect outside of -d:nimCompilerStackraceHints

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Ready For Review (please take another look): ready for next review round
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant