String encoding change causes StringInputStream failures #6600
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-duplicate
Closed in favor of an existing report
library-io
From "New Dart Editor build 0.2.2.1_r14458" on misc@dartlang.org:
I did a little investigation. It looks like this is neither a pub, nor a Windows issue. Instead it looks likely to be related to the recent string encoding changes. You can get a crash with a similar stack trace by running:
void main() {
var input = new ListInputStream();
var stream = new StringInputStream(input);
stream.onData = () => print(stream.read());
input.write([0xF0, 0xA4, 0xAD, 0xA2]); // U+24B62 in UTF-8.
input.markEndOfStream();
}
Which bails with:
Unhandled exception:
Illegal argument(s): negative length -1
0 Arrays.rangeCheck (dart:collection:65:7)
1 List.getRange (dart:core-patch:765:22)
2 _StringDecoderBase.decoded (dart:io:6132:59)
3 _StringInputStream.read (dart:io:6360:37)
4 main.<anonymous closure> (file:///C:/Users/rnystrom/dev/temp/stream.dart:6:42)
5 _StringInputStream._checkScheduleCallback.issueDataCallback (dart:io:6450:27)
6 _Timer._createTimerHandler._handleTimeout (dart:io:6597:28)
7 _Timer._createTimerHandler._handleTimeout (dart:io:6605:7)
8 _Timer._createTimerHandler.<anonymous closure> (dart:io:6613:23)
9 _ReceivePortImpl._handleMessage (dart:isolate-patch:37:92)
I can repro this on Mac and Windows.
My guess is that this is showing up in pub because pub is spawning a process which, for some users has Unicode output that goes outside of the BMP.
The text was updated successfully, but these errors were encountered: