-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/race: bogus race reports #15739
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
Comments
On freebsd-amd64-race builder: https://build.golang.org/log/74ead1f381092682cd2985b9c91ccf448568f60c |
Those first two stacks make no sense to me:
I'm not sure how to debug this. @dvyukov? Is this correct? |
I got another bogus one, Here's why it's bogus: The race says:
But here's the code, with line 827 at the bottom highlighted: func readRequest(b *bufio.Reader, deleteHostHeader bool) (req *Request, err error) {
tp := newTextprotoReader(b)
req = new(Request)
// First line: GET /index.html HTTP/1.0
var s string
if s, err = tp.ReadLine(); err != nil {
return nil, err
}
defer func() {
putTextprotoReader(tp)
if err == io.EOF {
err = io.ErrUnexpectedEOF
}
}()
var ok bool
req.Method, req.RequestURI, req.Proto, ok = parseRequestLine(s)
if !ok {
return nil, &badStringError{"malformed HTTP request", s}
}
rawurl := req.RequestURI
if req.ProtoMajor, req.ProtoMinor, ok = ParseHTTPVersion(req.Proto); !ok {
return nil, &badStringError{"malformed HTTP version", req.Proto}
}
// CONNECT requests are used two different ways, and neither uses a full URL:
// The standard use is to tunnel HTTPS through an HTTP proxy.
// It looks like "CONNECT www.google.com:443 HTTP/1.1", and the parameter is
// just the authority section of a URL. This information should go in req.URL.Host.
//
// The net/rpc package also uses CONNECT, but there the parameter is a path
// that starts with a slash. It can be parsed with the regular URL parser,
// and the path will end up in req.URL.Path, where it needs to be in order for
// RPC to work.
justAuthority := req.Method == "CONNECT" && !strings.HasPrefix(rawurl, "/")
if justAuthority {
rawurl = "http://" + rawurl
}
if req.URL, err = url.ParseRequestURI(rawurl); err != nil { // <----- LINE 827
return nil, err
} That is all in a single goroutine, and it creates the memory (on the second line of the function), before assigning to it. It can't race with anything yet, because that memory hasn't even escaped. @dvyukov, up to you to debug. |
@aclements, did this start at the same time as #15747 (with Keith's leak fix)? |
@rsc, hard to say (and hard to grep for). I only see two on the dashboard since the beginning of the year: 2016-05-18T20:44:00-075880a/linux-amd64-race |
Here:
right after race reports on URI object. That's concerning. It may be a bug affecting non-race build. Do we still have any unfixed memory corruptions? |
I've tried to reproduce it on Then I checked out I think this is a bug unrelated to race mode which was fixed recently.
|
Likely, perhaps around liveliness check and/or consumer stack handling, not sure. Closing as the original reporter. I've checked go1.7beta1-race on freebsd-vm too and didn't see any race report. |
See https://build.golang.org/log/ec042c758132274722706baf832f2570629dd322
The text was updated successfully, but these errors were encountered: