Skip to content

Unrecoverable exception writing to socket closed from the other side #35995

Open
@tejainece

Description

I am using Dart VM version: 2.1.0 (Tue Nov 13 18:22:02 2018 +0100) on "windows_x64".

When socket.write is called on RawSocket after the other side has closed the connection (which we dont know about yet), the Dart SDK crashes with an unrecoverable exception.

Here is the message it outputs before it crashes:

Unhandled exception:
SocketException: Write failed (OS Error: Broken pipe, errno = 32), address = database.example.com, port = 62372
#0      _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:1112:29)
#1      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#2      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#3      _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#4      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

It however calls onError callback of listen method with the error before it crashes.

This is probably related to an old issue: #17468

There are also occurrences of the same issue in other packages: dartist/redis_client#67

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-iotype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions