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

cmd/go: ignore SIGQUIT #3581

Closed
bradfitz opened this issue Apr 30, 2012 · 9 comments
Closed

cmd/go: ignore SIGQUIT #3581

bradfitz opened this issue Apr 30, 2012 · 9 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@bradfitz
Copy link
Contributor

not pretty:

^\SIGQUIT: quit
PC=0x415278

main.client()
    SIGQUIT: quit/home/bradfitz/x.go
:PC=1100x44c649 +
0x1b9

created by main.main
    /home/bradfitz/x.go:126 +0x23

goroutine 1 [
chan receivegoroutine ]:
1 [net.(*pollServer).WaitReadchan receive(]:
0xf84005e8c0, 0xf8400b6000, main.(*builder).do0xf84005ab40(, 0xf8400efba00xb, ,
0xf840250a500x1, , ...0xf8400ecc00)
,   0xf8400dc2c0/home/bradfitz/go/src/pkg/net/fd.go)
:   268/home/bradfitz/go/src/cmd/go/build.go +:0x73606
 +net.(*netFD).accept0x3e7(
0xf8400b6000, main.runRun0x44f6a4(, 0x85c7c80x0, , 0xf840083b600xf84005c150, ,
0x1000000010xf840070040, , ...0x0)
)
        /home/bradfitz/go/src/pkg/net/fd.go/home/bradfitz/go/src/cmd/go/run.go::62258 + +0x20d0x425

net.(*TCPListener).AcceptTCP(main.main0xf840070258(, )
0xf840060a70    , /home/bradfitz/go/src/cmd/go/main.go0x0:, 1410x0 +0x426

goroutine , 20x8 [, ...syscall)
]:
    /home/bradfitz/go/src/pkg/net/tcpsock_posix.gocreated by :runtime.main229
 +  0x71/home/bradfitz/go/src/pkg/runtime/proc.c
:net.(*TCPListener).Accept221(
0xf840070258
, goroutine 0x03,  [0x0syscall, ]:
0x0, 0x0, ...syscall.Syscall6)
(   )
/home/bradfitz/go/src/pkg/net/tcpsock_posix.go  :/home/bradfitz/go/src/pkg/syscall/asm_linux_amd64.s239:
+400x49 +
0x5net/http.(*Server).Serve
(0xf84005e640syscall.wait4, (0xf84005e9800x1561, , 0xf8400702580xf840164888, , 0x00x0, ,
0x00xf840171480, ..., )
0x1 , .../home/bradfitz/go/src/pkg/net/http/server.go)
:   1016/home/bradfitz/go/src/pkg/syscall/zerrors_linux_amd64.go +:0x881599
 +net/http.(*Server).ListenAndServe0x81(
0xf84005e640, syscall.Wait40xf84005e640(, 0x15610x400ff4, , 0x7f4c6be8cc540x401898, )
0x0 , /home/bradfitz/go/src/pkg/net/http/server.go0xf840171480:, 10060x0 +, ...0xb6)

    net/http.ListenAndServe/home/bradfitz/go/src/pkg/syscall/syscall_linux.go(:0x5d50bc178,  +0x3332313a000000050x6a, 
0x0, 0x0os.(*Process).wait, (0x400ff40xf8402d7280, ..., )
0xf840098010    , /home/bradfitz/go/src/pkg/net/http/server.go0x0:, 10780x0 +, 0x690x474eea
, ...main.main)
(   )
/home/bradfitz/go/src/pkg/os/exec_unix.go   :/home/bradfitz/x.go22: +1290xe1 +
0x89os.(*Process).Wait
(
0xf8402d7280goroutine , 20x0 [, runnable0x7f4c6be8cd28]:
, 0xf8402df870created by )
runtime.main    
/home/bradfitz/go/src/pkg/os/doc.go :/home/bradfitz/go/src/pkg/runtime/proc.c43: +2210x25


