Error: panic: interface conversion: kyber.Point is nil, not *edwards25519.point

27 views
Skip to first unread message

Pasindu Tennage

unread,
Jun 5, 2020, 7:23:28 AM6/5/20
to Cothority Discussion
I am Pasindu Tennage a 1st year PhD student in DEDIS.

I am using the cothority framework for my project, and the code is available in https://github.com/PasinduTennage/student_20_tlcCtrlPlane/tree/control-plane- (branch control-plane-)

I am getting the following error when I run the simulation.

panic: interface conversion: kyber.Point is nil, not *edwards25519.point

goroutine 53109 [running]:
go.dedis.ch/kyber/v3/group/edwards25519.(*point).Equal(0xc074957130, 0x0, 0x0, 0x9a8a40)
        /home/pasindu/go/pkg/mod/go.dedis.ch/kyber/v...@v3.0.9/group/edwards25519/point.go:75 +0xdd
go.dedis.ch/onet/v3/network.(*ServerIdentity).Equal(...)
        /home/pasindu/go/pkg/mod/go.dedis.ch/onet/v...@v3.0.27/network/struct.go:186
go.dedis.ch/onet/v3.(*TreeNodeInstance).createValueAndVerify(0xc0005bdb00, 0xb3fc60, 0xa204e0, 0xc000596c60, 0x4, 0xc00007ed48, 0x9a3c60, 0xc000530b50, 0xc00007c5a0)
        /home/pasindu/go/pkg/mod/go.dedis.ch/onet/v...@v3.0.27/treenode.go:437 +0x271
go.dedis.ch/onet/v3.(*TreeNodeInstance).dispatchHandler(0xc0005bdb00, 0xc000422740, 0x1, 0x1, 0x2, 0x3)
        /home/pasindu/go/pkg/mod/go.dedis.ch/onet/v...@v3.0.27/treenode.go:411 +0x576
go.dedis.ch/onet/v3.(*TreeNodeInstance).dispatchMsgToProtocol(0xc0005bdb00, 0xc000596c60, 0xc000530f68, 0x3)
        /home/pasindu/go/pkg/mod/go.dedis.ch/onet/v...@v3.0.27/treenode.go:572 +0x55f
go.dedis.ch/onet/v3.(*TreeNodeInstance).dispatchMsgReader(0xc0005bdb00)
        /home/pasindu/go/pkg/mod/go.dedis.ch/onet/v...@v3.0.27/treenode.go:534 +0x392
created by go.dedis.ch/onet/v3.newTreeNodeInstance
        /home/pasindu/go/pkg/mod/go.dedis.ch/onet/v...@v3.0.27/treenode.go:106 +0x1a3
panic: interface conversion: kyber.Point is nil, not *edwards25519.point


The simulation runs to completion without any error in the logic. This error is produced only when the simulation is finished.

The steps to reproduce this error is to run go build && ./simulation service.toml in the above repo (branch control-plane-) I mentioned.

In the code, I json.Marshal and later json.Unmarshal the network.ServerIdentity of nodes. Then I use the unmarshalled network.serverIdentity to send and receive messages using RawSend() method. The message sending and receiving are successful. Only after the completion of the simulation, I get the above error. My gut feeling says Marshalling and UnMarshaling of ServerIdentities is the reason for getting this error, but I cannot see any workaround.

I kindly request you to look into this problem.

Thank you

Allen Jeffrey Richard

unread,
Jun 8, 2020, 11:21:47 AM6/8/20
to Pasindu Tennage, Cothority Discussion
This problem was fixed today by Linus here:

It has just been released into a new Onet:

How you are importing onet? (via cothority_template? Via cothority? Via your own server?) In any case, you can use go.mod replace directives to select this new version of onet, if onet is coming from a dependency you cannot upgrade:

diff --git a/go.mod b/go.mod
index 2811748d6..7b8a4195d 100644
--- a/go.mod
+++ b/go.mod
@@ -42,3 +42,5 @@ require (
        gopkg.in/square/go-jose.v2 v2.4.1 // indirect
        gopkg.in/yaml.v2 v2.2.8 // indirect
 )
+

Please reply here or ask on the dEDIS Slack if you have more problems.

 -jeff
signature.asc

Pasindu Tennage

unread,
Jun 8, 2020, 11:36:29 AM6/8/20
to Allen Jeffrey Richard, Cothority Discussion
Dear sir,

Thank you for your reply.

I modified my code according to your instructions, and now its working fine.


Gasser Linus

unread,
Jun 8, 2020, 11:36:59 AM6/8/20
to Cothority Discussion
Dang - for once I _should_ have used “Reply all” - here is what I sent to Pasindu last week…

Jeff: thanks for the new version!

Linus

On 5 Jun 2020, at 21:52, Gasser Linus <linus....@epfl.ch> wrote:

Hi Pasindu,

Thanks for the mail. I cloned the repo and tried to run it on my own computer, commit 925c171480f90b2d97f8ddf137a69cf1a25e1b42, but it runs through with no error - OK, if I add ‘-debug 4’, it fails. But without ‘-debug 4’, it works.

<service.csv>

- What version of go are you using? Here I use go 1.14.2 on MacOS
- Usually I prefer using log.Print or log.Lvl for the different messages - it gives you also the line where the output is created.
- Another point is to create the smallest possible version that gives the error - strip away as much stuff to get the minimum code that gets you the error.
- I also don’t get why you’re using JSON to marshal the ServerIdentities - this is usually done by the framework itself using protobuf and takes care of all things like suites, points, and scalars.
- Also RawSend is usually an indication of a bad implementation. You should better write an onet-protocol with well-defined messages instead of writing your own RawSend messages.
- If have a gut feeling, then you need to test your gut. It _might_ give you a good indication, but most often it just gives you a first place to start, and the real error is elsewhere. Like the above indication: strip it down.
- As far as I can see, the error happens when the system tries to compare the ServerIdentities. So there is a possibility that you change a ServerIdentity somewhere you should not - it’s not always all nicely wrapped up, and some of the values you get from the system should not be overwritten.
- To debug, I check out the Onet-code one level higher, and add the following line to your go.mod:
replace go.dedis.ch/onet/v3 => ../onet
This allows you to drill in the error and understand better what is wrong.
- OK - I created https://github.com/dedis/onet/pull/645 which should take care of the panic. But there is still something wrong at another place, because this panic should not happen ;) You can check out onet like described above, check out the equal_testing branch in onet, and then run your simulation. Once the PR is in, Onet-version needs to be increased, and then you can use it directly in your go.mod. But that you need to look with the DEDIS guys.
- Finally, please use the #engineer channel on the DEDIS slack - this will make the other people aware of the problem, too, and they can chime in.

Best,

Linus

On 5 Jun 2020, at 13:23, Pasindu Tennage <pasindunivan...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Cothority Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cothority+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cothority/2fd525bc-7f86-4ad3-b46a-27cd8c695c5eo%40googlegroups.com.

C4DT
- Mr. Linus Gasser Lead Developer
- +41 21 693 6770 linus....@epfl.ch
 
EPFL – C4DT | Station 14
CH – 1015 Lausanne
www.c4dt.org


C4DT
- Mr. Linus Gasser Lead Developer
- +41 21 693 6770 linus....@epfl.ch
 

EPFL – C4DT | Station 14
CH – 1015 Lausanne
www.c4dt.org


Reply all
Reply to author
Forward
0 new messages