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

x/net/ipv4: SetICMPFilter panic in 1.9 #22557

Closed
arthur-xie opened this issue Nov 3, 2017 · 5 comments
Closed

x/net/ipv4: SetICMPFilter panic in 1.9 #22557

arthur-xie opened this issue Nov 3, 2017 · 5 comments

Comments

@arthur-xie
Copy link

arthur-xie commented Nov 3, 2017

Suddenly, the tested(under OS X 10.11) functions (IPPing and TraceRoute diagnostics) fail to work any more.

The panic stack trace:

2017/12/03 14:42:22 [trace_route.go:259][E] 000000000001: Trace route panic: reflect: call of reflect.Value.Int on zero Value
2017/12/03 14:42:22 [trace_route.go:260][E] 000000000001: goroutine 71 [running]:
runtime/debug.Stack(0xc42023aff0, 0xc42003faa0, 0x2)
	/usr/local/Cellar/go/1.9/libexec/src/runtime/debug/stack.go:24 +0xa7
github.com/unosys/dm/unotr/agent.(*traceRoute).test.func1(0xc420158b40, 0xc42003ff18)
	/Users/arthur/WorkSpace/golang/src/github.com/unosys/dm/unotr/agent/trace_route.go:260 +0xcd
panic(0x462e620, 0xc420206120)
	/usr/local/Cellar/go/1.9/libexec/src/runtime/panic.go:491 +0x283
reflect.Value.Int(0x0, 0x0, 0x0, 0x46e4ff7)
	/usr/local/Cellar/go/1.9/libexec/src/reflect/value.go:908 +0x141
golang.org/x/net/internal/netreflect.socketOf(0x4a285c0, 0xc420418008, 0xc420418008, 0x4a285c0, 0xc420418008)
	/Users/arthur/WorkSpace/golang/src/golang.org/x/net/internal/netreflect/socket_posix.go:26 +0x196
golang.org/x/net/internal/netreflect.PacketSocketOf(0x4a28260, 0xc420418008, 0xc42003fc98, 0xc42003fca0, 0x4045b27)
	/Users/arthur/WorkSpace/golang/src/golang.org/x/net/internal/netreflect/socket.go:33 +0x7d
golang.org/x/net/ipv4.(*dgramOpt).SetICMPFilter(0xc4200801a0, 0xc42003fce0, 0xc420206060, 0x7)
	/Users/arthur/WorkSpace/golang/src/golang.org/x/net/ipv4/dgramopt_posix.go:248 +0x51
github.com/unosys/dm/unotr/agent.(*traceRoute).trace(0xc420414000, 0xc420158b40, 0x0, 0x0)
	/Users/arthur/WorkSpace/golang/src/github.com/unosys/dm/unotr/agent/trace_route.go:166 +0x1d0
github.com/unosys/dm/unotr/agent.(*traceRoute).test(0xc420414000, 0xc420158b40, 0x0, 0x0)
	/Users/arthur/WorkSpace/golang/src/github.com/unosys/dm/unotr/agent/trace_route.go:265 +0x7f
github.com/unosys/dm/unotr/agent.traceRouteHandler.func1(0xc420158b40, 0xc4203da660)
	/Users/arthur/WorkSpace/golang/src/github.com/unosys/dm/unotr/agent/trace_route.go:292 +0x96
created by github.com/unosys/dm/unotr/agent.traceRouteHandler
	/Users/arthur/WorkSpace/golang/src/github.com/unosys/dm/unotr/agent/trace_route.go:280 +0x67

Project code snippet:

var filter ipv4.ICMPFilter
filter.SetAll(true)
filter.Accept(ipv4.ICMPTypeTimeExceeded)
c.IPv4PacketConn().SetICMPFilter(&filter)

After switch back to 1.8.1, everything works fine.

@gbbr gbbr changed the title golang 1.9 SetICMPFilter panic x/net/ipv4: SetICMPFilter panic in 1.9 Nov 3, 2017
@gopherbot gopherbot added this to the Unreleased milestone Nov 3, 2017
@bradfitz
Copy link
Contributor

bradfitz commented Nov 3, 2017

What git revision of x/net are you using?

@arthur-xie
Copy link
Author

Golang was installed through homebrew, I don't know how to check the git reversion. When try to upgrade, homebrew download it from https://homebrew.bintray.com/bottles/go-1.9.2.el_capitan.bottle.tar.gz. After this upgrade and updating GOROOT environment variable , the panic problem still exist.

@arthur-xie
Copy link
Author

arthur-xie commented Nov 4, 2017

Sorry, I made a mistake. The x/net is not under the $GOROOT but $GOPATH/src/golang.org. The git info is:

$ git log -1
commit daba796358cd2742b75aae05761f1b898c9f6a5c
Author: Mikio Hara <mikioh.mikioh@gmail.com>
Date:   Thu Oct 20 12:26:43 2016 +0900

    ipv6: remove unnecessary control message marshaling
    
    The encoded data is just for debugging at kernel side and has
    remained in normal code path until now, oops.
    
    Change-Id: I3581bf73a6e6c9ec4b6228a670b6d8338f13ee14
    Reviewed-on: https://go-review.googlesource.com/31535
    Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Ian Lance Taylor <iant@golang.org>

After upgrading to

$ git log -1
commit 01c190206fbdffa42f334f4b2bf2220f50e64920
Author: Tom Bergan <tombergan@google.com>
Date:   Thu Nov 2 11:53:09 2017 -0700

    http2: fix transport data race on reused *http.Request objects
    
    Based on golang/go#19653, it should be possible to reuse an http.Request
    object after the outstanding request has completed. This CL fixes a race
    in the http/2 library that occurs when a caller tries to reuse an
    http.Request just after the request completed.
    
    The new test failed with -race before this CL and passes after this CL.
    Verified with -count 10000.
    
    Updates golang/go#21316
    
    Change-Id: I014cf9cefd0dd21f6f41763ba554d23ddc7fca40
    Reviewed-on: https://go-review.googlesource.com/75530
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>

The panic problem disappeared.

@bradfitz
Copy link
Contributor

bradfitz commented Nov 4, 2017

Thanks for confirming. I'd thought this sounded familiar. I'm going to close as already fixed in the past year. Somebody else can search/bisect to figure out the dup bug and the fix if they're curious.

@bradfitz bradfitz closed this as completed Nov 4, 2017
@mikioh
Copy link
Contributor

mikioh commented Jan 15, 2018

Dup of #19209.

@golang golang locked and limited conversation to collaborators Jan 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants