закешированный к нам в целях безопасности дебаггер
Go to file
aarzilli f32ce1b21d proc/native: fix race condition between Halt and process death (linux)
If a breakpoint is hit close to process death on a thread that isn't
the group leader the process could die while we are trying to stop it.

This can be easily reproduced by having the goroutine that's executing
main.main (which will almost always run on the thread group leader)
wait for a second goroutine before exiting, then setting a breakpoint
on the second goroutine and stepping through it (see TestIssue1101 in
proc_test.go).

When stepping over the return instruction of main.f the deferred
wg.Done() call will be executed which will cause the main goroutine to
resume and proceed to exit. Both the temporary breakpoint on wg.Done
and the temporary breakpoint on the return address of main.f will be in
close proximity to main.main calling os.Exit() and causing the death of
the thread group leader.

Under these circumstances the call to native.(*Thread).waitFast in
native.(*Thread).halt can hang forever due to a bug similar to
https://sourceware.org/bugzilla/show_bug.cgi?id=12702 (see comment in
native.(*Thread).wait for an explanation).

Replacing waitFast with a normal wait work in most circumstances,
however, besides the performance hit, it looks like in this
circumstances trapWait sometimes receives a spurious SIGTRAP on the
dying group leader which would cause the subsequent call to wait in
halt to accidentally reap the process without noting that it did exit.

Instead this patch removes the call to wait from halt and instead calls
trapWait in a loop in setCurrentBreakpoints until all threads are set
to running=false. This is also a better fix than the workaround to
ESRCH error while setting current breakpoints implemented in 94b50d.

Fixes #1101
2018-03-06 09:06:19 -08:00
_fixtures proc/native: fix race condition between Halt and process death (linux) 2018-03-06 09:06:19 -08:00
assets Add high-res images 2015-05-19 12:25:26 -05:00
cmd/dlv command/terminal: allow restart to change process args (#1060) 2018-01-18 14:16:11 -08:00
Documentation Documentation: remove homebrew as an install method 2018-03-05 10:10:17 -08:00
pkg proc/native: fix race condition between Halt and process death (linux) 2018-03-06 09:06:19 -08:00
scripts pkg/proc, pkg/dwarf/op: support DW_OP_piece, DW_OP_regX, DW_OP_fbreg 2017-11-21 11:51:02 -08:00
service dwarf/reader,proc: support DW_AT_abstract_origin (#1111) 2018-02-13 09:20:45 -08:00
vendor command/terminal: allow restart to change process args (#1060) 2018-01-18 14:16:11 -08:00
.gitattributes makefile: use git's $Id$ instead of setting ver.Build in makefile (#807) 2017-04-28 10:14:33 -07:00
.gitignore git: Update gitignore 2015-10-20 20:55:11 -07:00
.travis.yml core_test: fix TestCoreFpRegisters on go1.9 (#1082) 2018-01-24 11:42:35 -08:00
appveyor.yml *: Update appveyor.yml 2017-05-27 14:12:31 +02:00
CHANGELOG.md all: Bump to v1.0.0 (#1126) 2018-02-19 21:33:47 +01:00
CONTRIBUTING.md Update CONTRIBUTING.md 2016-05-13 10:43:09 +08:00
glide.lock pkg/dwarf/godwarf: split out type parsing from x/debug/dwarf 2017-08-01 11:20:25 -06:00
glide.yaml pkg/dwarf/godwarf: split out type parsing from x/debug/dwarf 2017-08-01 11:20:25 -06:00
ISSUE_TEMPLATE.md misc: Include issue template for GitHub 2016-03-03 10:40:14 -08:00
LICENSE Add License and README 2014-05-03 15:31:52 -05:00
Makefile Makefile: use go env GOPATH for install path 2017-12-20 16:34:11 -08:00
README.md Documentation: fix link to Getting Started 2018-01-04 11:17:36 -08:00

Delve

license GoDoc Build Status Build status Join the chat at https://gitter.im/derekparker/delve

The Github issue tracker is for bugs only. Please use the developer mailing list for any feature proposals and discussions.

About Delve

Delve is a debugger for the Go programming language. The goal of the project is to provide a simple, full featured debugging tool for Go. Delve should be easy to invoke and easy to use. Chances are if you're using a debugger, things aren't going your way. With that in mind, Delve should stay out of your way as much as possible.