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

encoding/json: TestBlocking test fails #5486

Closed
alexbrainman opened this issue May 16, 2013 · 8 comments

Comments

Projects
None yet
4 participants
@alexbrainman
Copy link
Member

commented May 16, 2013

# hg id                                                               
909d1af80cd0+                                                                 
# hg diff                                                             
diff -r 909d1af80cd0 src/pkg/encoding/json/stream_test.go                     
--- a/src/pkg/encoding/json/stream_test.go      Tue May 14 16:38:12 2013 -0700
+++ b/src/pkg/encoding/json/stream_test.go      Thu May 16 10:17:30 2013 +1000
@@ -177,6 +177,12 @@                                                          
 }                                                                            
                                                                              
 func TestBlocking(t *testing.T) {                                            
+       for i := 0; i < 1000; i++ {                                           
+               testBlocking(t)                                               
+       }                                                                     
+}                                                                            
+                                                                             
+func testBlocking(t *testing.T) {                                            
        for _, enc := range blockingTests {                                   
                r, w := net.Pipe()                                            
                go w.Write([]byte(enc))                                       
# go test -v -run=Blo                                                       
=== RUN TestBlocking                                                                 
--- FAIL: TestBlocking (0.02 seconds)                                                
        stream_test.go:194: decoding [1, 2, 3]: invalid character '\x00' looking for beginning of value                                                                   
FAIL                                                                                 
exit status 1                                                                        
FAIL    encoding/json   0.027s                                                       
#                                                                           

I use linux/386. It looks like broken by:

changeset:   16794:909d1af80cd0
user:        Carl Shapiro <cshapiro@google.com>
date:        Tue May 14 16:38:12 2013 -0700
summary:     runtime: enable stack scanning by frames

Alex
@lexprfuncall

This comment has been minimized.

Copy link

commented May 16, 2013

Comment 2:

Thanks for the defect report.  I am able to reproduce this issue on a 64-bit Linux.  I
am looking into it right now.
@bradfitz

This comment has been minimized.

Copy link
Member

commented May 16, 2013

Comment 3:

Should we roll it back until there's a fix?
@lexprfuncall

This comment has been minimized.

Copy link

commented May 16, 2013

Comment 4:

A quick update.  It looks like there is some confusion about scanning the incoming
arguments of a goroutine.  If I change the following line from testBlocking
  go w.Write([]byte(enc))
to force writing the argument to Write onto the stack
  b := []byte(enc)
  _ = b
  go w.Write(b)
the crash will no longer reproduce.
@lexprfuncall

This comment has been minimized.

Copy link

commented May 16, 2013

Comment 5:

Brad, yes we can always disable the new stack scan with a flag flip.  It is a one-liner.
 If I cannot get out a fix quickly I will send out a change to disable the scanning by
frames.
@lexprfuncall

This comment has been minimized.

Copy link

commented May 16, 2013

Comment 6:

This crash is caused by the GC ignoring the incoming arguments of a function with
unknown argument size when that function happens to be the initial function of a not
started goroutine.
There is special case code in the general stack scanner to handle functions with an
unknown argument size.  This logic needs to be replicated in the not started goroutine
stack scanner.
I will have a patch shortly.  Fortunately, it is a one-liner.

Status changed to Started.

@lexprfuncall

This comment has been minimized.

Copy link

commented May 16, 2013

@lexprfuncall

This comment has been minimized.

Copy link

commented May 16, 2013

Comment 8:

Owner changed to @lexprfuncall.

@lexprfuncall

This comment has been minimized.

Copy link

commented May 16, 2013

Comment 9:

This issue was closed by revision 50ba6e1.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.