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

Issue 10829444: Avoid trusting the length encoded in the Snapshot if there is an (Closed)

Created:
8 years, 4 months ago by turnidge
Modified:
8 years, 3 months ago
Reviewers:
siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Avoid trusting the length encoded in the Snapshot if there is an external length available. We now pass a length with all messages in the vm and verify that there is no mismatch with the length from the Snapshot. Fixed a bug in the use of ApiMessageReader. We were always manually adding Snapshot::kHeaderSize to the data, but neglecting to subtract kHeaderSize from the message length. Added FullSnapshotWriter and MessageWriter classes. Committed: https://code.google.com/p/dart/source/detail?r=11413

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Patch Set 3 : #

Total comments: 4

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+356 lines, -335 lines) Patch
M runtime/lib/isolate.cc View 1 2 3 4 2 chunks +7 lines, -12 lines 0 comments Download
M runtime/vm/dart.cc View 1 2 3 4 1 chunk +5 lines, -1 line 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 5 chunks +14 lines, -11 lines 0 comments Download
M runtime/vm/dart_api_message.h View 1 2 3 4 1 chunk +1 line, -4 lines 0 comments Download
M runtime/vm/dart_api_message.cc View 1 2 3 4 4 chunks +2 lines, -5 lines 0 comments Download
M runtime/vm/isolate.cc View 1 2 3 4 1 chunk +16 lines, -15 lines 0 comments Download
M runtime/vm/message.h View 1 2 3 4 3 chunks +4 lines, -1 line 0 comments Download
M runtime/vm/message_handler_test.cc View 1 2 3 4 8 chunks +16 lines, -16 lines 0 comments Download
M runtime/vm/message_test.cc View 1 2 3 4 6 chunks +31 lines, -11 lines 0 comments Download
M runtime/vm/native_message_handler.cc View 1 2 3 4 1 chunk +1 line, -6 lines 0 comments Download
M runtime/vm/port_test.cc View 1 2 3 4 2 chunks +8 lines, -2 lines 0 comments Download
M runtime/vm/snapshot.h View 1 2 3 4 9 chunks +56 lines, -27 lines 0 comments Download
M runtime/vm/snapshot.cc View 1 2 3 4 6 chunks +24 lines, -11 lines 0 comments Download
M runtime/vm/snapshot_test.cc View 1 2 3 4 31 chunks +171 lines, -213 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
turnidge
8 years, 4 months ago (2012-08-20 22:51:26 UTC) #1
siva
I have two meta level questions: 1. We wanted to support streaming of messages when ...
8 years, 4 months ago (2012-08-22 01:57:49 UTC) #2
siva
https://chromiumcodereview.appspot.com/10829444/diff/1/runtime/lib/isolate.cc File runtime/lib/isolate.cc (right): https://chromiumcodereview.appspot.com/10829444/diff/1/runtime/lib/isolate.cc#newcode142 runtime/lib/isolate.cc:142: intptr_t data_len = writer.FinalizeBuffer(); As discussed offline we could ...
8 years, 4 months ago (2012-08-22 23:30:39 UTC) #3
turnidge
Siva, This is a pretty major revision. I have dropped the header entirely for messages ...
8 years, 4 months ago (2012-08-23 18:37:57 UTC) #4
siva
lgtm https://chromiumcodereview.appspot.com/10829444/diff/22001/runtime/vm/snapshot_test.cc File runtime/vm/snapshot_test.cc (right): https://chromiumcodereview.appspot.com/10829444/diff/22001/runtime/vm/snapshot_test.cc#newcode595 runtime/vm/snapshot_test.cc:595: } This has changed the model of the ...
8 years, 3 months ago (2012-08-27 16:31:17 UTC) #5
turnidge
https://chromiumcodereview.appspot.com/10829444/diff/22001/runtime/vm/snapshot_test.cc File runtime/vm/snapshot_test.cc (right): https://chromiumcodereview.appspot.com/10829444/diff/22001/runtime/vm/snapshot_test.cc#newcode595 runtime/vm/snapshot_test.cc:595: } On 2012/08/27 16:31:17, asiva wrote: > This has ...
8 years, 3 months ago (2012-08-27 17:43:05 UTC) #6
siva
https://chromiumcodereview.appspot.com/10829444/diff/22001/runtime/vm/snapshot_test.cc File runtime/vm/snapshot_test.cc (right): https://chromiumcodereview.appspot.com/10829444/diff/22001/runtime/vm/snapshot_test.cc#newcode595 runtime/vm/snapshot_test.cc:595: } This test was trying to test both the ...
8 years, 3 months ago (2012-08-27 18:41:03 UTC) #7
turnidge
8 years, 3 months ago (2012-08-27 20:09:16 UTC) #8
https://chromiumcodereview.appspot.com/10829444/diff/22001/runtime/vm/snapsho...
File runtime/vm/snapshot_test.cc (right):

https://chromiumcodereview.appspot.com/10829444/diff/22001/runtime/vm/snapsho...
runtime/vm/snapshot_test.cc:595: }
Ok, I've revert it to its original form.

On 2012/08/27 18:41:03, asiva wrote:
> This test was trying to test both the singleton aspect as well as the
> possibility of having only singletons (more than one) in the snapshot. (i.e no
> code in writer assumed it will see an object to be serialized).
> 
> On 2012/08/27 17:43:05, turnidge wrote:
> > On 2012/08/27 16:31:17, asiva wrote:
> > > This has changed the model of the test itself. It used to serialize all
> > > singleton objects into one snapshot and read from that snapshot but now it
> > seems
> > > to create individual snapshots for each of them and read them.
> > 
> > Yes, it has.  I didn't think that putting them in the same snapshot was an
> > important aspect of the test.  My opinion was that if they can
> > serialize/deserialize individually, they can probably do it together.  I
> figured
> > that the existing FullSnapshot test provided a fine test of multiple object
> > serialization/deserialization.
> > 
> > Is it important to you to have it as it originally was?  If so, I either
need
> to
> > (a) throw all of the singletons into an object array and serialize that as a
> > single message or  (b) make my own testing subclass of SnapshotWriter that
> > exposes UnmarkAll() publicly.
> > 
> > Let me know what you'd like me to do.
>

Powered by Google App Engine
This is Rietveld 408576698