JKRhb / dtls2

A DTLS library for Dart based on OpenSSL.
MIT License
3 stars 0 forks source link

Fatal error when trying to connect without nework adapter connected #76

Closed Ifilehk closed 1 year ago

Ifilehk commented 1 year ago

Experiencing this when try to connect having my network adapter disconnected. I don't know if it was present in the past or if it due to your last commit. I f you need more details, let me know ...

Cause: null pointer dereference
    x0  0000007b8c2b6410  x1  0000000000000049  x2  0000000000000000  x3  0000007c0c6073f0
    x4  0000007968f0b648  x5  00000078063479f9  x6  0000007b8c2b6410  x7  0000000000000049
    x8  0000000000000000  x9  0000007968f62080  x10 0000007968f1b6f8  x11 0000000000000005
    x12 0000000000000001  x13 00000b20c984e9f9  x14 001e769974747fa0  x15 00000079f0364490
    x16 0000000000000000  x17 0000007b5c276c78  x18 00000079ee708000  x19 0000007c0c6073f0
    x20 0000007b8c2b6410  x21 00000079f0364490  x22 0000007800008081  x23 0000000000000000
    x24 0000007800008081  x25 00000079f028b000  x26 0000007b5c276520  x27 000000780d938fb0
    x28 0000000800000078  x29 00000079f0364480
    lr  0000007976286f28  sp  00000079f0364460  pc  0000007968f0b69c  pst 0000000060000000
backtrace:
      #00 pc 000000000002469c  /data/app/~~6QWUhZlMjHtotE41QoK9oQ==/com.ptt.ptt_client-UlPTR7RuWFiZAodLD5KrJg==/base.apk!libssl.so (dtls1_ctrl+84)
JKRhb commented 1 year ago

Thank you for reporting! Is that error (also) occurring on the main branch? Or only in #75?

Ifilehk commented 1 year ago

Yes problem in main branch there too

JKRhb commented 1 year ago

Yes problem in main branch there too

Hmm, okay, can you determine where in the code the error occurs?

Ifilehk commented 1 year ago

will troubleshoot

Ifilehk commented 1 year ago

crash occurs at line 565

https://github.com/JKRhb/dtls2/blob/fe5eecfbc03738411d36417a90fc4c8a218e9e90/lib/src/dtls_client.dart#L565-L567

JKRhb commented 1 year ago

Thank you! I already have an idea for a fix, I will push it later today

Ifilehk commented 1 year ago

Danke!

JKRhb commented 1 year ago

Hi @Ifilehk, sorry for the delay! I now updated #75 with a potential, very simple fix (commit aa448c8554eb3e5b5f487057e76f701863bdcceb), could you try it out again? :)

Ifilehk commented 1 year ago

Now crash occurs at line 477 in dtls_client.dart

final code = _libSsl.SSL_get_error(_ssl, ret);

JKRhb commented 1 year ago

Thank you again for the feedback! I updated #75 again, could you try once more with the latest changes?

Ifilehk commented 1 year ago

You got it!!! Parabéns!!!

Danke!

JKRhb commented 1 year ago

Great! 🎉 Thank you again for your testing effort! :) (Muito obrigado! ;))

Ifilehk commented 1 year ago

De nada !!!

JKRhb commented 1 year ago

De nada !!!

🎉

I will publish a new patch version later today by the way :)