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

Issue 4222043: code review 4222043: runtime: omit breakpoint during terminal panic (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 2 months ago by rsc
Modified:
14 years, 2 months ago
Reviewers:
brainman
CC:
r, r2, golang-dev
Visibility:
Public.

Description

runtime: omit breakpoint during terminal panic A terminal panic (one that prints a stack trace and exits) has been calling runtime.breakpoint before calling exit, so that if running under a debugger, the debugger can take control. When not running under a debugger, though, this causes an additional SIGTRAP on Unix and pop-up dialogs on Windows. Support for debugging Go programs has gotten good enough that we can rely on the debugger to set its own breakpoint on runtime.exit if it wants to look around.

Patch Set 1 #

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

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

Patch Set 4 : diff -r 6fa737bf65b9 https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+0 lines, -7 lines) Patch
M src/pkg/runtime/darwin/386/signal.c View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/darwin/amd64/signal.c View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/freebsd/386/signal.c View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/freebsd/amd64/signal.c View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/linux/386/signal.c View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/linux/amd64/signal.c View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/windows/386/signal.c View 1 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 4
rsc
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg
14 years, 2 months ago (2011-02-23 19:54:58 UTC) #1
r2
LGTM
14 years, 2 months ago (2011-02-23 20:39:52 UTC) #2
rsc
*** Submitted as 618f3bf36698 *** runtime: omit breakpoint during terminal panic A terminal panic (one ...
14 years, 2 months ago (2011-02-23 20:42:17 UTC) #3
brainman
14 years, 2 months ago (2011-02-24 01:43:19 UTC) #4
On 2011/02/23 19:54:58, rsc wrote:
> Hello r (cc: mailto:golang-dev@googlegroups.com),
> 
> I'd like you to review this change to
> https://go.googlecode.com/hg

I don't think it is correct. This program:

package main

func main() {
        b := 0
        a := 10 / b
        println(a)
}

prints this:

panic: runtime error: integer divide by zero

[signal 0x8 code=0x1 addr=0x8048c24 pc=0x8048c24]

runtime.panic+0xa4 /root/hg/go/src/pkg/runtime/proc.c:1054
        runtime.panic(0x8056d78, 0x18478008)
runtime.panicstring+0x95 /root/hg/go/src/pkg/runtime/runtime.c:118
        runtime.panicstring(0x806b774, 0x8053059)
runtime.sigpanic+0x10c /root/hg/go/src/pkg/runtime/linux/thread.c:297
        runtime.sigpanic()
main.main+0x24 /root/t2/test.go:5
        main.main()
runtime.mainstart+0xf /root/hg/go/src/pkg/runtime/386/asm.s:93
        runtime.mainstart()
runtime.goexit /root/hg/go/src/pkg/runtime/proc.c:150
        runtime.goexit()

But runtime.panic calls runtime.dopanic, that calls runtime.breakpoint before
calling runtime.exit(2).

Alex
Sign in to reply to this message.

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