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

Issue 151150044: code review 151150044: [release-branch.go1.3] cmd/5l, cmd/6l, cmd/8l: fix nacl... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 6 months ago by rsc
Modified:
9 years, 6 months ago
Reviewers:
gobot, bradfitz
CC:
golang-codereviews, adg, bradfitz, iant
Visibility:
Public.

Description

[release-branch.go1.3] cmd/5l, cmd/6l, cmd/8l: fix nacl binary corruption bug ««« CL 135050043 / 57dfd03985a9 cmd/5l, cmd/6l, cmd/8l: fix nacl binary corruption bug NaCl requires the addition of a 32-byte "halt sled" at the end of the text segment. This means that segtext.len is actually 32 bytes shorter than reality. The computation of the file offset of the end of the data segment did not take this 32 bytes into account, so if len and len+32 rounded up (by 64k) to different values, the symbol table overwrote the last page of the data segment. The last page of the data segment is usually the C .string symbols, which contain the strings used in error prints by the runtime. So when this happens, your program probably crashes, and then when it does, you get binary garbage instead of all the usual prints. The chance of hitting this with a randomly sized text segment is 32 in 65536, or 1 in 2048. If you add or remove ANY code while trying to debug this problem, you're overwhelmingly likely to bump the text segment one way or the other and make the bug disappear. Correct all the computations to use segdata.fileoff+segdata.filelen instead of trying to rederive segdata.fileoff. This fixes the failure during the nacl/amd64p32 build. TBR=iant CC=golang-codereviews https://codereview.appspot.com/135050043 »»»

Patch Set 1 #

Patch Set 2 : diff -r 6ee8ec277a21 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 19005c375ee5 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -10 lines) Patch
M src/cmd/5l/asm.c View 1 chunk +2 lines, -2 lines 0 comments Download
M src/cmd/6l/asm.c View 2 chunks +4 lines, -4 lines 0 comments Download
M src/cmd/8l/asm.c View 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 4
rsc
Hello golang-codereviews@googlegroups.com (cc: adg, bradfitz, iant), I'd like you to review this change to https://code.google.com/p/go/
9 years, 6 months ago (2014-09-30 16:31:38 UTC) #1
bradfitz
LGTM On Sep 30, 2014 9:31 AM, <rsc@golang.org> wrote: > Reviewers: golang-codereviews, > > Message: ...
9 years, 6 months ago (2014-09-30 16:37:34 UTC) #2
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=b536a7214cc1 *** [release-branch.go1.3] cmd/5l, cmd/6l, cmd/8l: fix nacl binary corruption bug ««« ...
9 years, 6 months ago (2014-09-30 16:43:53 UTC) #3
gobot
9 years, 6 months ago (2014-09-30 17:57:11 UTC) #4
Message was sent while issue was closed.
This CL appears to have broken the netbsd-amd64-bsiegert builder.
See http://build.golang.org/log/a18b28112d6c2c69457cd9f5fe61615626be86d3
Sign in to reply to this message.

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