-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Long pause when debugging a program Raylib or SDL on Linux #3906
Comments
I guess an example with Cgo is better because it doesn't need the binding libraries. Just install the raylib dev package package main
import (
"runtime"
"unsafe"
)
/*
#include <raylib.h>
#include <stdlib.h>
#cgo LDFLAGS: -lraylib
*/
import "C"
func InitWindow(width, height int, title string) {
ctitle := C.CString(title)
defer C.free(unsafe.Pointer(ctitle))
C.InitWindow((C.int)(width), (C.int)(height), ctitle)
}
func main() {
runtime.LockOSThread()
println("Before InitWindow")
InitWindow(800, 450, "raylib [core] example - basic window")
println("After InitWindow")
} |
I think it's just debuginfod-find downloading symbols, as a temporary workaround you can put a shell script called debuginfod-find in your PATH, before the real one, containing just:
|
Thanks, it works! I figured it was something with downloading debug symbols but forgot mention it. When writing C or C++ it also takes time but only once. |
You're right, even after it has downloaded the debug symbols it is still slow on the very first stop after the libraries are loaded. This is because the symbols for llvm are pretty large (over 1GB), this is going to be complicated to fix. |
Calls to debuginfod-find can take an arbitrarily long time to complete. Set timeouts for them unless they were explicitly set by user, also redirect its stderr to our stderr so that, if they produce progress output, it is seen. Updates go-delve#3906
How come there is no noticeable delay when debugging C with gdb? |
I imagine they are doing less preprocessing, possibly none. |
When stepping over, or setting a breakpoint after
InitWindow
the debugger pauses for about 15-30 seconds, depending on which computer I use. The dlv process consumes 5 GB of memory during the pause.Same thing happens with programs written in SDL or when writing a simple Cgo binding to Raylib myself. Both these libraries and my code do the
runtime.LockOSThread()
thing.The problem is partially fixed by debugging with Goland but only if I use the Flatpak install. With Goland Flatpak the debugger freezes the first run and then only occasionally. Unfortunately I can only run my SDL programs like this but Raylib, which defaults to using Wayland, doesn't work at all unless I switch to the .tar.gz istall. I had other issues with VS Code too so I am not surprised Flatpak is not suitable for development, except for it doesn't freeze as often...
I am guessing it has something to do with lots of shared libraries being loaded.
main.go
go.mod
The text was updated successfully, but these errors were encountered: