-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VS Code simple golang example not working #834
Comments
Thanks for reporting this. |
go version go1.19.3 linux/amd64 |
and for dlv: Delve Debugger
Version: 1.20.0
Build: $Id: 8ec46ee3d275c276b8e7465d69a23399e0e14789 $ |
Hey @MidasLamb - I managed to reproduce it and also partially fix it. I don't want to deliver half-baked so this is blocked on other existing issues that we are working on to solve this in a proper manner. |
Hi @aviramha , thanks for the investigation! |
Sorry, the cli fix is pending the extension change (so we can have a "unified" approach). |
I've looked into the VS Code extension just because it seems easiest to set up and get going, but normally I use neovim, so if there is a CLI fix then I'll just try to set up everything in neovim, so a CLI fix would be pretty useful already for me :) |
Hey! This should be fixed with https://github.com/metalbear-co/mirrord/releases/tag/3.14.0 - Please try it out and let us know if we can close this. |
@aviramha I've tried it with the VS Code extension again, I notice that when I
You can see the "Hello, World" from the initial main, but then I open the browser to go the the site, it's a bit slow and then the debug session ends. Not sure if it's the same issue? I can close this one and open a new one if you want! |
Just to confirm, issue is only on mirroring, steal works well? "agent": {"ttl": 100} and then fetch the agent logs? |
On the simple example steal works well, mirroring does not. I just tried again and now it handled 1 request before it disconnected. How do I fetch the agent logs? I see there is a command |
Ah that's good observation, mirrord extract is.. well it was used for extension and will be removed soon (it just extracts the layer..) You can just use |
I tried to reproduce it today, and now the difference is not that the agent disconnects, but rather that when mirroring, the go code panics with:
But when stealing, everything is fine. The agent seems fine as well:
for stealing:
|
@MidasLamb Thanks! |
@aviramha , great thanks! I've also tried mirrord on a more complex program now but that segfaults before entering main:
Debugging locally works fine. Not sure if these two would be related or not? |
can you try 3.15.2? I think we fixed the issue with mirroring in #875 |
For me it is also not working. I am using the GoLand plugin and a simpel On reaching the breakpoint program just hangs without actually entering the debugger in the IDE. It is independent of the mirrord config (steal vs mirror). The console output does not show anything:
I am using Plugin version 3.16.2 |
Very weird - I managed to reproduce this. Can you open a new issue for this as it's probably different bug than the one in this issue? |
Thanks for the work and sorry for the delay! I've tried with version 3.17.0 now, and the segfault still occurs for the complex program, both for mirror and steal. The debug console log: SIGSEGV: segmentation violation
PC=0x7faba5b532dd m=0 sigcode=1
goroutine 1 [syscall, locked to thread]:
syscall.Syscall(0x48, 0x0, 0x3, 0x0)
/usr/lib/go/src/syscall/syscall_linux.go:68 +0x4b fp=0xc0000d59b8 sp=0xc0000d5940 pc=0x908eab
internal/syscall/unix.IsNonblock(0x0)
/usr/lib/go/src/internal/syscall/unix/nonblocking.go:16 +0x45 fp=0xc0000d5a28 sp=0xc0000d59b8 pc=0x936f05
os.NewFile(0x0, {0x450fc52, 0xa})
/usr/lib/go/src/os/file_unix.go:103 +0x4c fp=0xc0000d5a98 sp=0xc0000d5a28 pc=0x9511ac
os.init()
/usr/lib/go/src/os/file.go:66 +0x1e8 fp=0xc0000d5ac0 sp=0xc0000d5a98 pc=0x958ac8
runtime.doInit(0x6021520)
/usr/lib/go/src/runtime/proc.go:6329 +0x132 fp=0xc0000d5bf0 sp=0xc0000d5ac0 pc=0x850b92
runtime.doInit(0x601b740)
/usr/lib/go/src/runtime/proc.go:6306 +0x79 fp=0xc0000d5d20 sp=0xc0000d5bf0 pc=0x850ad9
runtime.doInit(0x601e920)
/usr/lib/go/src/runtime/proc.go:6306 +0x79 fp=0xc0000d5e50 sp=0xc0000d5d20 pc=0x850ad9
runtime.doInit(0x602dc20)
/usr/lib/go/src/runtime/proc.go:6306 +0x79 fp=0xc0000d5f80 sp=0xc0000d5e50 pc=0x850ad9
runtime.main()
/usr/lib/go/src/runtime/proc.go:233 +0x199 fp=0xc0000d5fe0 sp=0xc0000d5f80 pc=0x843739
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000d5fe8 sp=0xc0000d5fe0 pc=0x876701
goroutine 2 [force gc (idle)]:
runtime.gopark(0x45fdca8, 0x6108ee0, 0x11, 0x14, 0x1)
/usr/lib/go/src/runtime/proc.go:363 +0xfd fp=0xc000092f88 sp=0xc000092f58 pc=0x843b9d
runtime.goparkunlock(0x0?, 0x0?, 0x0?, 0x0?)
/usr/lib/go/src/runtime/proc.go:369 +0x2a fp=0xc000092fb8 sp=0xc000092f88 pc=0x843c2a
runtime.forcegchelper()
/usr/lib/go/src/runtime/proc.go:302 +0xa5 fp=0xc000092fe0 sp=0xc000092fb8 pc=0x8439c5
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000092fe8 sp=0xc000092fe0 pc=0x876701
created by runtime.init.6
/usr/lib/go/src/runtime/proc.go:290 +0x25
goroutine 3 [GC sweep wait]:
runtime.gopark(0x45fdca8, 0x6109d00, 0xc, 0x14, 0x1)
/usr/lib/go/src/runtime/proc.go:363 +0xfd fp=0xc000093768 sp=0xc000093738 pc=0x843b9d
runtime.goparkunlock(0x0?, 0x0?, 0x0?, 0x0?)
/usr/lib/go/src/runtime/proc.go:369 +0x2a fp=0xc000093798 sp=0xc000093768 pc=0x843c2a
runtime.bgsweep(0x0?)
/usr/lib/go/src/runtime/mgcsweep.go:278 +0x98 fp=0xc0000937c8 sp=0xc000093798 pc=0x82b5d8
runtime.gcenable.func1()
/usr/lib/go/src/runtime/mgc.go:178 +0x26 fp=0xc0000937e0 sp=0xc0000937c8 pc=0x81f986
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000937e8 sp=0xc0000937e0 pc=0x876701
created by runtime.gcenable
/usr/lib/go/src/runtime/mgc.go:178 +0x6b
goroutine 4 [GC scavenge wait]:
runtime.gopark(0x45fdca8, 0x610d980, 0xd, 0x14, 0x2)
/usr/lib/go/src/runtime/proc.go:363 +0xfd fp=0xc000093f48 sp=0xc000093f18 pc=0x843b9d
runtime.goparkunlock(0x486ec08?, 0x1?, 0x0?, 0x0?)
/usr/lib/go/src/runtime/proc.go:369 +0x2a fp=0xc000093f78 sp=0xc000093f48 pc=0x843c2a
runtime.(*scavengerState).park(0x610d980)
/usr/lib/go/src/runtime/mgcscavenge.go:389 +0x4b fp=0xc000093fa0 sp=0xc000093f78 pc=0x82926b
runtime.bgscavenge(0x0?)
/usr/lib/go/src/runtime/mgcscavenge.go:617 +0x45 fp=0xc000093fc8 sp=0xc000093fa0 pc=0x829845
runtime.gcenable.func2()
/usr/lib/go/src/runtime/mgc.go:179 +0x26 fp=0xc000093fe0 sp=0xc000093fc8 pc=0x81f926
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000093fe8 sp=0xc000093fe0 pc=0x876701
created by runtime.gcenable
/usr/lib/go/src/runtime/mgc.go:179 +0xaa
rax 0xffffffffffffffda
rbx 0xffffffffffffffda
rcx 0x7faba5b53298
rdx 0x0
rdi 0x0
rsi 0xc0000d58f0
rbp 0xc0000d5930
rsp 0xc0000d58e8
r8 0x0
r9 0x7faba5b52f82
r10 0x0
r11 0x212
r12 0x48
r13 0x0
r14 0x0
r15 0x3
rip 0x7faba5b532dd
rflags 0x10202
cs 0x33
fs 0x0
gs 0x0 |
Thanks for the update. |
Every time I've tested today (around 10 times) it happens, I've got a breakpoint on the first statement in |
Does it happen without debugger as well? (from cli for example?) |
Also, can you share the dependencies used in that project? if it happens before main, I assume some |
doing But with |
Regarding the second point - {
"accept_invalid_certificates": false,
"feature": {
"network": {
"incoming": "mirror",
"outgoing": true
},
"fs": {
"mode": "read",
"read_only": ["/tmp/foo*+"]
},
"env": true
}
} Change |
Even with the |
Can you run |
I'll book a slot, but taking a quick look it'll probably be next week! SIGSEGV: segmentation violation
PC=0x7f9070b532dd m=0 sigcode=1
goroutine 1 [syscall, locked to thread]:
syscall.Syscall(0x7f90706a4108?, 0x10?, 0x544c760?, 0xc000040210?)
/usr/lib/go/src/syscall/syscall_linux.go:68 +0x27 fp=0xc0000aba30 sp=0xc0000ab9c0 pc=0x8c9407
internal/syscall/unix.IsNonblock(0xc0000aba88?)
/usr/lib/go/src/internal/syscall/unix/nonblocking.go:16 +0x2d fp=0xc0000aba60 sp=0xc0000aba30 pc=0x8e23cd
os.NewFile(0xc0000abad8?, {0x35fa10f, 0xa})
/usr/lib/go/src/os/file_unix.go:103 +0x28 fp=0xc0000aba98 sp=0xc0000aba60 pc=0x8f25e8
os.init()
/usr/lib/go/src/os/file.go:66 +0x1e5 fp=0xc0000abac0 sp=0xc0000aba98 pc=0x8f6645
runtime.doInit(0x535f500)
/usr/lib/go/src/runtime/proc.go:6329 +0x126 fp=0xc0000abbf0 sp=0xc0000abac0 pc=0x84a1c6
runtime.doInit(0x5359720)
/usr/lib/go/src/runtime/proc.go:6306 +0x71 fp=0xc0000abd20 sp=0xc0000abbf0 pc=0x84a111
runtime.doInit(0x535c900)
/usr/lib/go/src/runtime/proc.go:6306 +0x71 fp=0xc0000abe50 sp=0xc0000abd20 pc=0x84a111
runtime.doInit(0x536bc00)
/usr/lib/go/src/runtime/proc.go:6306 +0x71 fp=0xc0000abf80 sp=0xc0000abe50 pc=0x84a111
runtime.main()
/usr/lib/go/src/runtime/proc.go:233 +0x1d3 fp=0xc0000abfe0 sp=0xc0000abf80 pc=0x83cdd3
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000abfe8 sp=0xc0000abfe0 pc=0x86ee01
goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/usr/lib/go/src/runtime/proc.go:363 +0xd6 fp=0xc000098fb0 sp=0xc000098f90 pc=0x83d1d6
runtime.goparkunlock(...)
/usr/lib/go/src/runtime/proc.go:369
runtime.forcegchelper()
/usr/lib/go/src/runtime/proc.go:302 +0xad fp=0xc000098fe0 sp=0xc000098fb0 pc=0x83d06d
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000098fe8 sp=0xc000098fe0 pc=0x86ee01
created by runtime.init.6
/usr/lib/go/src/runtime/proc.go:290 +0x25
goroutine 3 [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/usr/lib/go/src/runtime/proc.go:363 +0xd6 fp=0xc000099790 sp=0xc000099770 pc=0x83d1d6
runtime.goparkunlock(...)
/usr/lib/go/src/runtime/proc.go:369
runtime.bgsweep(0x0?)
/usr/lib/go/src/runtime/mgcsweep.go:278 +0x8e fp=0xc0000997c8 sp=0xc000099790 pc=0x82792e
runtime.gcenable.func1()
/usr/lib/go/src/runtime/mgc.go:178 +0x26 fp=0xc0000997e0 sp=0xc0000997c8 pc=0x81c506
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000997e8 sp=0xc0000997e0 pc=0x86ee01
created by runtime.gcenable
/usr/lib/go/src/runtime/mgc.go:178 +0x6b
goroutine 4 [GC scavenge wait]:
runtime.gopark(0xc00005a070?, 0x39bce80?, 0x1?, 0x0?, 0x0?)
/usr/lib/go/src/runtime/proc.go:363 +0xd6 fp=0xc000099f70 sp=0xc000099f50 pc=0x83d1d6
runtime.goparkunlock(...)
/usr/lib/go/src/runtime/proc.go:369
runtime.(*scavengerState).park(0x544b960)
/usr/lib/go/src/runtime/mgcscavenge.go:389 +0x53 fp=0xc000099fa0 sp=0xc000099f70 pc=0x8259d3
runtime.bgscavenge(0x0?)
/usr/lib/go/src/runtime/mgcscavenge.go:617 +0x45 fp=0xc000099fc8 sp=0xc000099fa0 pc=0x825fa5
runtime.gcenable.func2()
/usr/lib/go/src/runtime/mgc.go:179 +0x26 fp=0xc000099fe0 sp=0xc000099fc8 pc=0x81c4a6
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000099fe8 sp=0xc000099fe0 pc=0x86ee01
created by runtime.gcenable
/usr/lib/go/src/runtime/mgc.go:179 +0xaa
rax 0xffffffffffffffda
rbx 0xffffffffffffffda
rcx 0x7f9070b53298
rdx 0x0
rdi 0x0
rsi 0xc0000ab970
rbp 0xc0000ab9b0
rsp 0xc0000ab968
r8 0x0
r9 0x7f9070b52f82
r10 0x0
r11 0x216
r12 0x48
r13 0x0
r14 0x0
r15 0x3
rip 0x7f9070b532dd
rflags 0x10206
cs 0x33
fs 0x0
gs 0x0 running pluglet-golang-zaza: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=dfddfb078c60ffbaac416b394e1cd02f7839b704, for GNU/Linux 4.4.0, with debug_info, not stripped |
Debugging this deeper, this is most likely a |
We managed to create a minimal reproducible example - this happens when importing specific modules. package main
import _ "rogchap.com/v8go"
import _ "go.kuoruan.net/v8go-polyfills"
import "fmt"
import "os"
func main() {
fmt.Println("asdsad")
} |
Update: Digging further, It seems that |
Fixed with #948 |
Bug Description
I've installed the
mirrord
vs code extension, running the following snippet allows me to hit a breakpoint set on the "Hello, world." line:package main
However, once I make it a HTTP server:
I never hit the breakpoint on the "Hello world" line, but I get this in VS Code's debug console:
Steps to Reproduce
mirrord
VS Code extensiongo mod init
and makemain.go
with following content:Backtrace
No response
Relevant Logs
No response
Your operating system and version
Arch Linux 6.0.11-arch1-1
Local process
dlv
Local process version
No response
Additional Info
No response
The text was updated successfully, but these errors were encountered: