Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Advanced Manual Setup for LN channel can result in crash #2253

Closed
catch-21 opened this issue Sep 26, 2024 · 7 comments · Fixed by #2275
Closed

[Bug]: Advanced Manual Setup for LN channel can result in crash #2253

catch-21 opened this issue Sep 26, 2024 · 7 comments · Fixed by #2275
Assignees
Labels
bug Something isn't working

Comments

@catch-21
Copy link
Contributor

catch-21 commented Sep 26, 2024

Describe the bug

Bitkit crashes if the Manual Setup flow form is not filled in and the Continue button is pressed.
(This may have persistently broken ldk, need to test more)

Reproduce

  1. Go to Advanced settings -> Lightning Connections -> Add Connection
  2. At Manual Setup page, tap 'Continue'
  3. App crashes
  4. On restarting Bitkit the LDK node never starts correctly (wallet restore required)

Screenshots / Recording

Simulator.Screen.Recording.-.iPhone.15.-.2024-09-26.at.22.23.35.mp4
Screen.Recording.2024-09-27.at.13.18.01.mov

Operating system

iOS / Android

Bitkit version

1.0.5 (136)

Log output

crash-report.txt

@catch-21 catch-21 added bug Something isn't working triage This issue needs to be looked over by the team labels Sep 26, 2024
@catch-21 catch-21 changed the title [Bug]: Advanced Manual Setup for LN channel can result on crash on iPhone that persistently breaks ldk [Bug]: Advanced Manual Setup for LN channel can result on crash on iPhone Sep 26, 2024
@pwltr
Copy link
Collaborator

pwltr commented Sep 26, 2024

Can confirm, the app is crashing when trying to add a peer with an invalid pubkey. I can add validation to check for correct length but that's not enough to prevent this. @Jasonvdb FYI

Simulator.Screen.Recording.-.iPhone.15.-.2024-09-26.at.22.23.35.mp4

crash-report.txt

@pwltr pwltr removed the triage This issue needs to be looked over by the team label Sep 26, 2024
@pwltr
Copy link
Collaborator

pwltr commented Sep 27, 2024

Crashing on Android as well:

Screen.Recording.2024-09-27.at.13.18.01.mov

@pwltr pwltr changed the title [Bug]: Advanced Manual Setup for LN channel can result on crash on iPhone [Bug]: Advanced Manual Setup for LN channel can result in crash Sep 27, 2024
@Jasonvdb Jasonvdb self-assigned this Sep 27, 2024
@Jasonvdb
Copy link
Collaborator

Yeah length check doesn't seem like enough here. Needs proper validation.

@Jasonvdb
Copy link
Collaborator

This should do the trick: synonymdev/react-native-ldk#274

I'm testing with 0000000000000000000000000000000000000000000000000000000000000000

@catch-21
Copy link
Contributor Author

catch-21 commented Sep 30, 2024

@pwltr It's interesting you get a crash on android because I see a toast (real device)

A fix must be tested on both platforms

This was referenced Oct 1, 2024
@Jasonvdb
Copy link
Collaborator

Jasonvdb commented Oct 1, 2024

Still strangely stopped being able to replicate the crash since Friday but I believe this does the trick: #2275

Using the actual curve to validate the public key.

@catch-21
Copy link
Contributor Author

catch-21 commented Oct 5, 2024

Unable to reproduce crash on android using 0d67faa

  • The form validation now prevents proceeding without inputting a valid node id, and something for host and port.
  • If an node id is used that cannot be connected to then an appropriate toast error is displayed

Tested again on Android and iOS using release 1.0.5 (137)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants