monchier / ncsp Goto Github PK
View Code? Open in Web Editor NEWCSP (Communicating Sequential Processes) over the network ~ go channel over the network
License: MIT License
CSP (Communicating Sequential Processes) over the network ~ go channel over the network
License: MIT License
monchier@ubuntu:~/go/src/github.com/monchier/ncsp$ go test
WARN[0000] Warning: /ncsp not found
INFO[0000] Creating SenderChannel: channel0 options: &{map[] map[buffer:10]}
INFO[0000] Creating ReceiverChannel: channel0 options: &{map[] map[buffer:10]}
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x43b23a]
goroutine 10 [running]:
runtime.panic(0x68d9a0, 0x9cb1a8)
/usr/lib/go/src/pkg/runtime/panic.c:266 +0xb6
github.com/monchier/ncsp.(_SenderChannel).send(0xc210064960, 0xc21007e600, 0xf, 0xc21008d0e0, 0x0, ...)
/home/monchier/go/src/github.com/monchier/ncsp/ncsp.go:223 +0x44a
github.com/monchier/ncsp.(_SenderChannel).Send(0xc210064960, 0xc21008d0e0, 0xc21007e330, 0x10)
/home/monchier/go/src/github.com/monchier/ncsp/ncsp.go:249 +0x30e
github.com/monchier/ncsp.sender_1_1_process(0xc210050ae0, 0xc210045cb0)
/home/monchier/go/src/github.com/monchier/ncsp/ncsp_test.go:31 +0x38c
created by github.com/monchier/ncsp.Test1
/home/monchier/go/src/github.com/monchier/ncsp/ncsp_test.go:189 +0x78
goroutine 1 [chan receive]:
testing.RunTests(0x76b8e8, 0x9c96c0, 0x5, 0x5, 0x1)
/usr/lib/go/src/pkg/testing/testing.go:472 +0x8d5
testing.Main(0x76b8e8, 0x9c96c0, 0x5, 0x5, 0x9cedc0, ...)
/usr/lib/go/src/pkg/testing/testing.go:403 +0x84
main.main()
github.com/monchier/ncsp/_test/_testmain.go:55 +0x9c
goroutine 3 [chan receive]:
github.com/monchier/ncsp.Test1(0xc21004c090)
/home/monchier/go/src/github.com/monchier/ncsp/ncsp_test.go:191 +0xb2
testing.tRunner(0xc21004c090, 0x9c96c0)
/usr/lib/go/src/pkg/testing/testing.go:391 +0x8b
created by testing.RunTests
/usr/lib/go/src/pkg/testing/testing.go:471 +0x8b2
goroutine 4 [chan send]:
github.com/monchier/ncsp.(_NcspConfig).generatePortLoop(0x9cfb90)
/home/monchier/go/src/github.com/monchier/ncsp/config.go:76 +0x1a4
created by github.com/monchier/ncsp.(_NcspConfig).Init
/home/monchier/go/src/github.com/monchier/ncsp/config.go:32 +0x39b
goroutine 9 [finalizer wait]:
runtime.park(0x40b630, 0x9ceee0, 0x9ccce8)
/usr/lib/go/src/pkg/runtime/proc.c:1342 +0x66
runfinq()
/usr/lib/go/src/pkg/runtime/mgc0.c:2279 +0x84
runtime.goexit()
/usr/lib/go/src/pkg/runtime/proc.c:1394
goroutine 7 [IO wait]:
net.runtime_pollWait(0x7f67368035d0, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(_pollDesc).Wait(0xc2100453e0, 0x72, 0x7f6736802310, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(_pollDesc).WaitRead(0xc2100453e0, 0xb, 0x7f6736802310)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(_netFD).Read(0xc210045380, 0xc21006b000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/net/fd_unix.go:204 +0x2a0
net.(_conn).Read(0xc2100003c0, 0xc21006b000, 0x1000, 0x1000, 0x30, ...)
/usr/lib/go/src/pkg/net/net.go:122 +0xc5
bufio.(_Reader).fill(0xc2100505a0)
/usr/lib/go/src/pkg/bufio/bufio.go:91 +0x110
bufio.(_Reader).Peek(0xc2100505a0, 0x1, 0x0, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/bufio/bufio.go:119 +0xcb
net/http.(_persistConn).readLoop(0xc210058400)
/usr/lib/go/src/pkg/net/http/transport.go:687 +0xb7
created by net/http.(_Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:528 +0x607
goroutine 8 [select]:
net/http.(_persistConn).writeLoop(0xc210058400)
/usr/lib/go/src/pkg/net/http/transport.go:791 +0x271
created by net/http.(_Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:529 +0x61e
goroutine 11 [IO wait]:
net.runtime_pollWait(0x7f6736803330, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(_pollDesc).Wait(0xc21008d370, 0x72, 0x7f6736802310, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(_pollDesc).WaitRead(0xc21008d370, 0xb, 0x7f6736802310)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(_netFD).accept(0xc21008d310, 0x76d8e8, 0x0, 0x7f6736802310, 0xb)
/usr/lib/go/src/pkg/net/fd_unix.go:382 +0x2c2
net.(_TCPListener).AcceptTCP(0xc210000b00, 0x7f6734744c80, 0x0, 0xc2100899c0)
/usr/lib/go/src/pkg/net/tcpsock_posix.go:233 +0x47
net.(_TCPListener).Accept(0xc210000b00, 0x7f6734744cc0, 0x1, 0x1, 0xc21007ea80)
/usr/lib/go/src/pkg/net/tcpsock_posix.go:243 +0x27
github.com/monchier/ncsp.(_ReceiverChannel).Receive(0xc2100469c0, 0x7f6734744e48, 0x1, 0x1)
/home/monchier/go/src/github.com/monchier/ncsp/ncsp.go:260 +0xf5
github.com/monchier/ncsp.receiver_1_1_process(0xc210050ae0, 0xc210045cb0)
/home/monchier/go/src/github.com/monchier/ncsp/ncsp_test.go:59 +0x33b
created by github.com/monchier/ncsp.Test1
/home/monchier/go/src/github.com/monchier/ncsp/ncsp_test.go:190 +0x99
goroutine 12 [select]:
github.com/monchier/ncsp.func·001()
/home/monchier/go/src/github.com/monchier/ncsp/broadcaster.go:21 +0x203
created by github.com/monchier/ncsp.NewBroadcaster
/home/monchier/go/src/github.com/monchier/ncsp/broadcaster.go:34 +0x12d
goroutine 19 [select]:
github.com/monchier/ncsp.func·003()
/home/monchier/go/src/github.com/monchier/ncsp/ncsp.go:106 +0xa7d
created by github.com/monchier/ncsp.(*SenderChannel).Build
/home/monchier/go/src/github.com/monchier/ncsp/ncsp.go:133 +0x4a3
goroutine 17 [chan receive]:
net/http.(_persistConn).readLoop(0xc210058700)
/usr/lib/go/src/pkg/net/http/transport.go:778 +0x68f
created by net/http.(_Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:528 +0x607
goroutine 15 [IO wait]:
net.runtime_pollWait(0x7f6736803480, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(_pollDesc).Wait(0xc210081220, 0x72, 0x7f6736802310, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(_pollDesc).WaitRead(0xc210081220, 0xb, 0x7f6736802310)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(_netFD).Read(0xc2100811c0, 0xc210083000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/net/fd_unix.go:204 +0x2a0
net.(_conn).Read(0xc2100007a8, 0xc210083000, 0x1000, 0x1000, 0x30, ...)
/usr/lib/go/src/pkg/net/net.go:122 +0xc5
bufio.(_Reader).fill(0xc210080240)
/usr/lib/go/src/pkg/bufio/bufio.go:91 +0x110
bufio.(_Reader).Peek(0xc210080240, 0x1, 0x0, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/bufio/bufio.go:119 +0xcb
net/http.(_persistConn).readLoop(0xc210058680)
/usr/lib/go/src/pkg/net/http/transport.go:687 +0xb7
created by net/http.(_Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:528 +0x607
goroutine 16 [select]:
net/http.(_persistConn).writeLoop(0xc210058680)
/usr/lib/go/src/pkg/net/http/transport.go:791 +0x271
created by net/http.(_Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:529 +0x61e
goroutine 18 [select]:
net/http.(_persistConn).writeLoop(0xc210058700)
/usr/lib/go/src/pkg/net/http/transport.go:791 +0x271
created by net/http.(_Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:529 +0x61e
goroutine 20 [IO wait]:
net.runtime_pollWait(0x7f6736803528, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(_pollDesc).Wait(0xc2100811b0, 0x72, 0x7f6736802310, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(_pollDesc).WaitRead(0xc2100811b0, 0xb, 0x7f6736802310)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(_netFD).Read(0xc210081150, 0xc210087000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/net/fd_unix.go:204 +0x2a0
net.(_conn).Read(0xc210000800, 0xc210087000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/net/net.go:122 +0xc5
bufio.(_Reader).fill(0xc210080300)
/usr/lib/go/src/pkg/bufio/bufio.go:91 +0x110
bufio.(_Reader).ReadSlice(0xc210080300, 0xa, 0x0, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/bufio/bufio.go:274 +0x204
net/http.readLine(0xc210080300, 0x0, 0x0, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/net/http/chunked.go:91 +0x59
net/http.(_chunkedReader).beginChunk(0xc210089ae0)
/usr/lib/go/src/pkg/net/http/chunked.go:47 +0x2a
net/http.(_chunkedReader).Read(0xc210089ae0, 0xc21005fc00, 0x200, 0x200, 0x100000000, ...)
/usr/lib/go/src/pkg/net/http/chunked.go:65 +0x91
net/http.(_body).Read(0xc210089ab0, 0xc21005fc00, 0x200, 0x200, 0x413a01, ...)
/usr/lib/go/src/pkg/net/http/transfer.go:534 +0x96
net/http.(_bodyEOFSignal).Read(0xc2100464c0, 0xc21005fc00, 0x200, 0x200, 0x0, ...)
/usr/lib/go/src/pkg/net/http/transport.go:989 +0x1b0
bytes.(_Buffer).ReadFrom(0xc21008d230, 0x7f6736803878, 0xc2100464c0, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/bytes/buffer.go:169 +0x1f7
io/ioutil.readAll(0x7f6736803878, 0xc2100464c0, 0x200, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/io/ioutil/ioutil.go:32 +0x156
io/ioutil.ReadAll(0x7f6736803878, 0xc2100464c0, 0xc2100464c0, 0x7f6736803878, 0xc2100464c0, ...)
/usr/lib/go/src/pkg/io/ioutil/ioutil.go:41 +0x3f
github.com/coreos/go-etcd/etcd.(_Client).SendRequest(0xc21004c630, 0xc210089780, 0x0, 0x0, 0x0)
/home/monchier/go/src/github.com/coreos/go-etcd/etcd/requests.go:273 +0x1232
github.com/coreos/go-etcd/etcd.(_Client).getCancelable(0xc21004c630, 0xc21008b120, 0x18, 0xc210089630, 0xc210080540, ...)
/home/monchier/go/src/github.com/coreos/go-etcd/etcd/requests.go:51 +0x2e4
github.com/coreos/go-etcd/etcd.(_Client).watchOnce(0xc21004c630, 0xc21008b120, 0x18, 0x77e, 0x1, ...)
/home/monchier/go/src/github.com/coreos/go-etcd/etcd/watch.go:96 +0x16e
github.com/coreos/go-etcd/etcd.(*Client).Watch(0xc21004c630, 0xc21008b120, 0x18, 0x77e, 0x1, ...)
/home/monchier/go/src/github.com/coreos/go-etcd/etcd/watch.go:39 +0x28d
github.com/monchier/ncsp.func·002()
/home/monchier/go/src/github.com/monchier/ncsp/ncsp.go:98 +0x142
created by github.com/monchier/ncsp.func·003
/home/monchier/go/src/github.com/monchier/ncsp/ncsp.go:100 +0xdb
goroutine 22 [select]:
github.com/coreos/go-etcd/etcd.func·003()
/home/monchier/go/src/github.com/coreos/go-etcd/etcd/requests.go:147 +0x2cd
created by github.com/coreos/go-etcd/etcd.(*Client).SendRequest
/home/monchier/go/src/github.com/coreos/go-etcd/etcd/requests.go:168 +0x29a
goroutine 23 [syscall]:
runtime.goexit()
/usr/lib/go/src/pkg/runtime/proc.c:1394
exit status 2
Showing up when running the many senders to one receiver test with one channel
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.