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

node bridge - another case of segfault 11 #15336

Open
mroz22 opened this issue Nov 11, 2024 · 2 comments · May be fixed by #15338
Open

node bridge - another case of segfault 11 #15336

mroz22 opened this issue Nov 11, 2024 · 2 comments · May be fixed by #15338
Labels
Bridge -> nodeUSB connect Connect API related (ie. fee calculation)

Comments

@mroz22
Copy link
Contributor

mroz22 commented Nov 11, 2024

  1. get address
  2. show address on device active
  3. disconnect device
  4. node-bridge dies
@trezor/transport-bridge Handling request for POST /release/3
@trezor/transport-bridge usb: closeDevice. device.opened: true
@trezor/transport-bridge usb: device.releaseInterface: 0
@trezor/transport-bridge Request POST /release/3 aborted
@trezor/transport-bridge usb: releaseInterface error Error: reset error: Error: LIBUSB_ERROR_TIMEOUT. device: {"productName":"TREZOR","manufacturerName":"SatoshiLabs","serialNumber":"C320C738E14062788C37A51E","vendorId":4617,"productId":21441,"deviceVersionMajor":1,"deviceVersionMinor":0,"opened":true}
@trezor/transport-bridge usb: device.close
Segmentation fault: 11

it looks like that we are trying to releaseInterface for a device that is no longer there but we don't know about it because disconnect event is not fired in this case.

the culprit causing it is this https://github.com/trezor/trezor-suite/pull/14092/files#diff-c3affa910cc3a7ed65bcf910b11dc07b7407c5ba91394f76b80f14677a3c14faR369-R372

@mroz22 mroz22 added connect Connect API related (ie. fee calculation) Bridge -> nodeUSB labels Nov 11, 2024
@github-project-automation github-project-automation bot moved this to 🎯 To do in Issues Suite Nov 11, 2024
@mroz22 mroz22 linked a pull request Nov 11, 2024 that will close this issue
@evgenysl
Copy link

evgenysl commented Nov 11, 2024

Testing on Windows:

with Suite running
version: desktop 24.11.1 (a8ae3ff)

  1. Go to Bitcoin account -> Receive address
  2. Show address on Trezor
  3. Disconnect Trezor
  4. Node-Bridge is still running on http://127.0.0.1:21325/status/
  5. Reconnect Trezor
  6. Trezor is discovered in node-bridge Devices and Suite

https://connect.trezor.io/9/methods/bitcoin/getAddress/

  1. getAddress
  2. Show address on Trezor
  3. Disconnect device before clicking Confirm
  4. Node-Bridge is still running
  5. Reconnect Trezor
  6. Trezor is discovered in Node Bridge
  7. getAddress successful

Same results on Mac Arm with Suite running.
Node-Bridge is not crushing when disconnecting Trezor during getAddress.

@evgenysl
Copy link

Both on Windows and MacOS:

with Trezor Suite closed, but node-bridge process running

https://connect.trezor.io/9/methods/bitcoin/getAddress/

  1. getAddress
  2. Show address on Trezor
  3. Disconnect device before clicking Confirm
  4. Node-Bridge is still running
  5. Reconnect Trezor
  6. Trezor is discovered in Node Bridge
  7. getAddress successful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bridge -> nodeUSB connect Connect API related (ie. fee calculation)
Projects
Status: 🎯 To do
Development

Successfully merging a pull request may close this issue.

2 participants