Issue 22982 in dart: Isolate cannot send Map as message in certain conditions (AKA "object is a regular Dart Instance")

852 views
Skip to first unread message

da...@googlecode.com

unread,
Mar 25, 2015, 12:19:42 PM3/25/15
to bu...@dartlang.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Unassigned

New issue 22982 by filip.hr...@gmail.com: Isolate cannot send Map as
message in certain conditions (AKA "object is a regular Dart Instance")
https://code.google.com/p/dart/issues/detail?id=22982

What steps will reproduce the problem?
1. Run the attached project in Dartium
2. See output in console

What is the expected output? What do you see instead?
Expected output is to see the map (which is built iteratively in the
isolate) received on the main Isolate and printed out in the console.

This works when compiled to JavaScript.

What I see instead in Dartium is this error (plus additional info I put
there myself)

===

Received: Error: Invalid argument(s): Illegal argument in isolate message :
(object is a regular Dart Instance)
Stacktrace:
#0 _SendPortImpl._sendInternal
(dart:isolate-patch/isolate_patch.dart:187)
#1 _SendPortImpl.send (dart:isolate-patch/isolate_patch.dart:171)
#2 main (http://localhost:8081/isolate.dart:18:14)
#3 _startIsolate.<anonymous closure>
(dart:isolate-patch/isolate_patch.dart:251)
#4 _RawReceivePortImpl._handleMessage
(dart:isolate-patch/isolate_patch.dart:142)

