Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Issue 665823007: Several bugfixes in dart:io's handing of sockets (Closed)

Created:
6 years, 2 months ago by kustermann
Modified:
6 years, 2 months ago
Reviewers:
Søren Gjesse
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Several bugfixes in dart:io's handing of sockets This CL includes fixes for the following issues: a) The event handler created listening socket metadata (values of a hashtable indexed by filedescriptor) sometimes as SocketData and sometimes as ListeningSocketData depending whether the socket has been listened to or not. This was very buggy, in particular because multiple isolates can have a reference to the same server socket in different states (opened, listened, closed). => This should be fixed by sending the file descriptior typeMask always to the eventhandler. b) A server socket cloned via the ServerSocketReference mechanism, opens a receive port for sending (fd, address, port) to isolates/... which want to create a server socket from the reference. This receive port was not closed properly when calling only close() (and not listening first). => This should be fixed by closing this receiveport on the ServerSocket.close() call as well. c) It was assumed in the event handler that a close command needs to have the Dart_Port in a hash table. But this is only the case if the user actually listened to the ServerSocket. Otherwise the event handler does not know about the server socket. This caused a NULL dereference which resulted in a SEGFAULT. => This should be fixed by checking if the Dart_Port is in the hashmap of the ListeningSocketData or not. d) Too many bits were considered when extracting token count in C++ code. The CL includes a regression test which should trigger these issues. BUG=21384, 21383 R=sgjesse@google.com Committed: https://code.google.com/p/dart/source/detail?r=41276

Patch Set 1 #

Total comments: 4

Patch Set 2 : included _android/_linux/_macos and made more macros #

Patch Set 3 : Added suppression ServerSocketReference regression test for nonlinux OSes #

Total comments: 4

Patch Set 4 : Added two spaces as requested #

Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -41 lines) Patch
M dart/runtime/bin/eventhandler.h View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M dart/runtime/bin/eventhandler_android.cc View 1 2 chunks +8 lines, -8 lines 0 comments Download
M dart/runtime/bin/eventhandler_linux.h View 1 1 chunk +23 lines, -12 lines 0 comments Download
M dart/runtime/bin/eventhandler_linux.cc View 1 2 chunks +8 lines, -10 lines 0 comments Download
M dart/runtime/bin/eventhandler_macos.cc View 1 2 chunks +6 lines, -8 lines 0 comments Download
M dart/runtime/bin/socket_patch.dart View 4 chunks +13 lines, -3 lines 0 comments Download
A dart/tests/standalone/io/server_socket_reference_issue21383_and_issue21384_test.dart View 1 chunk +73 lines, -0 lines 0 comments Download
M dart/tests/standalone/standalone.status View 1 2 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
kustermann
6 years, 2 months ago (2014-10-21 23:18:37 UTC) #2
Søren Gjesse
LGTM https://codereview.chromium.org/665823007/diff/1/dart/runtime/bin/eventhandler.h File dart/runtime/bin/eventhandler.h (right): https://codereview.chromium.org/665823007/diff/1/dart/runtime/bin/eventhandler.h#newcode33 dart/runtime/bin/eventhandler.h:33: #define COMMAND_MASK(data) (data & ((1 << kCloseCommand) | ...
6 years, 2 months ago (2014-10-22 07:23:51 UTC) #3
kustermann
PTAL https://codereview.chromium.org/665823007/diff/1/dart/runtime/bin/eventhandler.h File dart/runtime/bin/eventhandler.h (right): https://codereview.chromium.org/665823007/diff/1/dart/runtime/bin/eventhandler.h#newcode33 dart/runtime/bin/eventhandler.h:33: #define COMMAND_MASK(data) (data & ((1 << kCloseCommand) | ...
6 years, 2 months ago (2014-10-23 21:59:24 UTC) #5
Søren Gjesse
lgtm https://codereview.chromium.org/665823007/diff/60001/dart/runtime/bin/eventhandler.h File dart/runtime/bin/eventhandler.h (right): https://codereview.chromium.org/665823007/diff/60001/dart/runtime/bin/eventhandler.h#newcode37 dart/runtime/bin/eventhandler.h:37: ((data & COMMAND_MASK) == (1 << command_bit)) // ...
6 years, 2 months ago (2014-10-24 08:28:24 UTC) #6
kustermann
https://codereview.chromium.org/665823007/diff/60001/dart/runtime/bin/eventhandler.h File dart/runtime/bin/eventhandler.h (right): https://codereview.chromium.org/665823007/diff/60001/dart/runtime/bin/eventhandler.h#newcode37 dart/runtime/bin/eventhandler.h:37: ((data & COMMAND_MASK) == (1 << command_bit)) // NOLINT ...
6 years, 2 months ago (2014-10-24 08:55:40 UTC) #7
kustermann
6 years, 2 months ago (2014-10-24 08:56:01 UTC) #8
Message was sent while issue was closed.
Committed patchset #4 (id:80001) manually as 41276 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698