goroutine os/exec.(*Cmd).Wait4( [0xf8402f8400timer goroutine (idle), ]:
0x0, created by 0x0addtimer, 
0x0 )
/home/bradfitz/go/src/pkg/runtime/ztime_amd64.c :/home/bradfitz/go/src/pkg/os/exec/exec.go69:
302
 +goroutine 0x1b75
 [os/exec.(*Cmd).Runsyscall(]:
0xf8402f8400, syscall.Syscall60x652f18(, )
0xf840098010    , /home/bradfitz/go/src/pkg/syscall/asm_linux_amd64.s0xf8400824e0:)
40   +/home/bradfitz/go/src/pkg/os/exec/exec.go0x5:
226syscall.EpollWait +(0x6d0xf800000006
, main.runStdin0xf8400aa010(, 0x7f4c6be8ceb00xa0000000a, , 0x2000000020xffffffff)
,   0xc/home/bradfitz/go/src/cmd/go/run.go, ...:)
82   +/home/bradfitz/go/src/pkg/syscall/zerrors_linux_amd64.go0x15a:
1781main.(*builder).runProgram +(0xa10xf8400efba0
, net.(*pollster).WaitFD0xf840250a50(, 0xf8400aa0000x7f4c6be8cf00, ,
0xf84005e8c00x4110cf, , 0x00x5ba798, , ...0xffffffff)
,   0x0/home/bradfitz/go/src/cmd/go/run.go, ...:)
71   +/home/bradfitz/go/src/pkg/net/fd_linux.go0x10b:
146main._func_004 +(0x1120xf8401642b8
, net.(*pollServer).Run0xf8401642c0(, 0xf84005e8c00xf8401642f8, , 0x00x42f33b)
,   0xf840250a50/home/bradfitz/go/src/pkg/net/fd.go, ...:)
236  +/home/bradfitz/go/src/cmd/go/build.go0xe4:
552created by  +net.newPollServer0x2f0

    /home/bradfitz/go/src/pkg/net/newpollserver.gomain._func_005:(350xf8401642b8 +, 0x3880xf8401647d8
, 
0x0goroutine , 60x0 [)
runnable    ]:
/home/bradfitz/go/src/cmd/go/build.go:syscall.Syscall601( +)
0xb4    
/home/bradfitz/go/src/pkg/syscall/asm_linux_amd64.screated by :main.(*builder).do30
 +  0x4b/home/bradfitz/go/src/cmd/go/build.go
:syscall.Read603( +0xf8000000080x3b9, 
0xf8400c1000
, goroutine 0x1000000010004,  [0x0chan receive, ]:
0x0, ...main._func_005)
(   0xf8401642b8/home/bradfitz/go/src/pkg/syscall/zerrors_linux_amd64.go,
:0xf8401647d82137,  +0x00x78, 
0x0net.(*netFD).Read)
(   0xf8400bc000/home/bradfitz/go/src/cmd/go/build.go, :0xf8400c1000595, 
+0x1000000010000x3f, 
0xf8ffffffffcreated by , main.(*builder).do0x0
, ...   )
/home/bradfitz/go/src/cmd/go/build.go   :/home/bradfitz/go/src/pkg/net/fd.go603: +4240x3b9
+
0x107

goroutine net.(*conn).Read5( [0xf840070448chan receive, ]:
0xf8400c1000, main._func_0050x100000001000(, 0xf8401642b80x7f9ba8c96030, ,
0xf8401647d80x5b4000, , ...0x0)
,   0x0/home/bradfitz/go/src/pkg/net/net_posix.go)
:   30/home/bradfitz/go/src/cmd/go/build.go +:0xba595
 +io.(*LimitedReader).Read0x3f(
0xf840059c80created by , main.(*builder).do0xf8400c1000
,   0x100000001000/home/bradfitz/go/src/cmd/go/build.go, :0xf4a00000000603,  +0x00x3b9,
...
)

    goroutine /home/bradfitz/go/src/pkg/io/io.go6: [394chan receive +]:
0xc3
main._func_005bufio.(*Reader).fill((0xf8401642b80xf8400b9080, ,
0xf8401647d80x7f9ba8b059d8, )
0x0 , /home/bradfitz/go/src/pkg/bufio/bufio.go0x0:)
77   +/home/bradfitz/go/src/cmd/go/build.go0xf2:
595bufio.(*Reader).ReadByte +(0x3f0xf8400b9080
, created by 0x5a72d8main.(*builder).do, 
0x0 , /home/bradfitz/go/src/cmd/go/build.go0x0:, 6030xf840001cd0 +, ...0x3b9)

    rax     /home/bradfitz/go/src/pkg/bufio/bufio.go0xca:
166rbx      +0x861be00x83

