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

regression: test demo fails: SIGSEGV: Illegal storage access #341

Closed
timotheecour opened this issue Nov 7, 2018 · 1 comment
Closed

Comments

@timotheecour
Copy link
Contributor

timotheecour commented Nov 7, 2018

cd nimx
cd test
nake
SIGSEGV: Illegal storage access

upon further inspection:
nake produces (and runs) ./nakefile; and running ./nakefile compiles a nim binary (IIUC) and runs this binary then produces that SIGSEGV: Illegal storage access

however I have no way to know which is that binary (so I can't debug that program via lldb ; see fowlmouth/nake#64 ; also, I can't debug via lldb ./nakefile either, this time because of nim-lang/Nim#9634)

Note:
after echo-style debugging it crashes here: inside result = superTypeAux(getImpl(t[1].symbol))


proc superTypeAux(t: NimNode, indent: int): NimNode =
    doAssert(indent < 10, "Recursion too deep")

    template superTypeAux(t: NimNode): NimNode = superTypeAux(t, indent + 1)
    proc log(args: varargs[string, `$`]) =
        discard
        # echo "- ", "  " * indent, args.join(" ")

    log "superTypeAux: ", treeRepr(t)
    case t.kind
    of nnkSym:
        if $t == "RootRef": return t
        let ty = getTypeImpl(t)
        log "TypeKind: ", ty.typeKind
        result = superTypeAux(ty)
    of nnkBracketExpr:
        echo "ok1"
        echo t.len
        echo t[1] == nil
        result = superTypeAux(getImpl(t[1].symbol))
        echo "ok2"

EDIT
maybe even crashes here: getTypeImpl(t[^1]) in result = superTypeAux(getTypeImpl(t[^1])) in the nnkRefTy clause

@timotheecour timotheecour changed the title test demo fails: SIGSEGV: Illegal storage access regression: test demo fails: SIGSEGV: Illegal storage access Nov 7, 2018
@timotheecour
Copy link
Contributor Author

timotheecour commented Nov 7, 2018

/cc @yglukhov
looks like it was same root cause with nim-lang/Nim#9600 because after rebuilding after the commit that fixed it (nim-lang/Nim@fc740c5) this now works; thanks @jcosborn !

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

1 participant