delve: On macOS a SIGSEGV (EXC_BAD_ACCESS) can not be propagated back to the target
- What version of Delve are you using (
dlv version
)? Version: 1.0.0-rc.1 - What version of Go are you using? (
go version
)? go version go1.8.2 darwin/amd64 note: also occurs with 1.8.1 - What operating system and processor architecture are you using? OSX El Capitan
- What did you do? Attempt to debug go program that uses go-kit/kit/log
- What did you expect to see? Program runs normally
- What did you see instead? Program stops at go-stack/stack/stack.go/stack.go:228
Here is the source code:
package main
import (
"os"
"github.com/go-kit/kit/log"
)
func main() {
log.NewLogfmtLogger(os.Stdout)
}
Here’s what the delve session looks like:
~/dev/go/src/mat/foo $ dlv debug
Type 'help' for list of commands.
(dlv) continue
> mat/vendor/github.com/go-stack/stack.findSigpanic.func1() /Users/mathewnelson/dev/go/src/mat/vendor/github.com/go-stack/stack/stack.go:228 (PC: 0x10b8ec3)
223: }
224: }
225: }
226: }()
227: // intentional nil pointer dereference to trigger sigpanic
=> 228: return *p
229: }()
230: return fn
231: }
232:
233: var sigpanic = findSigpanic()
(dlv)
This was working with 0.12.2.
Thank you.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 12
- Comments: 18 (11 by maintainers)
Links to this issue
Commits related to this issue
- terminal: print something when continue errors even if we don't have a file We should print something when we exit from continue/next/step/stepout even if we don't have a source file for the instruc... — committed to aarzilli/delve by aarzilli 6 years ago
- terminal: print something when continue errors even if we don't have a file We should print something when we exit from continue/next/step/stepout even if we don't have a source file for the instruc... — committed to go-delve/delve by aarzilli 6 years ago
- [debugserver] Add option to propagate SIGSEGV to target process Adds a command line option that makes debugserver propagate the SIGSEGV signal to the target process. Motivation: I'm one of the maint... — committed to llvm/llvm-project by aarzilli 4 years ago
- [debugserver] Add option to propagate SIGSEGV to target process Adds a command line option that makes debugserver propagate the SIGSEGV signal to the target process. Motivation: I'm one of the maint... — committed to llvm/Polygeist by aarzilli 4 years ago
- proc/gdbserial: use --unmask-signal debugserver option Fixes #852 — committed to aarzilli/delve by deleted user 4 years ago
- proc/gdbserial: use --unmask-signal debugserver option (#2255) Fixes #852 Co-authored-by: a <a@kra> — committed to go-delve/delve by aarzilli 4 years ago
- [debugserver] Add option to propagate SIGSEGV to target process Adds a command line option that makes debugserver propagate the SIGSEGV signal to the target process. Motivation: I'm one of the maint... — committed to arichardson/llvm-project by aarzilli 4 years ago
- terminal: print something when continue errors even if we don't have a file We should print something when we exit from continue/next/step/stepout even if we don't have a source file for the instruc... — committed to cgxxv/delve by aarzilli 6 years ago
Is there any workaround for this? This is really a pain.
Note: even though this bug is closed you will continue to experience it until a version of debugserver with the corresponding patch is installed. At the time of this message no released version of xcode command line tools has it.
Here’s a simple solution on my mac to build debugserver from sourcecode:
The last step is to configure go-delve to use debugserver compiled above. Here are some possible solutions:
PATH
likeDELVE_DEBUGSERVER_PATH
,dlv
will use the value of this variable as the absolute path ofdebugserver
.I haven’t experienced this since upgrading to Go 1.15.4 🤞 I think https://github.com/golang/go/commit/1b49a86ecece3978ceba60c372327b9cbcc68501 may provide the workaround
Building the lldb debug server manually wasn’t straightforward or easy 😞