golang/go

cmd/asm: nil deref (4)

dvyukov opened this issue · 4 comments

cmd/asm crashes on the following program:

FUNCDATA(SB),0
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4b05b1]

goroutine 1 [running]:
cmd/internal/obj.Mconv(0xc82007d830, 0x0, 0x0)
    src/cmd/internal/obj/util.go:460 +0x661
cmd/internal/obj.Dconv(0x70fce0, 0xc82007d830, 0x0, 0x0)
    src/cmd/internal/obj/util.go:384 +0xc0c
cmd/asm/internal/asm.(*Parser).validImmediate(0xc82007de70, 0x60e590, 0x8, 0xc82007d830, 0x7)
    src/cmd/asm/internal/asm/asm.go:92 +0x8f
cmd/asm/internal/asm.(*Parser).asmFuncData(0xc82007de70, 0xc8200102d0, 0x8, 0xc82007db28, 0x2, 0x3)
    src/cmd/asm/internal/asm/asm.go:320 +0xe7
cmd/asm/internal/asm.(*Parser).pseudo(0xc82007de70, 0x7, 0xc8200102d0, 0x8, 0xc82007db28, 0x2, 0x3)
    src/cmd/asm/internal/asm/parse.go:225 +0xae
cmd/asm/internal/asm.(*Parser).line(0xc82007de70, 0xc82000a3a0)
    src/cmd/asm/internal/asm/parse.go:185 +0x990
cmd/asm/internal/asm.(*Parser).Parse(0xc82007de70, 0xc82000a3a0, 0xc8200182a0)
    src/cmd/asm/internal/asm/parse.go:85 +0x21
main.main()
    src/cmd/asm/main.go:59 +0xb85

go version devel +a1aafdb Tue Sep 15 16:12:59 2015 +0000 linux/amd64

CL https://golang.org/cl/14595 mentions this issue.

cmd/asm survived whole minute of feeding with modem noise for the first time! :)

This is the one I should have fixed the first time. I was protecting obj instead of fixing it.

OK, 1093 unique crashes after the night. Let's see. :)