On 2010/09/01 12:21:57, Søren Gjesse wrote:
http://codereview.chromium.org/3334001/diff/1/2
File src/cpu-profiler.cc (right):

http://codereview.chromium.org/3334001/diff/1/2#newcode243
src/cpu-profiler.cc:243: TickSampleEventRecord record = *rec;
If I remember correctly the queue is an array of TickSampleEventRecords being filled by the sample writer. Then how does this copy (struct memcpy) ensure
that
the content of record is not a mix of two sample records?

It doesn't, but it's not that scary -- as a result, we will just have an
inconsistent stack trace -- a noise. The purpose of copying is make sure that RecordTickSample doesn't work with a record being changed under its feet. E.g.
RTS allocates a buffer using frames_count, then it fills it, again using
frames_count, so if frames_count changes on the fly, memory overrun happens.

http://codereview.chromium.org/3334001/show

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to