I wrote a proxy program to collect some tcp input into a buffer then transfer to another server.
The test environment is just in a local lan. One client open/send/recv/close to this proxyserver one second once.
I put this proxy program overnight, and found it quit and show the following error log:
Is there any tip to debug such problem?
runtime/cgo: pthread_create failed: Resource temporarily unavailable
SIGABRT: abort
PC=0x7f800773c1c9
goroutine 1 [chan receive]:
myproto.(*ProxyServer).Serve(0xc2000db000)
proxyserver.go:418 +0x5a9
main.main()
myview.go:46 +0x470
goroutine 2 [syscall]:
goroutine 4 [semacquire]:
sync.runtime_Semacquire(0xc2000002c8)
/usr/lib/go/src/pkg/runtime/zsema_linux_amd64.c:165 +0x2e
sync.(*WaitGroup).Wait(0xc2000b1600)
/usr/lib/go/src/pkg/sync/waitgroup.go:109 +0x141
myproto.(*ProxyServer).srvService(0xc2000db000)
proxyserver.go:449 +0x6c0
created by myproto.(*ProxyServer).Serve
proxyserver.go:362 +0xb9
goroutine 5 [IO wait]:
net.runtime_pollWait(0x7f8007ecef00, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/znetpoll_linux_amd64.c:118 +0x82
net.(*pollDesc).WaitRead(0xc2000ba080, 0xb, 0xc2000a3ab0)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:75 +0x4d
net.(*netFD).accept(0xc2000ba000, 0x73d8d0, 0x0, 0xc2000a3ab0, 0xb, ...)
/usr/lib/go/src/pkg/net/fd_unix.go:385 +0x36a
net.(*TCPListener).AcceptTCP(0xc200000240, 0x7f8007d89018, 0xc2000a2780, 0x453fe7)
/usr/lib/go/src/pkg/net/tcpsock_posix.go:229 +0x73
net.(*TCPListener).Accept(0xc200000240, 0x4, 0x4, 0x649d40, 0xc201f8b280, ...)
/usr/lib/go/src/pkg/net/tcpsock_posix.go:239 +0x33
myproto.func·005()
proxyserver.go:387 +0x21d
created by myproto.(*ProxyServer).Serve
proxyserver.go:410 +0x4d5
goroutine 6 [select]:
myproto.(*ProxyServer).sendCmdsOrHBToSrv(0xc2000db000)
proxyserver.go:483 +0x167c
myproto.func·008()
proxyserver.go:439 +0x51
created by myproto.(*ProxyServer).srvService
proxyserver.go:441 +0x5a7
goroutine 128413 [semacquire]:
sync.runtime_Semacquire(0xc202c2a6f0)
/usr/lib/go/src/pkg/runtime/zsema_linux_amd64.c:165 +0x2e
sync.(*WaitGroup).Wait(0xc202d9c440)
/usr/lib/go/src/pkg/sync/waitgroup.go:109 +0x141
myproto.(*ClientInfo).Handler(0xc202d9b770, 0xc2000dc000)
proxyserver.go:77 +0x258
created by myproto.func·005
proxyserver.go:407 +0x7ad
goroutine 128417 [semacquire]:
sync.runtime_Semacquire(0xc202c2a760)
/usr/lib/go/src/pkg/runtime/zsema_linux_amd64.c:165 +0x2e
sync.(*WaitGroup).Wait(0xc202d9c5c0)
/usr/lib/go/src/pkg/sync/waitgroup.go:109 +0x141
myproto.(*ClientInfo).Handler(0xc202d9bee0, 0xc2000dc000)
proxyserver.go:77 +0x258
created by myproto.func·005
proxyserver.go:407 +0x7ad