Skip to content

reflect: reflect.unpackEface reflect/value.go:174 unexpected fault address 0x0 #7841

Closed
@gopherbot

Description

@gopherbot

by toffaletti:

What does 'go version' print?

go version devel +f613443bb13a Tue Apr 22 21:12:15 2014 -0700 linux/amd64

What steps reproduce the problem?

I haven't been able to distill this to code I can share, but it involves concurrent
requests to an http server that spawns many goroutines and connects to other services to
assemble results. The crash happens in the code that is writing the response back to the
client. The crash is repeatable, but only when access to the server is concurrent. I've
compiled the code with the race detector and it crashes before any data races are
discovered.

The server has other resources which exercise most of the same code paths as the
crashing one but use static file input instead of talking to backend services and
spawning goroutines. I've yet to reproduce the crash using these resources.

The crash is not repeatable on 1.2.1 and is data race clean for a large set of inputs.

What happened?

unexpected fault address 0x0                                                            
                                                                                        
                                                 fatal error: fault                     
                                                                                        
                                                                                        
         [signal 0x7 code=0x80 addr=0x0 pc=0x5b4315]                                    
                                                                                        
                                                          

goroutine 115 [running]:
runtime.throw(0x12e48d6)
        /go/src/pkg/runtime/panic.c:520 +0x69 fp=0xc209eef238
runtime.sigpanic()
        /go/src/pkg/runtime/os_linux.c:232 +0x25b fp=0xc209eef250
reflect.unpackEface(0x64616f6c6e776f64, 0x676e69, 0x0, 0x0, 0x0, 0x0)
        /go/src/pkg/reflect/value.go:174 +0xd5 fp=0xc209eef2b0
reflect.Value.Elem(0xa882c0, 0xc2098662d0, 0x0, 0x146, 0x0, 0x0, 0x0, 0x0)
        /go/src/pkg/reflect/value.go:843 +0xdd fp=0xc209eef340
encoding/json.interfaceEncoder(0xc209ab8160, 0xa882c0, 0xc2098662d0, 0x0, 0x146,
0xa88200)
        /go/src/pkg/encoding/json/encode.go:555 +0xc6 fp=0xc209eef390
encoding/json.(*arrayEncoder).encode(0xc20815e248, 0xc209ab8160, 0xa73140, 0xc20855ab10,
0x0, 0x176, 0x47e300)
        /go/src/pkg/encoding/json/encode.go:685 +0x191 fp=0xc209eef410
encoding/json.*arrayEncoder.(encoding/json.encode)·fm(0xc209ab8160, 0xa73140,
0xc20855ab10, 0x0, 0x176, 0x47e300)
        /go/src/pkg/encoding/json/encode.go:692 +0x70 fp=0xc209eef450
encoding/json.(*sliceEncoder).encode(0xc20815e110, 0xc209ab8160, 0xa73140, 0xc20855ab10,
0x0, 0x176, 0x100)
        /go/src/pkg/encoding/json/encode.go:662 +0xf1 fp=0xc209eef490
encoding/json.*sliceEncoder.(encoding/json.encode)·fm(0xc209ab8160, 0xa73140,
0xc20855ab10, 0x0, 0x176, 0x0)
        /go/src/pkg/encoding/json/encode.go:671 +0x70 fp=0xc209eef4d0
encoding/json.(*structEncoder).encode(0xc209432030, 0xc209ab8160, 0xc41880,
0xc20855aa80, 0x0, 0x196, 0x47e300)
        /go/src/pkg/encoding/json/encode.go:582 +0x337 fp=0xc209eef648
encoding/json.*structEncoder.(encoding/json.encode)·fm(0xc209ab8160, 0xc41880,
0xc20855aa80, 0x0, 0x196, 0xc20855aa00)
        /go/src/pkg/encoding/json/encode.go:596 +0x70 fp=0xc209eef688
encoding/json.(*ptrEncoder).encode(0xc20815e180, 0xc209ab8160, 0xa615c0, 0xc209138b50,
0x0, 0x166, 0x0)
        /go/src/pkg/encoding/json/encode.go:704 +0x15d fp=0xc209eef6f8
encoding/json.*ptrEncoder.(encoding/json.encode)·fm(0xc209ab8160, 0xa615c0,
0xc209138b50, 0x0, 0x166, 0xa61500)
        /go/src/pkg/encoding/json/encode.go:709 +0x70 fp=0xc209eef738
encoding/json.(*arrayEncoder).encode(0xc20815e188, 0xc209ab8160, 0xa70080, 0xc20a4eec60,
0x0, 0x172, 0x47e300)
        /go/src/pkg/encoding/json/encode.go:685 +0x191 fp=0xc209eef7b8
encoding/json.*arrayEncoder.(encoding/json.encode)·fm(0xc209ab8160, 0xa70080,
0xc20a4eec60, 0x0, 0x172, 0x7fdb2af0c100)
        /go/src/pkg/encoding/json/encode.go:692 +0x70 fp=0xc209eef7f8
encoding/json.(*sliceEncoder).encode(0xc20815e190, 0xc209ab8160, 0xa70080, 0xc20a4eec60,
0x0, 0x172, 0x47e300)
        /go/src/pkg/encoding/json/encode.go:662 +0xf1 fp=0xc209eef838
encoding/json.*sliceEncoder.(encoding/json.encode)·fm(0xc209ab8160, 0xa70080,
0xc20a4eec60, 0x0, 0x172, 0xc20a4eec00)
        /go/src/pkg/encoding/json/encode.go:671 +0x70 fp=0xc209eef878
encoding/json.(*encodeState).reflectValue(0xc209ab8160, 0xa70080, 0xc20a4eec60, 0x0,
0x172)
        /go/src/pkg/encoding/json/encode.go:297 +0x93 fp=0xc209eef8b0
encoding/json.(*encodeState).marshal(0xc209ab8160, 0xa70080, 0xc20a4eec60, 0x0, 0x0)
        /go/src/pkg/encoding/json/encode.go:268 +0xf6 fp=0xc209eef900
encoding/json.(*Encoder).Encode(0xc20945cb60, 0xa70080, 0xc20a4eec60, 0x0, 0x0)
        /go/src/pkg/encoding/json/stream.go:161 +0xf4 fp=0xc209eef9b0

What should have happened instead?

Please provide any additional information below.

Perhaps related to #6788?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions