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

Panic while testing github.com/mstone/focus/ot #8

Closed
mstone opened this issue Jan 2, 2015 · 5 comments
Closed

Panic while testing github.com/mstone/focus/ot #8

mstone opened this issue Jan 2, 2015 · 5 comments

Comments

@mstone
Copy link

mstone commented Jan 2, 2015

I tried go-mutesting on an operational transformation algorithm I'm implementing (package github.com/mstone/focus/ot) and got this panic while running:

go-mutesting --exec "$GOPATH/src/github.com/zimmski/go-mutesting/scripts/simple.sh" github.com/mstone/focus/ot
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x448bd5]

goroutine 16 [running]:
runtime.panic(0x5dd0c0, 0x71caf3)
    /usr/lib/go/src/pkg/runtime/panic.c:279 +0xf5
go/ast.(*Ident).Pos(0x0, 0x57f2c0)
    /usr/lib/go/src/pkg/go/ast/ast.go:423 +0x5
go/ast.(*BinaryExpr).Pos(0xc2080682d0, 0xc2080a4798)
    /usr/lib/go/src/pkg/go/ast/ast.go:441 +0x3f
go/printer.(*printer).binaryExpr(0xc20804e000, 0xc208068300, 0x0, 0x6, 0x1)
    /usr/lib/go/src/pkg/go/printer/nodes.go:647 +0x399
go/printer.(*printer).expr1(0xc20804e000, 0x7f46a38d5ae0, 0xc208068300, 0x0, 0x1)
    /usr/lib/go/src/pkg/go/printer/nodes.go:686 +0xf81
go/printer.(*printer).expr(0xc20804e000, 0x7f46a38d5ae0, 0xc208068300)
    /usr/lib/go/src/pkg/go/printer/nodes.go:893 +0x4d
go/printer.(*printer).controlClause(0xc20804e000, 0xc2080a4d00, 0x0, 0x0, 0x7f46a38d5ae0, 0xc208068300, 0x0, 0x0)
    /usr/lib/go/src/pkg/go/printer/nodes.go:996 +0x12c
go/printer.(*printer).stmt(0xc20804e000, 0x7f46a38d5b18, 0xc20806e3c0, 0x100)
    /usr/lib/go/src/pkg/go/printer/nodes.go:1151 +0x29f2
    /usr/lib/go/src/pkg/go/printer/nodes.go:942 +0xfe
go/printer.(*printer).adjBlock(0xc20804e000, 0x33, 0xb, 0xc208068510)
    /usr/lib/go/src/pkg/go/printer/nodes.go:1514 +0x683
go/printer.(*printer).funcDecl(0xc20804e000, 0xc208068540)
    /usr/lib/go/src/pkg/go/printer/nodes.go:1538 +0x2b5
go/printer.(*printer).decl(0xc20804e000, 0x7f46a38d59c8, 0xc208068540)
    /usr/lib/go/src/pkg/go/printer/nodes.go:1548 +0xa4
go/printer.(*printer).declList(0xc20804e000, 0xc20804a400, 0x13, 0x20)
    /usr/lib/go/src/pkg/go/printer/nodes.go:1589 +0x1b0
go/printer.(*printer).file(0xc20804e000, 0xc20804c500)
    /usr/lib/go/src/pkg/go/printer/nodes.go:1597 +0x18b
go/printer.(*printer).printNode(0xc20804e000, 0x5ce020, 0xc20804c500, 0x0, 0x0)
    /usr/lib/go/src/pkg/go/printer/printer.go:1087 +0x8b2
go/printer.(*Config).fprint(0xc2080a57d8, 0x7f46a38d6170, 0xc208088060, 0xc20800e040, 0x5ce020, 0xc20804c500, 0xc208068150, 0x0, 0x0)
    /usr/lib/go/src/pkg/go/printer/printer.go:1226 +0xad
go/printer.(*Config).Fprint(0xc2080a57d8, 0x7f46a38d6170, 0xc208088060, 0xc20800e040, 0x5ce020, 0xc20804c500, 0x0, 0x0)
    /usr/lib/go/src/pkg/go/printer/printer.go:1284 +0x96
go/printer.Fprint(0x7f46a38d6170, 0xc208088060, 0xc20800e040, 0x5ce020, 0xc20804c500, 0x0, 0x0)
    /usr/lib/go/src/pkg/go/printer/printer.go:1291 +0xb0
main.saveAST(0xc208024720, 0xc2080b00c0, 0x57, 0xc20800e040, 0x7f46a38d5ba0, 0xc20804c500, 0x0, 0x0, 0xc208024500, 0x0, ...)
    /home/mistone/go/src/github.com/zimmski/go-mutesting/cmd/go-mutesting/main.go:396 +0x202