rcx    
code.google.com/p/go.net/websocket.hybiFrameReaderFactory.NewFrameReader0xffffffffffffffff(
0xf8400b9080rdx     , 0x00xf840001d20
, rdi     0xf840001cd00x8624c0, 
0x0rsi     , 0x00x0
, ...rbp     )
0x38    
/home/bradfitz/go/src/pkg/code.google.com/p/go.net/websocket/hybi.gorsp    
:0x7fffabde4a60115
 +r8      0xd00x0

code.google.com/p/go.net/websocket.(*Conn).Readr9      (0x00xf8400a8100
, r10     0xf8400d40290x0, 
0x40000000400r11     , 0x2460xe00000000
, r12     0x00x6a44d0, ...
)
r13         0x1/home/bradfitz/go/src/pkg/code.google.com/p/go.net/websocket/websocket.go
:r14     1770x0 +
0xc5r15     
0x0io.ReadAtLeast
(rip     0xf84005f3900x44c649, 
0xf8400a8100rflags  , 0x2460xf8400d4029
, cs      0x400000004000x33, 
0x4fs      , ...0x0)

    gs      /home/bradfitz/go/src/pkg/io/io.go0x0:
254 +0xc3
encoding/base64.(*decoder).Read(0xf8400d4000, 0xf8400d5000, 0x40000000400, 0x6e7f70,
0x0, ...)
    /home/bradfitz/go/src/pkg/encoding/base64/base64.go:319 +0x1c1
main.(*Conn).Read(0xf84005f3c0, 0xf8400d5000, 0x40000000400, 0xf8400d5000, 0x0, ...)
    /home/bradfitz/x.go:38 +0x125
main.webSocketHandler(0xf8400a8100, 0xf840070448)
    /home/bradfitz/x.go:76 +0x21a
code.google.com/p/go.net/websocket.Handler.ServeHTTP(0x400ff4, 0xf8400b9180,
0xf8400b9140, 0xf8400d1000, 0xf800000000, ...)
    /home/bradfitz/go/src/pkg/code.google.com/p/go.net/websocket/server.go:101 +0x210
net/http.(*ServeMux).ServeHTTP(0xf840059520, 0xf8400b9180, 0xf8400b9140, 0xf8400d1000,
0xf8400b9140, ...)
    /home/bradfitz/go/src/pkg/net/http/server.go:928 +0xb9
net/http.(*conn).serve(0xf8400bd0c0, 0x0)
    /home/bradfitz/go/src/pkg/net/http/server.go:656 +0x621
created by net/http.(*Server).Serve
    /home/bradfitz/go/src/pkg/net/http/server.go:1044 +0x430
rax     0x80
rbx     0x1
rcx     0xf840062a80
rdx     0x400
rdi     0x521480
rsi     0x400
rbp     0x7f9ba8c47ed0
rsp     0x7f9ba8c47de8
r8      0x0
r9      0x170ede2356a
r10     0x0
r11     0x1d
r12     0x5ad0a8
r13     0x7fff8a8c0930
r14     0x0
r15     0x0
rip     0x415278
rflags  0x246
cs      0x33
fs      0x0
gs      0x0
@alberts
Copy link
Contributor

alberts commented May 1, 2012

Comment 1:

What also works quite badly is sending a SIGQUIT to a test being run by the go tool.

@rsc
Copy link
Contributor

rsc commented May 1, 2012

Comment 2:

I don't know what could be fixed about this.
You have two different processes which both received a SIGQUIT, and
sure enough they are printing at the same time and end up interlaced.
I guess we could arrange larger writes.

@bradfitz
Copy link
Contributor Author

bradfitz commented May 1, 2012

Comment 3:

oh! that's what's happening.
Yes, I was using "go run x.go" here.
You could imagine cmd/go catching SIGQUIT and relaying it to the child and letting the
child exit fully before handling SIGQUIT itself normally.  Or something.
But at least I understand the workaround now.  (not using go run)

@davecheney
Copy link
Contributor

Comment 4:

https://golang.org/cl/6351053/

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 5:

Should ignore SIGQUIT and wait for the child. Same fix as 3579 I believe.

Labels changed: added priority-later.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 6:

Labels changed: added go1.1.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 7:

Labels changed: added size-m.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 8:

Labels changed: added suggested.

@alexbrainman
Copy link
Member

Comment 9:

This issue was closed by revision 04f0d14.

Status changed to Fixed.

@bradfitz bradfitz added fixed Suggested Issues that may be good for new contributors looking for work to do. labels Dec 14, 2012
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@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.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

6 participants