Tried to send map:
{"type":110,"mapContent":{"hidden":false,"disabled":false,"jsonml":["Form",{"submitText":null,"id":"61807"},["RangeOutput",{"name":"Trait
points","id":"form61807-element0"}],["CheckboxInput",{"name":"You
have good
eyesight and spotting
abilities","id":"form61807-element1"}],["CheckboxInput",{"name":"You are
physically strong, a good
fighter","id":"form61807-element2"}],["CheckboxInput",{"name":"You can
speak basic
Japanese","id":"form61807-element3"}],["CheckboxInput",{"name":"You are
good with
animals","id":"form61807-element4"}],["CheckboxInput",{"name":"You have
received a psychology training on artificial
intelligence","id":"form61807-element5"}],["CheckboxInput",{"name":"You
understand electronics well and you are proficient in using and repairing
them","id":"form61807-element6"}],["CheckboxInput",{"name":"You have
science
education","disabled":"true","id":"form61807-element7"}],["CheckboxInput",{"name":"You
know your way around a
spaceship","id":"form61807-element8"}]],"values":{"form61807-element0":{"hidden":false,"disabled":false,"min":0,"max":3,"step":1,"minEnabled":null,"maxEnabled":null,"current":2,"__string__":"2"},"form61807-element1":{"hidden":false,"disabled":false,"current":false},"form61807-element2":{"hidden":false,"disabled":false,"current":false},"form61807-element3":{"hidden":false,"disabled":false,"current":false},"form61807-element4":{"hidden":false,"disabled":false,"current":false},"form61807-element5":{"hidden":false,"disabled":false,"current":false},"form61807-element6":{"hidden":false,"disabled":false,"current":false},"form61807-element7":{"hidden":false,"disabled":true,"current":true},"form61807-element8":{"hidden":false,"disabled":false,"current":false}}}}
Object runtimeType: _CompactLinkedHashMap<String, Object>

===

I tried sending this map when built as a literal and it worked okay. Maybe
it's something to do with the Map being a _CompactLinkedHashMap?

What version of the product are you using?
Dart 1.9.1

On what operating system?
Mac OS X 10.9.5

What browser (if applicable)?
Dartium 39.0.2171.99

Please provide any additional information below.


Attachments:
isolate_message_bug.zip 18.0 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

da...@googlecode.com

unread,
Mar 25, 2015, 12:23:39 PM3/25/15
to bu...@dartlang.org

Comment #2 on issue 22982 by filip.hr...@gmail.com: Isolate cannot send Map
as message in certain conditions (AKA "object is a regular Dart Instance")
https://code.google.com/p/dart/issues/detail?id=22982

To be clear, I did not see this error in 1.8 stable.

da...@googlecode.com

unread,
Mar 25, 2015, 12:24:39 PM3/25/15
to bu...@dartlang.org
Updates:
Status: Triaged
Cc: l...@google.com
Labels: Area-VM Library-Isolate

Comment #1 on issue 22982 by kas...@google.com: Isolate cannot send Map as
message in certain conditions (AKA "object is a regular Dart Instance")
https://code.google.com/p/dart/issues/detail?id=22982

(No comment was entered for this change.)

da...@googlecode.com

unread,
Mar 27, 2015, 4:21:29 AM3/27/15
to bu...@dartlang.org
Updates:
Status: Accepted
Owner: ko...@google.com
Cc: as...@google.com

Comment #3 on issue 22982 by ipo...@google.com: Isolate cannot send Map as
message in certain conditions (AKA "object is a regular Dart Instance")
https://code.google.com/p/dart/issues/detail?id=22982

Filip, the rules were tightened for 1.9. But you are right this should work
fine across all isolates, especially if the map only contains literals.

da...@googlecode.com

unread,
Apr 12, 2015, 4:08:12 PM4/12/15
to bu...@dartlang.org

Comment #4 on issue 22982 by filip.hr...@gmail.com: Isolate cannot send Map
as message in certain conditions (AKA "object is a regular Dart Instance")
https://code.google.com/p/dart/issues/detail?id=22982

Thanks for looking into this!

Not sure if this helps, but after I downgraded back to 1.8.5 (where the
above works fine), here's a (deduplicated) list of runtime types that were
included in the (recursive) Map I was trying to send through the Isolate
message:

_LinkedHashMap
_LinkedHashMap<String, Map<String, Object>>
_LinkedHashMap<String, Object>
bool
int
List
Null
String

So, this works fine in 1.8.5. I wanted to be sure this wasn't a stupid bug
in which I'd be sending a complex object inside that Map.

Notably missing in the list above is the _CompactLinkedHashMap type
mentioned earlier. I could upgrade back to 1.9.1 again and find out what's
different, but I'm pretty sure the only difference would be this. So maybe
this is not Library-Isolate, but Library-Collections?

da...@googlecode.com

unread,
Apr 27, 2015, 10:36:06 AM4/27/15
to bu...@dartlang.org

Comment #5 on issue 22982 by filip.hr...@gmail.com: Isolate cannot send Map
as message in certain conditions (AKA "object is a regular Dart Instance")
https://code.google.com/p/dart/issues/detail?id=22982

Hi,

this was probably a bug on my side, or at the very least it has an easy
workaround.

I was unknowingly sending a working map through the isolate. When I instead
send a copy of that map (`new Map.from(other)`, which was the initial idea
anyway), it works without throwing.

I have to hope I didn't introduce another bug that zeroes out the first one
by doing this, but at the moment I don't have the time to dig deeper. I
wanted to let you know asap.

da...@googlecode.com

unread,
Apr 27, 2015, 12:04:32 PM4/27/15
to bu...@dartlang.org
Updates:
Labels: -Priority-Unassigned -Library-Isolate Priority-High Milestone-1.11

Comment #6 on issue 22982 by ipo...@google.com: Isolate cannot send Map as
message in certain conditions (AKA "object is a regular Dart Instance")
https://code.google.com/p/dart/issues/detail?id=22982

(No comment was entered for this change.)

da...@googlecode.com

unread,
Jun 2, 2015, 12:12:29 PM6/2/15
to bu...@dartlang.org
Updates:
Status: Fixed

Comment #7 on issue 22982 by ko...@google.com: Isolate cannot send Map as
Reply all
Reply to author
Forward
0 new messages