Skip to content

Connection blocks main thread #23

@Nihildum

Description

@Nihildum

For some reasons the use of dartssh2 blocks the main thread of my flutter application. This happens when I connect to the server and when I run a simple command on the server e.g. cat file.txt which is very small (like 100 characters). I run my application with a debugger and stopped it during the hangs. For the connection it seems that the loading of the ssh key takes quite some time, for the cat I not that sure.

Since dart has just one thread und there are no async calls in between, the main application hangs. Is there something I can to to prevent the hangs?

Connect to the server:
F (bcrypt.dart:1242)
Blowfish.encipher (bcrypt.dart:1154)
Blowfish.expand0state (bcrypt.dart:1193)
bcrypt_hash (bcrypt.dart:1267)
bcrypt_pbkdf (bcrypt.dart:1343)
OpenSSHKeyPairs._decryptPrivateKeyBlob (ssh_key_pair.dart:213)
OpenSSHKeyPairs.getPrivateKeys (ssh_key_pair.dart:138)
SSHKeyPair.fromPem (ssh_key_pair.dart:24)
ServerConnection._connect (connection.dart:23)

Run command cat:
int.+ (integers.dart:8)
TweetNaCl._M_off (tweetnacl.dart:1184)
TweetNaCl._M (tweetnacl.dart:803)
TweetNaCl.crypto_scalarmult (tweetnacl.dart:1394)
TweetNaCl.crypto_scalarmult_base (tweetnacl.dart:1416)
_ScalarMult.scalseMultBase (kex_x25519.dart:63)
new SSHKexX25519 (kex_x25519.dart:18)
SSHTransport._handleMessageKexInit (ssh_transport.dart:714)
SSHTransport._handleMessage (ssh_transport.dart:637)
SSHTransport._processPackets (ssh_transport.dart:317)
SSHTransport._processVersionExchange (ssh_transport.dart:300)
SSHTransport._processData (ssh_transport.dart:257)
SSHTransport._onSocketData (ssh_transport.dart:237)
_rootRunUnary (zone.dart:1434)
_CustomZone.runUnary (zone.dart:1335)
_CustomZone.runUnaryGuarded (zone.dart:1244)
_BufferingStreamSubscription._sendData (stream_impl.dart:341)
_BufferingStreamSubscription._add (stream_impl.dart:271)
_SyncStreamControllerDispatch._sendData (stream_controller.dart:774)
_StreamController._add (stream_controller.dart:648)
_StreamController.add (stream_controller.dart:596)
_Socket._onData (socket_patch.dart:2314)
_rootRunUnary (zone.dart:1442)
_CustomZone.runUnary (zone.dart:1335)
_CustomZone.runUnaryGuarded (zone.dart:1244)
_BufferingStreamSubscription._sendData (stream_impl.dart:341)
_BufferingStreamSubscription._add (stream_impl.dart:271)
_SyncStreamControllerDispatch._sendData (stream_controller.dart:774)
_StreamController._add (stream_controller.dart:648)
_StreamController.add (stream_controller.dart:596)
new _RawSocket. (socket_patch.dart:1839)
_NativeSocket.issueReadEvent.issue (socket_patch.dart:1322)
_microtaskLoop (schedule_microtask.dart:40)
_startMicrotaskLoop (schedule_microtask.dart:49)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions