~vlorentz


#112 Crash on missing PONG argument 3 months ago

Ticket created by ~vlorentz on ~emersion/goguma

When Goguma gets a PONG from the server with a missing argument, it crashes with:

10-24 22:35:11.069 12227 12250 I flutter : RangeError (length): Invalid value: Only valid value is 0: 1
10-24 22:35:11.073 12227 12250 I flutter : #0      _GrowableList.elementAt (dart:core-patch/growable_array.dart)
10-24 22:35:11.074 12227 12250 I flutter : #1      UnmodifiableListView.[] (dart:collection/collections.dart:34)
10-24 22:35:11.074 12227 12250 I flutter : #2      ListMixin.elementAt (dart:collection/list.dart:78)
10-24 22:35:11.074 12227 12250 I flutter : #3      UnmodifiableListView.[] (dart:collection/collections.dart:34)
10-24 22:35:11.074 12227 12250 I flutter : #4      Client.ping.<anonymous closure> (package:goguma/client.dart:678)
10-24 22:35:11.074 12227 12250 I flutter : #5      Client._roundtripMessage.<anonymous closure> (package:goguma/client.dart:343)
10-24 22:35:11.074 12227 12250 I flutter : #6      Client._waitMessage.<anonymous closure> (package:goguma/client.dart:307)
10-24 22:35:11.074 12227 12250 I flutter : #16     Client._handleMessage (package:goguma/client.dart:540)
10-24 22:35:11.074 12227 12250 I flutter : #17     Client.connect.<anonymous closure> (package:goguma/client.dart:221)
10-24 22:35:11.074 12227 12250 I flutter : #25     _StringAdapterSink.add (dart:convert/string_conversion.dart:238)
10-24 22:35:11.074 12227 12250 I flutter : #26     _LineSplitterSink._addLines (dart:convert/line_splitter.dart:170)
10-24 22:35:11.074 12227 12250 I flutter : #27     _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:145)
10-24 22:35:11.074 12227 12250 I flutter : #28     StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163)
10-24 22:35:11.074 12227 12250 I flutter : #37     _StringAdapterSink.add (dart:convert/string_conversion.dart:238)
10-24 22:35:11.074 12227 12250 I flutter : #38     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243)
10-24 22:35:11.074 12227 12250 I flutter : #39     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317)
10-24 22:35:11.074 12227 12250 I flutter : #40     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310)
10-24 22:35:11.074 12227 12250 I flutter : #41     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72)
10-24 22:35:11.074 12227 12250 I flutter : #51     _Socket._onData (dart:io-patch/socket_patch.dart:2314)
10-24 22:35:11.074 12227 12250 I flutter : #60     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1839)
10-24 22:35:11.074 12227 12250 I flutter : #61     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1322)
10-24 22:35:11.074 12227 12250 I flutter : (elided 43 frames from dart:async)

(that's clearly a server bug, but Goguma is the only client to crash on this afaik)

#111 Double "FAIL * ACCOUNT_REQUIRED" from server causes crash 3 months ago

Ticket created by ~vlorentz on ~emersion/goguma

From tcpdump:

C: CAP LS 302
S: :server CAP * LS :account-tag.batch.draft/account-registration=before-connect.draft/channel-rename.draft/chathistory.draft/multiline=max-bytes=8192.echo-message.extended-join.labeled-response.message-tags.sasl=PLAIN.server-time.userhost-in-names
C: NICK.val:e2e.zone
C: USER val:e2e.zone 0 * val:e2e.zone
C: CAP REQ sasl
C: AUTHENTICATE PLAIN <redacted>
C: CAP END
S: :server. CAP * ACK :sasl
S: AUTHENTICATE :+
S: FAIL * ACCOUNT_REQUIRED :You must authenticate
S: FAIL * ACCOUNT_REQUIRED :You must authenticate

(I assume the first fail is because the client bursts commands, and the server does not properly queue them)

This causes Goguma to crash with:

10-24 22:12:38.214 10580 10604 I flutter : [1] Connecting to fdfc:0:0:103::1...
10-24 22:12:38.235 10580 10604 I flutter : [1] Connection opened
10-24 22:12:38.235 10580 10604 I flutter : [1] Starting SASL PLAIN authentication
10-24 22:12:38.839 10580 10604 I flutter : Bad state: Future already completed
10-24 22:12:38.843 10580 10604 I flutter : #1      Client._waitMessage.<anonymous closure> (package:goguma/client.dart:309)
10-24 22:12:38.843 10580 10604 I flutter : #11     Client._handleMessage (package:goguma/client.dart:540)
10-24 22:12:38.843 10580 10604 I flutter : #12     Client.connect.<anonymous closure> (package:goguma/client.dart:221)
10-24 22:12:38.843 10580 10604 I flutter : #20     _StringAdapterSink.add (dart:convert/string_conversion.dart:238)
10-24 22:12:38.843 10580 10604 I flutter : #21     _LineSplitterSink._addLines (dart:convert/line_splitter.dart:170)
10-24 22:12:38.843 10580 10604 I flutter : #22     _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:145)
10-24 22:12:38.843 10580 10604 I flutter : #23     StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163)
10-24 22:12:38.843 10580 10604 I flutter : #32     _StringAdapterSink.add (dart:convert/string_conversion.dart:238)
10-24 22:12:38.843 10580 10604 I flutter : #33     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243)
10-24 22:12:38.843 10580 10604 I flutter : #34     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317)
10-24 22:12:38.843 10580 10604 I flutter : #35     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310)
10-24 22:12:38.843 10580 10604 I flutter : #36     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72)
10-24 22:12:38.843 10580 10604 I flutter : #46     _Socket._onData (dart:io-patch/socket_patch.dart:2314)
10-24 22:12:38.843 10580 10604 I flutter : #55     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1839)
10-24 22:12:38.843 10580 10604 I flutter : #56     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1322)
10-24 22:12:38.843 10580 10604 I flutter : (elided 44 frames from dart:async)