fixes #102 #104

Closed
kardan wants to merge 1 commits from kardan/cwtch:fix-102 into master
First-time contributor

Fixes #102 for me.

Tests fail:

~/go/src/cwtch.im/cwtch$ ./testing/tests.sh
....
=== RUN   TestMessageStore
--- FAIL: TestMessageStore (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]                             
        panic: runtime error: invalid memory address or nil pointer dereference                                 
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x804974c]                                         

goroutine 5 [running]:
testing.tRunner.func1(0x197605a0)
        /usr/lib/go-1.10/src/testing/testing.go:742 +0x24a                                                      
panic(0x820d540, 0x833cb70)
        /usr/lib/go-1.10/src/runtime/panic.go:502 +0x1dc                                                        
sync/atomic.AddUint64(0x19710cd4, 0x1, 0x0, 0xffffff01, 0x197680f0)                                             
        /usr/lib/go-1.10/src/sync/atomic/asm_386.s:112 +0xc                                                     
cwtch.im/cwtch/server/metrics.(*counter).Add(0x19710cc0, 0x1)                                                   
        /home/user/go/src/cwtch.im/cwtch/server/metrics/metrics.go:34 +0x35                                      
cwtch.im/cwtch/storage.(*MessageStore).AddMessage(0x197680c0, 0x197760a0, 0x49, 0x50, 0x8352bb4, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/user/go/src/cwtch.im/cwtch/storage/message_store.go:95 +0x77                                       
cwtch.im/cwtch/storage.TestMessageStore(0x197605a0)
        /home/user/go/src/cwtch.im/cwtch/storage/message_store_test.go:21 +0x177                                 
testing.tRunner(0x197605a0, 0x824139c)
        /usr/lib/go-1.10/src/testing/testing.go:777 +0xaa                                                       
created by testing.(*T).Run
        /usr/lib/go-1.10/src/testing/testing.go:824 +0x243                                                      
FAIL    cwtch.im/cwtch/storage  0.033s
Fixes #102 for me. Tests fail: ``` ~/go/src/cwtch.im/cwtch$ ./testing/tests.sh .... === RUN TestMessageStore --- FAIL: TestMessageStore (0.00s) panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x804974c] goroutine 5 [running]: testing.tRunner.func1(0x197605a0) /usr/lib/go-1.10/src/testing/testing.go:742 +0x24a panic(0x820d540, 0x833cb70) /usr/lib/go-1.10/src/runtime/panic.go:502 +0x1dc sync/atomic.AddUint64(0x19710cd4, 0x1, 0x0, 0xffffff01, 0x197680f0) /usr/lib/go-1.10/src/sync/atomic/asm_386.s:112 +0xc cwtch.im/cwtch/server/metrics.(*counter).Add(0x19710cc0, 0x1) /home/user/go/src/cwtch.im/cwtch/server/metrics/metrics.go:34 +0x35 cwtch.im/cwtch/storage.(*MessageStore).AddMessage(0x197680c0, 0x197760a0, 0x49, 0x50, 0x8352bb4, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /home/user/go/src/cwtch.im/cwtch/storage/message_store.go:95 +0x77 cwtch.im/cwtch/storage.TestMessageStore(0x197605a0) /home/user/go/src/cwtch.im/cwtch/storage/message_store_test.go:21 +0x177 testing.tRunner(0x197605a0, 0x824139c) /usr/lib/go-1.10/src/testing/testing.go:777 +0xaa created by testing.(*T).Run /usr/lib/go-1.10/src/testing/testing.go:824 +0x243 FAIL cwtch.im/cwtch/storage 0.033s ```
Owner

Fixed by #103

Fixed by #103
sarah closed this pull request 2018-08-05 03:47:11 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.