Opened 9 years ago

Last modified 8 years ago

#3375 new defect

Objects indexed by integers get reordered upon serialization

Reported by: Itms Owned by:
Priority: Must Have Milestone: Backlog
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by Itms)

By reverting r16929 and running the attached commands.txt, a serialization error happens.

The diff of OOS dumps is attached. The failing turn is the one when the item 159 is added.

This is probably the cause of #2863 and #3133.

Attachments (2)

diff.diff (2.4 KB ) - added by Itms 9 years ago.
commands.txt (22.4 KB ) - added by Itms 9 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Itms, 9 years ago

In 16929:

Revert r16591.

The problem caused by nested Maps is actually #3374.
Cloning the data object saved by the AuraManager fixes #3188.
Also, using Map fixes a serialization problem, refs #3375.

On top of those changes, some reordering of add/multiply to avoid any ordering mistake.

Fixes #3164, Refs #3374

comment:2 by Itms, 9 years ago

Description: modified (diff)

by Itms, 9 years ago

Attachment: diff.diff added

by Itms, 9 years ago

Attachment: commands.txt added

comment:3 by Itms, 9 years ago

Here is a test that reproduces the problem: http://pastebin.com/A4RCbQzC

comment:4 by leper, 9 years ago

I suspect this has something to do with adding elements in a way that produces something that is seen by SpiderMonkey as a dense subset of some elements, thus triggering the first https://mxr.mozilla.org/mozilla-central/source/js/src/jsiter.cpp#141 loop, which ends up reordering part of the properties of the object.

I'm not entirely sure if we can prevent that, and also not why the original state does not have the reordering. We should possibly try not to use integer indexed identifiers in objects, but use Map instead.

comment:5 by sanderd17, 8 years ago

In 17935:

Change an Object into a Map, this should stop the deserializer of reordering the keys in some cases and stop an OOS on rejoining. Refs #3375

Note: See TracTickets for help on using tickets.