Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3187)

Issue 9372044: code review 9372044: runtime: fix heap corruption (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 11 months ago by dvyukov
Modified:
10 years, 11 months ago
Reviewers:
CC:
cshapiro, iant, r, cshapiro1, minux1, bradfitz, gobot, golang-dev
Visibility:
Public.

Description

runtime: fix GC scanning of slices If a slice points to an array embedded in a struct, the whole struct can be incorrectly scanned as the slice buffer. Fixes issue 5443.

Patch Set 1 #

Patch Set 2 : diff -r 931a7362e30c https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 931a7362e30c https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 6

Patch Set 4 : diff -r 931a7362e30c https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r 3ab8b1709d9b https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 6 : diff -r 3ab8b1709d9b https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -1 line) Patch
M src/pkg/runtime/gc_test.go View 1 1 chunk +24 lines, -0 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 2 3 4 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 14
dvyukov
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
10 years, 11 months ago (2013-05-15 17:15:59 UTC) #1
bradfitz
Nice test! On Wed, May 15, 2013 at 10:15 AM, <dvyukov@google.com> wrote: > Reviewers: golang-dev1, ...
10 years, 11 months ago (2013-05-15 17:25:56 UTC) #2
gobot
R=cshapiro (assigned by r)
10 years, 11 months ago (2013-05-15 17:34:14 UTC) #3
iant
LGTM Thanks.
10 years, 11 months ago (2013-05-15 18:01:33 UTC) #4
r
https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c#newcode803 src/pkg/runtime/mgc0.c:803: // because if it points to an array embed ...
10 years, 11 months ago (2013-05-15 18:16:37 UTC) #5
cshapiro1
https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c#newcode802 src/pkg/runtime/mgc0.c:802: // Can't use slice element type for scanning, I ...
10 years, 11 months ago (2013-05-15 18:23:05 UTC) #6
dvyukov
https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c#newcode802 src/pkg/runtime/mgc0.c:802: // Can't use slice element type for scanning, On ...
10 years, 11 months ago (2013-05-15 18:30:28 UTC) #7
cshapiro1
https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c#newcode802 src/pkg/runtime/mgc0.c:802: // Can't use slice element type for scanning, Can ...
10 years, 11 months ago (2013-05-15 18:39:01 UTC) #8
dvyukov
https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c#newcode802 src/pkg/runtime/mgc0.c:802: // Can't use slice element type for scanning, On ...
10 years, 11 months ago (2013-05-15 19:23:10 UTC) #9
dvyukov
On 2013/05/15 18:39:01, cshapiro1 wrote: > https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c > File src/pkg/runtime/mgc0.c (right): > > https://codereview.appspot.com/9372044/diff/5001/src/pkg/runtime/mgc0.c#newcode802 > ...
10 years, 11 months ago (2013-05-15 19:24:34 UTC) #10
cshapiro1
LGTM, thanks.
10 years, 11 months ago (2013-05-15 19:34:27 UTC) #11
minux1
I think it's worth mentioning that this only happens iff the array is at the ...
10 years, 11 months ago (2013-05-15 19:46:54 UTC) #12
dvyukov
*** Submitted as https://code.google.com/p/go/source/detail?r=1abed5873071 *** runtime: fix GC scanning of slices If a slice points ...
10 years, 11 months ago (2013-05-15 19:50:44 UTC) #13
dvyukov
10 years, 11 months ago (2013-05-15 19:51:06 UTC) #14
Message was sent while issue was closed.
On 2013/05/15 19:46:54, minux wrote:
> I think it's worth mentioning that this only happens iff
> the array is at the beginning of the struct.

Done
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b