main.mainCmd(0xc20800e010, 0x3, 0x3, 0xa)
    /home/mistone/go/src/github.com/zimmski/go-mutesting/cmd/go-mutesting/main.go:257 +0x1dfc
main.main()
    /home/mistone/go/src/github.com/zimmski/go-mutesting/cmd/go-mutesting/main.go:352 +0x69

goroutine 19 [finalizer wait]:
runtime.park(0x417dc0, 0x721070, 0x71fb89)
    /usr/lib/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x721070, 0x71fb89)
    /usr/lib/go/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /usr/lib/go/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /usr/lib/go/src/pkg/runtime/proc.c:1445

goroutine 22 [chan receive]:
github.com/zimmski/go-mutesting/mutator/expression.(*MutatorRemoveTerm).Mutate(0x721570, 0x7f46a38d60a8, 0xc2080682d0, 0xc2080b0240)
    /home/mistone/go/src/github.com/zimmski/go-mutesting/mutator/expression/remove.go:76 +0x1b6
github.com/zimmski/go-mutesting.(*mutateWalk).Visit(0xc2080b6020, 0x7f46a38d60a8, 0xc2080682d0, 0x0, 0x0)
    /home/mistone/go/src/github.com/zimmski/go-mutesting/walk.go:71 +0x115
go/ast.Walk(0x7f46a38d5bd0, 0xc2080b6020, 0x7f46a38d60a8, 0xc2080682d0)
    /usr/lib/go/src/pkg/go/ast/walk.go:52 +0x58
go/ast.Walk(0x7f46a38d5bd0, 0xc2080b6020, 0x7f46a38d60a8, 0xc208068300)
    /usr/lib/go/src/pkg/go/ast/walk.go:147 +0x1ead
go/ast.Walk(0x7f46a38d5bd0, 0xc2080b6020, 0x7f46a38d6078, 0xc20806e3c0)
    /usr/lib/go/src/pkg/go/ast/walk.go:230 +0x43bc
go/ast.walkStmtList(0x7f46a38d5bd0, 0xc2080b6020, 0xc20806e580, 0x3, 0x4)
    /usr/lib/go/src/pkg/go/ast/walk.go:32 +0xd1
go/ast.Walk(0x7f46a38d5bd0, 0xc2080b6020, 0x7f46a38d5ec8, 0xc208068510)
    /usr/lib/go/src/pkg/go/ast/walk.go:224 +0x41e7
go/ast.Walk(0x7f46a38d5bd0, 0xc2080b6020, 0x7f46a38d5e68, 0xc208068540)
    /usr/lib/go/src/pkg/go/ast/walk.go:342 +0xccb
go/ast.walkDeclList(0x7f46a38d5bd0, 0xc2080b6020, 0xc20804a400, 0x13, 0x20)
    /usr/lib/go/src/pkg/go/ast/walk.go:38 +0xd1
go/ast.Walk(0x7f46a38d5bd0, 0xc2080b6020, 0x7f46a38d5ba0, 0xc20804c500)
    /usr/lib/go/src/pkg/go/ast/walk.go:351 +0x2cb6
github.com/zimmski/go-mutesting.func·001()
    /home/mistone/go/src/github.com/zimmski/go-mutesting/walk.go:51 +0x71
created by github.com/zimmski/go-mutesting.MutateWalk
    /home/mistone/go/src/github.com/zimmski/go-mutesting/walk.go:54 +0xdb
@mstone
Copy link
Author

mstone commented Jan 2, 2015

(NB: this is with

$ go version
go version go1.3.2 linux/amd64

and with go-mutesting from 9572a4a.)

Also, running with --debug and --verbose does not give any obvious clues as to the nature of the problem. :-/

@zimmski
Copy link
Owner

zimmski commented Jan 2, 2015

I can reproduce it with "go1.4 linux/amd64"

@zimmski
Copy link
Owner

zimmski commented Jan 3, 2015

@mstone can you test if the newest revision b4485d5 fixes the problem for you?

@mstone
Copy link
Author

mstone commented Jan 3, 2015

Seems fixed, thanks!

(And of course, thank you for the cool testing software!)

@zimmski
Copy link
Owner

zimmski commented Jan 3, 2015

I am glad that you find it useful :-) There is stil a lot what could be done so please do not hesitate to open issues if you have any ideas. I am thinking of adding some additional mutators for switches and constant values but I am a little swamped right now.
Happy new year btw ^^

@zimmski zimmski closed this as completed Jan 3, 2015
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

2 participants