error due to Rumor.Rumors

error due to Rumor.Rumors

par Tanguy Marie Mathias Duvignac,
Number of replies: 3

I got something strange on some tests:

After many investigations, it seems to have a Rumor.Rumors[0].Msg == nil that it’s add in the getOuts so the getTLCMessages failed, so I added an && rumor.Rumors[0].Msg != nil l. 1565 in the HW3_test.

I supposed something wrong in my code but it’s very difficult to debug because i have to look into the given code.

If someone has been dealing with the same issue or get some clue…

```

testing.tRunner.func1.2(0x7a6d20, 0x9e56c0)
    /usr/lib/go/src/testing/testing.go:1143 +0x49f
testing.tRunner.func1(0xc000082c00)
    /usr/lib/go/src/testing/testing.go:1146 +0x695
panic(0x7a6d20, 0x9e56c0)
    /usr/lib/go/src/runtime/panic.go:971 +0x499
go.dedis.ch/cs438/peer/tests/unit.getTLCMessagesFromRumors(0xc000082c00, 0xc00059b800, 0x7f, 0x7f, 0xc0000aca60, 0xb, 0x0, 0x0, 0x0)
    /home/akiro/Annee_3/decentralizeSystemEngineering_CS438/hw3/peer/tests/unit/HW3_test.go:1565 +0x47c
go.dedis.ch/cs438/peer/tests/unit.Test_HW3_Tag_Paxos_Eventual_Consensus(0xc000082c00)
    /home/akiro/Annee_3/decentralizeSystemEngineering_CS438/hw3/peer/tests/unit/HW3_test.go:1355 +0x14b1
testing.tRunner(0xc000082c00, 0x805ed8)
    /usr/lib/go/src/testing/testing.go:1193 +0x203
created by testing.(*T).Run
    /usr/lib/go/src/testing/testing.go:1238 +0x5d8
exit status 2
```

In reply to Tanguy Marie Mathias Duvignac

Re: error due to Rumor.Rumors

par Tanguy Marie Mathias Duvignac,
With Further investigations:
Some TLCMessage couldn’t be process due to the nil derefence pointer, but if i print it : `Error failed to call handler: runtime error: invalid memory address or nil pointer dereference during Process Rumor: {"Step":0,"Block":{"Index":0,"Hash":"19EbfDAstMnA1ovDUXXDTG4SXUoySdkqkJKHumCyB7M=","Value":{"UniqID":"c6j7lcltoicpl5ij6i10","Filename":"a","Metahash":"b"},"PrevHash":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="}}` the msg seems legit
In reply to Tanguy Marie Mathias Duvignac

Re: error due to Rumor.Rumors

par Cristina Basescu,
I might misunderstand, but, in step 0, the previous hash doesn't point to another bock, so it should be the hex encoding of a byte slice of size 32 filled with 0s. Why is your PrevHash "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" ?
In reply to Cristina Basescu

Re: error due to Rumor.Rumors

par Tanguy Marie Mathias Duvignac,
I suppose the test is construct in a such way that prevHash is "AAAAAAAAAAA…AA="
BTW I have (nearly) found the error --> from my Rumors/Status implementation because of low heartbeat etc… some pseudo-race occur and rumor was sent before be added