TIC-80 icon indicating copy to clipboard operation
TIC-80 copied to clipboard

[0.90 - linux] Tic-80 freezes the system when window focus is gained after a long time

Open ddelemeny opened this issue 3 years ago • 15 comments

(Hi there, long time no see)

Version : pro 4fdbdec OS: ubuntu 21.04

On focus gained, the process seems to be stuck in the event loop, leaving me no option other than to wait (sometimes a few minutes) or restart the computer.

ddelemeny avatar Jul 20 '21 20:07 ddelemeny

Hi, thank you for the report, will check it asap...

nesbox avatar Jul 21 '21 07:07 nesbox

Hi @nesbox, do you have any clue about what could cause this behavior ? It's making 0.90 quite unusable for me atm, I would be happy to try to fix it but the system-wide freezes make reproducing and bisecting the bug a bit... tedious.

ddelemeny avatar Jul 31 '21 08:07 ddelemeny

Hi, I still don't know the reason, we could try to downgrade the SDL to 2.0.11 as it was in 0.80 and check...

nesbox avatar Aug 02 '21 07:08 nesbox

I tried downgrading sdl to the release-2.0.12 tag (no tag for 2.0.11), still freezing.

Are you able to reproduce the bug ? I'd like to find a way to trigger this behavior more deterministically than "just wait until it f*cks up"

ddelemeny avatar Aug 02 '21 15:08 ddelemeny

Unfortunately I can't reproduce it but I suspect one commit. Could you pls try to check on this commit 352d0f6. Thank you.

nesbox avatar Aug 02 '21 16:08 nesbox

It seems to be way older than that. As of now, I can tell that 0.80 wasn't affected, and that c6d246e0d9 was. Still trying to narrow down the "not affected" side of the interval with more confidence, but that has to be the most tedious and frustrating bughunt I've done ever.

ddelemeny avatar Aug 02 '21 21:08 ddelemeny

We hope only for you :)

nesbox avatar Aug 03 '21 07:08 nesbox

From the commits remaining in the bisect interval, I'm suspecting one of d76902988ed0d0a73307dd0784db34e4dc9a304f (known bad) or 871f18aa78d76384f74b3dc3579c13c513b2bb37 (not tested yet) to have uncovered a weird driver-related issue. That would explain why I seem to be the only one affected and why it's affecting the whole system.

ddelemeny avatar Aug 03 '21 08:08 ddelemeny

Bisection finished, the result is that 871f18aa78d76384f74b3dc3579c13c513b2bb37 uncovered something nasty looming under the surface.

That driver-related issue hunch seems to be prolific indeed : at the other end of this rabbit hole there is a plethora of i915 related system freezes and GPU hangs, as the i915 driver seems to be a hot mess since the 5.1 kernel line came about (I'm on linux 5.11, ubuntu 21.04 on wayland).

Unfortunately, I'm not able to confirm my condition is of the same nature because nothing appears in the system logs.

So I'll start shooting in the dark.

ddelemeny avatar Aug 03 '21 10:08 ddelemeny

Great, now the question is, are you using the -DBUILD_SDLGPU=ON flag to build the app? Depending on your answer, the problem is caused by SDL2 lib or SDLGPU lib.

nesbox avatar Aug 03 '21 10:08 nesbox

Nope. Not using that flag.

ddelemeny avatar Aug 03 '21 11:08 ddelemeny

Could you pls enable BUILD_SDLGPU and try to reproduce it?

nesbox avatar Aug 03 '21 12:08 nesbox

Could you pls enable BUILD_SDLGPU and try to reproduce it?

I'll try that.

Another piece of the puzzle : switching from wayland to xorg seems to work without freezing.

ddelemeny avatar Aug 03 '21 12:08 ddelemeny

@ddelemeny is this still an issue?

aliceisjustplaying avatar May 02 '24 16:05 aliceisjustplaying

I haven't tinkered with TIC in a long time, maybe ask the community if anyone with the driver mentioned above has encountered any issues on wayland recently ? Anyway, closable issue on my end if nobody else wants to hunt this one.

ddelemeny avatar May 09 '24 02:05 ddelemeny