You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, under lldb/gdb, there is a crash of EXC_BAD_ACCESS (code=1, address=0x8) on mac (or Segmentation fault on Linux):
$ go build main.go -o main
$ lldb main
(lldb) target create "main"
Current executable set to '/Users/xxx/main' (x86_64).
(lldb) r
Process 3973 launched: '/Users/xxx/main' (x86_64)
<nil>
Process 3973 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
frame #0: 0x000000000408eaa0 main`net/url.(*URL).String + 64
main`net/url.(*URL).String:-> 0x408eaa0 <+64>: movq 0x8(%rax), %rcx 0x408eaa4 <+68>: movq (%rax), %rbx 0x408eaa7 <+71>: testq %rcx, %rcx 0x408eaaa <+74>: je 0x408ebf5 ;<+405>Target 0: (main) stopped.(lldb)
What did you expect to see?
Without EXC_BAD_ACCESS or Segmentation fault error under lldb/gdb. Or give a panic error in normal running (without lldb/gdb).
What did you see instead?
EXC_BAD_ACCESS(mac) or Segmentation fault (linux) error under gdb/lldb (see above).
Please note: It seams fine in normal running (without lldb/gdb), but the error is silent which is hard to find and track it.
Background:
In my development, I call a go api in my swift code, but my app gives me an error of EXC_BAD_ACCESS and the whole app crashed. I spend a lot of time to find the possible bug, and eventually find it may be a bug of the go code (the go code is similar to above main.go code) and created this issue.
under lldb/gdb, there is a crash of EXC_BAD_ACCESS (code=1, address=0x8) on mac (or Segmentation fault on Linux)
That sounds like a problem with your debugger configuration: namely, it sounds like the debugger is assuming that a segmentation fault necessarily leads to a crash.
(The recover in the fmt package might be a little too aggressive — see #28150 — but it certainly can't be removed at this point without breaking compatibility.)
In my development, I call a go api in my swift code, but my app gives me an error of EXC_BAD_ACCESS and the whole app crashed.
In that case, you might need to raise an issue with the maintainers of the Swift runtime. In my experience, many language runtimes do not properly forward unhandled signals to other runtimes' existing signal handlers. (I'm happy to give further detail on what I've learned about how to robustly forward a signal; feel free to loop me in on any Swift issue you file for this.)
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Everything looks fine:
However, under lldb/gdb, there is a crash of
EXC_BAD_ACCESS (code=1, address=0x8)
on mac (orSegmentation fault
on Linux):What did you expect to see?
Without
EXC_BAD_ACCESS
or Segmentation fault error under lldb/gdb. Or give a panic error in normal running (without lldb/gdb).What did you see instead?
EXC_BAD_ACCESS
(mac) orSegmentation fault
(linux) error under gdb/lldb (see above).Please note: It seams fine in normal running (without lldb/gdb), but the error is silent which is hard to find and track it.
Background:
In my development, I call a go api in my swift code, but my app gives me an error of
EXC_BAD_ACCESS
and the whole app crashed. I spend a lot of time to find the possible bug, and eventually find it may be a bug of the go code (the go code is similar to abovemain.go
code) and created this issue.related issue: #42816
The text was updated successfully, but these errors were encountered: