DescriptionSeveral 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 #
Messages
Total messages: 8 (2 generated)
|