zubairhamed / canopus

CoAP Client/Server implementing RFC 7252 for the Go Language
Apache License 2.0
154 stars 41 forks source link

Not able to run psk client example #101

Open franzwilhelm opened 6 years ago

franzwilhelm commented 6 years ago

I have successfully managed to run the psk server example, but when running the client I get an error in the SSL_connect function in openssl. My environment:

I set up the repo according to the readme, and also set LD_LIBRARY_PATH=./openssl before running the examples.

The complete stacktrace is presented here:

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xe0 pc=0x7fbebe1e612b]

runtime stack:
runtime.throw(0x6ca5d8, 0x2a)
    /usr/local/go/src/runtime/panic.go:616 +0x81
runtime.sigpanic()
    /usr/local/go/src/runtime/signal_unix.go:372 +0x28e

goroutine 1 [syscall]:
runtime.cgocall(0x62b8f0, 0xc42005dc78, 0xe)
    /usr/local/go/src/runtime/cgocall.go:128 +0x64 fp=0xc42005dc48 sp=0xc42005dc10 pc=0x404d04
github.com/zubairhamed/canopus._Cfunc_SSL_connect(0xd8bea0, 0x0)
    _cgo_gotypes.go:379 +0x49 fp=0xc42005dc78 sp=0xc42005dc48 pc=0x620439
github.com/zubairhamed/canopus.(*DTLSConnection).connect.func1(0xd8bea0, 0xb)
    /home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/dtls.go:763 +0x56 fp=0xc42005dcb0 sp=0xc42005dc78 pc=0x628116
github.com/zubairhamed/canopus.(*DTLSConnection).connect(0xc420090550, 0x10, 0xc42013e150)
    /home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/dtls.go:763 +0x2f fp=0xc42005dce0 sp=0xc42005dcb0 pc=0x624acf
github.com/zubairhamed/canopus.(*DTLSConnection).Write(0xc420090550, 0xc42013e170, 0x21, 0x40, 0x40, 0x0, 0x0)
    /home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/dtls.go:708 +0xea fp=0xc42005dd30 sp=0xc42005dce0 pc=0x6247ba
github.com/zubairhamed/canopus.(*DTLSConnection).sendMessage(0xc420090550, 0x6f6100, 0xc4200905a0, 0x0, 0x687c80, 0x0, 0x0)
    /home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/dtls.go:674 +0x27d fp=0xc42005ddf0 sp=0xc42005dd30 pc=0x62426d
github.com/zubairhamed/canopus.(*DTLSConnection).Send(0xc420090550, 0x6f5b40, 0xc420027230, 0x7, 0x6c053f, 0x9, 0x6f5400)
    /home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/dtls.go:653 +0x4d4 fp=0xc42005dec8 sp=0xc42005ddf0 pc=0x623e84
main.main()
    /home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/examples/dtls/simple-psk/client.go:19 +0x128 fp=0xc42005df88 sp=0xc42005dec8 pc=0x62ad98
runtime.main()
    /usr/local/go/src/runtime/proc.go:198 +0x212 fp=0xc42005dfe0 sp=0xc42005df88 pc=0x42dc32
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42005dfe8 sp=0xc42005dfe0 pc=0x457a01
exit status 2
franzwilhelm commented 6 years ago

@ptone By reading issues in the repo it looked like you managed to run the client example, is that correct?

RicardoHPeng commented 5 years ago

Got same problem here. Did you find solution to run the client example?

franzwilhelm commented 5 years ago

@RicardoHPeng I don't remember exactly, but I think so. By what I remember, I think it's related to installing openssl, without having another installation already installed, as they can conflict with each other. Preferrably you could try to do this in a clean environment, like a simple docker container only containing go and gcc for instance

RicardoHPeng commented 5 years ago

@franzwilhelm Thanks for the quick reply! I will find a clean machine and try it again~