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

Issue 7870044: code review 7870044: runtime: correct mmap return value checking on netbsd/o... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by jsing
Modified:
12 years ago
Reviewers:
CC:
golang-dev, r
Visibility:
Public.

Description

runtime: correct mmap return value checking on netbsd/openbsd The current SysAlloc implementation suffers from a signed vs unsigned comparision bug. Since the error code from mmap is negated, the unsigned comparision of v < 4096 is always false on error. Fix this by switching to the darwin/freebsd/linux mmap model and leave the mmap return value unmodified.

Patch Set 1 : diff -r b5b5c246be0c https://go.googlecode.com/hg/ #

Patch Set 2 : diff -r f12b24ea373f https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 9f7966fdf741 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -18 lines) Patch
M src/pkg/runtime/mem_netbsd.c View 3 chunks +4 lines, -5 lines 0 comments Download
M src/pkg/runtime/mem_openbsd.c View 3 chunks +4 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_netbsd_386.s View 1 chunk +0 lines, -2 lines 0 comments Download
M src/pkg/runtime/sys_netbsd_amd64.s View 1 chunk +0 lines, -2 lines 0 comments Download
M src/pkg/runtime/sys_openbsd_386.s View 1 chunk +0 lines, -2 lines 0 comments Download
M src/pkg/runtime/sys_openbsd_amd64.s View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 3
jsing
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
12 years ago (2013-03-17 15:26:43 UTC) #1
r
LGTM
12 years ago (2013-03-17 15:59:50 UTC) #2
jsing
12 years ago (2013-03-18 01:18:58 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=43eb97ed849a ***

runtime: correct mmap return value checking on netbsd/openbsd

The current SysAlloc implementation suffers from a signed vs unsigned
comparision bug. Since the error code from mmap is negated, the
unsigned comparision of v < 4096 is always false on error. Fix this
by switching to the darwin/freebsd/linux mmap model and leave the mmap
return value unmodified.

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/7870044
Sign in to reply to this message.

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