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

Issue 66590044: code review 66590044: runtime/debug: add SetPanicOnFault (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by rsc
Modified:
11 years, 3 months ago
Reviewers:
minux1, gobot, dave, r, albert.strasheim, dvyukov
CC:
r, golang-codereviews
Visibility:
Public.

Description

runtime/debug: add SetPanicOnFault SetPanicOnFault allows recovery from unexpected memory faults. This can be useful if you are using a memory-mapped file or probing the address space of the current program.

Patch Set 1 #

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -15 lines) Patch
M doc/go1.3.txt View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/debug/garbage.go View 1 1 chunk +11 lines, -0 lines 0 comments Download
M src/pkg/runtime/os_darwin.c View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/os_dragonfly.c View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/os_freebsd.c View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/os_linux.c View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/os_netbsd.c View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/os_openbsd.c View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/os_solaris.c View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/os_windows.c View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/proc.c View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/rdebug.goc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/runtime_test.go View 1 2 chunks +18 lines, -0 lines 0 comments Download

Messages

Total messages: 21
rsc
Hello r (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
11 years, 3 months ago (2014-02-20 21:10:01 UTC) #1
r
LGTM don't forget go1.3.text
11 years, 3 months ago (2014-02-20 21:12:17 UTC) #2
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=b5eda189b974 *** runtime/debug: add SetPanicOnFault SetPanicOnFault allows recovery from unexpected memory faults. ...
11 years, 3 months ago (2014-02-20 21:18:09 UTC) #3
gobot
This CL appears to have broken the darwin-386-cheney builder.
11 years, 3 months ago (2014-02-20 22:07:34 UTC) #4
dave_cheney.net
Unrelated On Fri, Feb 21, 2014 at 9:07 AM, <gobot@golang.org> wrote: > This CL appears ...
11 years, 3 months ago (2014-02-20 22:09:30 UTC) #5
dvyukov
I was thinking about the following interface: SetPanicOnFaultRange(start *byte, size uintptr, on bool) It solves ...
11 years, 3 months ago (2014-02-21 13:35:02 UTC) #6
rsc
On Fri, Feb 21, 2014 at 8:35 AM, <dvyukov@google.com> wrote: > I was thinking about ...
11 years, 3 months ago (2014-02-21 15:47:49 UTC) #7
dvyukov
On 2014/02/21 15:47:49, rsc wrote: > > I am also a bit concerned that we ...
11 years, 3 months ago (2014-02-22 11:01:33 UTC) #8
r
It's for debugging. On Sat, Feb 22, 2014 at 3:01 AM, <dvyukov@google.com> wrote: > On ...
11 years, 3 months ago (2014-02-22 16:04:57 UTC) #9
albert.strasheim
Hello On 2014/02/20 21:18:09, rsc wrote: > *** Submitted as https://code.google.com/p/go/source/detail?r=b5eda189b974 *** > runtime/debug: add ...
11 years, 3 months ago (2014-02-22 18:18:39 UTC) #10
rsc
SIGBUS too.
11 years, 3 months ago (2014-02-22 20:35:17 UTC) #11
dvyukov
On Sat, Feb 22, 2014 at 4:04 PM, Rob Pike <r@golang.org> wrote: > It's for ...
11 years, 3 months ago (2014-02-23 09:49:34 UTC) #12
dvyukov
On Fri, Feb 21, 2014 at 3:47 PM, Russ Cox <rsc@golang.org> wrote: > On Fri, ...
11 years, 3 months ago (2014-02-23 10:11:28 UTC) #13
rsc
runtime/debug is poorly named. It is more like runtime/knobs. Too late to change. On Sun, ...
11 years, 3 months ago (2014-02-23 15:44:15 UTC) #14
dvyukov
On Sun, Feb 23, 2014 at 7:44 PM, Russ Cox <rsc@golang.org> wrote: > runtime/debug is ...
11 years, 3 months ago (2014-02-24 05:57:20 UTC) #15
minux1
On Mon, Feb 24, 2014 at 12:56 AM, Dmitry Vyukov <dvyukov@google.com> wrote: > On Sun, ...
11 years, 3 months ago (2014-02-24 06:09:32 UTC) #16
dvyukov
On Mon, Feb 24, 2014 at 10:09 AM, minux <minux.ma@gmail.com> wrote: > > On Mon, ...
11 years, 3 months ago (2014-02-24 06:12:20 UTC) #17
minux1
On Mon, Feb 24, 2014 at 1:11 AM, Dmitry Vyukov <dvyukov@google.com> wrote: > On Mon, ...
11 years, 3 months ago (2014-02-24 06:19:36 UTC) #18
dvyukov
On Mon, Feb 24, 2014 at 10:19 AM, minux <minux.ma@gmail.com> wrote: > > On Mon, ...
11 years, 3 months ago (2014-02-24 06:23:41 UTC) #19
dvyukov
On Mon, Feb 24, 2014 at 10:23 AM, Dmitry Vyukov <dvyukov@google.com> wrote: > On Mon, ...
11 years, 3 months ago (2014-02-24 07:51:14 UTC) #20
rsc
11 years, 3 months ago (2014-02-24 16:33:37 UTC) #21
On Mon, Feb 24, 2014 at 12:56 AM, Dmitry Vyukov <dvyukov@google.com> wrote:

> I guess then you need to wrap PanicOnFault Reader into bufio.Reader,
> because defer/recover are not cheap enough to be executed for every
> few bytes. Is it the intention?


it all depends on what you want to do with the code.

you are trying to pass off one of these sketchy buffers to code that
doesn't know it is handling a sketchy buffer. i think that is a bad idea,
fraught with peril.

in cmd/link i have a function that does all the copying from files into the
final executable image. it can do one defer before any of the copying
begins. this is possible because that code _knows_ it is dealing with
sketchy buffers. that is an okay requirement.

russ
Sign in to reply to this message.

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