wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
10.07k stars 667 forks source link

No response to close button #643

Open IvDmNe opened 1 year ago

IvDmNe commented 1 year ago

Profiler GUI application does not respond to close button, stucking forever until Ctrl-C.

System: Ubuntu 20.04, 22.04 Version: v0.9, v0.10 Tried LEGACY = 0 and 1

Capstone v0.4.2 installed from sources in 20.04, installed via apt in 22.04.

I also tried to use it inside docker container, but the behavior is similar.

Did anyone have this issue?

wolfpld commented 10 months ago

This is handled either here:

https://github.com/wolfpld/tracy/blob/af73dba73ec90182e5484d3c67197c25fd1a833e/profiler/src/BackendGlfw.cpp#L139-L155

or here:

https://github.com/wolfpld/tracy/blob/af73dba73ec90182e5484d3c67197c25fd1a833e/profiler/src/BackendWayland.cpp#L750-L754

Use a debugger to verify that it works, and then, when the application is stuck, break with the debugger to see what it is waiting for.

IvDmNe commented 10 months ago

Thank you for response! I tracked down the reason: after pressing close button the updateThread still waits for update from the server.

https://github.com/wolfpld/tracy/blob/d62428c482845031e4ab633e6132dbc26cfe46ca/profiler/src/main.cpp#L320

In my case update server nereid.pl is unable (some inner filters in my company), so connect function stucks for a long time:

https://github.com/wolfpld/tracy/blob/d62428c482845031e4ab633e6132dbc26cfe46ca/public/common/TracySocket.cpp#L182

After 1-2 mins it finally fails and the application can be closed normally.

UPD: @wolfpld Do you think that it is worth to add small timeout (about 1-10 seconds) after creating of the socket to prevent long waiting?

wolfpld commented 3 weeks ago

Please don't ask questions in edits, these are not visible.

Changing the timeout to a small value doesn't fix the problem, only hides it. A proper solution is to abort the query, as the result won't be needed anyway.