fabiangreffrath / woof

Woof! is a continuation of the Boom/MBF bloodline of Doom source ports.
GNU General Public License v2.0
213 stars 36 forks source link

Intermittent crash when changing video modes. #382

Closed hackneyed-one closed 2 years ago

hackneyed-one commented 2 years ago

After confirming that the ENDOOM crash was resolved. I found I had another problem that same night but I've waited to report it until I knew more. I wanted to be thorough so I'm not wasting your time with a simple broken OS or something.

While playing a level for a minute or two, if I enter the menu and change resolution or sometimes widescreen mode Woof will crash and bomb out fairly regularly. Sometimes on the first try or after toggling it slowly a few times.

It crashes on my main Ubuntu-Mate 20.04.3 desktop but I could not replicate it in a VM with the same version OS. Thinking it might be a hardware/driver issue I swapped out my HDD to install 20.04.3 and then 21.10. I found the crash persists in both fresh OS installs on my real hardware.

Sorry I forgot to report the ENDOOM crash and longtics command here on the tracker instead of Doomworld. I've been so busy while also checking out Sprinkled-Doom and reporting issues (unrelated to my hardware!) in that forum topic I kind of forgot about the tracker. Thanks @rfomin ... So anyway I don't yet have a commit for when this issue may have started for me. I can try bisecting commits when I have more free time.

Here are some hardware info and backtrace

*-core description: Motherboard product: Z77N-WIFI vendor: Gigabyte Technology Co., Ltd. physical id: 0 version: x.x serial: To be filled by O.E.M. slot: To be filled by O.E.M.

*-cpu description: CPU product: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz vendor: Intel Corp. physical id: 43 bus info: cpu@0 version: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz slot: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz size: 3355MHz capacity: 3900MHz width: 64 bits clock: 100MHz

*-display description: VGA compatible controller product: Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] vendor: Advanced Micro Devices, Inc. [AMD/ATI] physical id: 0 bus info: pci@0000:01:00.0 version: cf width: 64 bits clock: 33MHz capabilities: pm pciexpress msi vga_controller bus_master cap_list rom configuration: driver=amdgpu latency=0 resources: irq:29 memory:e0000000-efffffff memory:f0000000-f01fffff ioport:e000(size=256) memory:f7e00000-f7e3ffff memory:c0000-dffff

Backtrace Old Ubuntu-Mate 20.04.03

P_SetupLevel: MAP01 (doom2.wad), Doom nodes Skill 4, Total 0:00:00 Demo Version 221 [Thread 0x7fffb97fa700 (LWP 8020) exited] [New Thread 0x7fffb97fa700 (LWP 8081)] [Thread 0x7fffb97fa700 (LWP 8081) exited] [New Thread 0x7fffb97fa700 (LWP 8083)] [Thread 0x7fffb97fa700 (LWP 8083) exited] [New Thread 0x7fffb97fa700 (LWP 8084)]

Thread 1 "woof" received signal SIGSEGV, Segmentation fault. 0x00007ffff7d8fdcf in ?? () from /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (gdb) bt

0 0x00007ffff7d8fdcf in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

1 0x000055555559e269 in I_FinishUpdate () at /home/andrew/Build-Doom/woof-atexit/Source/i_video.c:931

2 0x0000555555581d9c in D_Display () at /home/andrew/Build-Doom/woof-atexit/Source/d_main.c:344

3 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Doom/woof-atexit/Source/d_main.c:2379

4 0x0000555555598c3a in main (argc=6, argv=0x7fffffffdf08) at /home/andrew/Build-Doom/woof-atexit/Source/i_main.c:65

(gdb) q

Backtrace Fresh Ubuntu-Mate 20.04.03

P_SetupLevel: MAP01 (doom2.wad), Doom nodes Skill 3, Total 0:00:00 Demo Version 221 [Thread 0x7fff7bfff700 (LWP 14319) exited] [New Thread 0x7fff7bfff700 (LWP 14320)] --Type for more, q to quit, c to continue without paging--c

Thread 1 "woof" received signal SIGSEGV, Segmentation fault. 0x00007ffff7d9cdcf in ?? () from /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (gdb) bt

0 0x00007ffff7d9cdcf in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

1 0x000055555559e287 in I_FinishUpdate () at /home/andrew/Downloads/woof-master/Source/i_video.c:931

2 0x0000555555581d9c in D_Display () at /home/andrew/Downloads/woof-master/Source/d_main.c:344

3 0x0000555555585f36 in D_DoomMain () at /home/andrew/Downloads/woof-master/Source/d_main.c:2379

4 0x0000555555598c58 in main (argc=1, argv=0x7fffffffdf58) at /home/andrew/Downloads/woof-master/Source/i_main.c:65

(gdb) q

Backtrace Fresh Ubuntu-Mate 21.10 (this one is much longer?!)

P_SetupLevel: MAP07 (doom2.wad), Doom nodes Skill 3, Total 0:00:00 Demo Version 221 [Thread 0x7fff8f7fe640 (LWP 50961) exited] [New Thread 0x7fff8f7fe640 (LWP 50963)] malloc(): invalid size (unsorted)

Thread 1 "woof" received signal SIGABRT, Aborted. __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737320830976) at pthread_kill.c:44 44 pthread_kill.c: No such file or directory. (gdb) bt

0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737320830976)

at pthread_kill.c:44

1 __pthread_kill_internal (signo=6, threadid=140737320830976)

at pthread_kill.c:80

2 __GI___pthread_kill (threadid=140737320830976, signo=signo@entry=6)

at pthread_kill.c:91

3 0x00007ffff7aec476 in __GI_raise (sig=sig@entry=6)

at ../sysdeps/posix/raise.c:26

4 0x00007ffff7ad27b7 in __GI_abort () at abort.c:79

5 0x00007ffff7b335e6 in __libc_message

(action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7c8513d "%s\n")
at ../sysdeps/posix/libc_fatal.c:155

6 0x00007ffff7b4aadc in malloc_printerr

(str=str@entry=0x7ffff7c881d0 "malloc(): invalid size (unsorted)")
at malloc.c:5543

7 0x00007ffff7b4d97c in _int_malloc

(av=av@entry=0x7ffff7cbec60 <main_arena>, bytes=bytes@entry=1056)
at malloc.c:3889

8 0x00007ffff7b4fcfe in __libc_calloc

(n=<optimised out>, elem_size=<optimised out>) at malloc.c:3566

9 0x00007fffca420d39 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

10 0x00007fffca422a10 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

11 0x00007fffc9cef5d7 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

--Type for more, q to quit, c to continue without paging--c

12 0x00007fffc9e906c4 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

13 0x00007fffc9e92c8c in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

14 0x00007fffc9e92d79 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

15 0x00007ffff7d87c31 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

16 0x00007ffff7d819c2 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

17 0x000055555559ebb4 in I_FinishUpdate () at /home/andrew/Downloads/woof-master/Source/i_video.c:933

18 0x0000555555581f8b in D_Display () at /home/andrew/Downloads/woof-master/Source/d_main.c:344

19 0x00005555555862d6 in D_DoomMain () at /home/andrew/Downloads/woof-master/Source/d_main.c:2379

20 0x0000555555599450 in main (argc=1, argv=0x7fffffffdf58) at /home/andrew/Downloads/woof-master/Source/i_main.c:65

(gdb) q

END

rfomin commented 2 years ago

Sorry I forgot to report the ENDOOM crash and longtics command here on the tracker instead of Doomworld.

I think it's okay to only report bugs on the forum. Thanks for testing!

As far as this issue is concerned, I cannot reproduce it on Windows. I think we haven't changed I_ResetScreen for a long time.

fabiangreffrath commented 2 years ago

Thanks for the report! In Crispy, I have a safety net called post_rendering_hook to avoid racing conditions like this one, i.e. a mismatch of screen dimensions during the I_FinishUpdate() call. I don't think we can apply the exact same here, because the responsible variables are already changed in the menu itself.

But we already have the changeres variable. Maybe we should check if it is true at the beginning of I_FinishUpdate() and reset it to false and return early, instead of resetting it to false immediately after I_InitGraphicsMode() in I_ResetScreen().

fabiangreffrath commented 2 years ago

And, BTW, I cannot reproduce this on Debian unstable, so it might be driver or generally rendering stack related.

hackneyed-one commented 2 years ago

I tried the changeres branch and it crashed first try. On the other hand the 8.1.0 release wouldn't crash even if I was mashing Enter like a quick time event! So I began narrowing down commits skipping back and forth until I found...

use basetic for realtics calculation to compensate pause woof-2d0e18f829cd563ef5e1bb90a3cc8320e3401334

The one before it and a couple others don't crash but it and a few after do.

EDIT: It's kind of cool. Out of 37 changes since 8.1.0 I managed to narrow it down in only 6 compiles. :D

EDIT2: Yep, I manually reverted the single line change from that commit in the current master and it's not crashing.

fabiangreffrath commented 2 years ago

Strange, that commit appears completely unrelated.

Also, I hope you know about https://git-scm.com/docs/git-bisect ?

fabiangreffrath commented 2 years ago

Does it make a difference if you initialize basetic = 0 in g_game.c?

fabiangreffrath commented 2 years ago

Also, I guess it crashes with a different backtrace now, does it?

rfomin commented 2 years ago

That commit is wrong anyway since complevel boom resets basetic in G_DoLoadLevel. I think we should revert interpolation "fix".

fabiangreffrath commented 2 years ago

My guess is that it crashes at the title screen already?

hackneyed-one commented 2 years ago

Strange, that commit appears completely unrelated.

Also, I hope you know about https://git-scm.com/docs/git-bisect ?

Unrelated maybe but I was able to make the previously working woof-9468d7614af0dbce464c5839022b7b5caa15cf7b from Dec 6th crash by applying that new line to the older source. That one line seems to make all the difference.

Thanks I didn't know about git-bisect.

EDIT: geez it's after midnight here. Goodnight!

PHONE EDIT: Sorry I didn't really understand your other post. How do I initialize something?

Son's room edit: My son is awake now and so am I still. Do I just change a line to basetic = 0? I thought initialize would be = 1 for on 0 for off?

fabiangreffrath commented 2 years ago

PHONE EDIT: Sorry I didn't really understand your other post. How do I initialize something?

You would just replace int basetic; with int basetic = 0; in g_game.c. But according to @rfomin this part of the code is flawed anyway.

What would be more interesting for me is a backtrace of the crash from the "changeres" branch.

hackneyed-one commented 2 years ago

I made a backtrace from the changeres branch and saved it in my notes but I didn't include it because I didn't see much difference. Maybe I was wrong?

This happened on the first res switch. From my notes.

P_SetupLevel: MAP07 (doom2.wad), Doom nodes Skill 3, Total 0:00:00 Demo Version 221 [Thread 0x7fff7bfff700 (LWP 20787) exited] [New Thread 0x7fff7bfff700 (LWP 20828)]

Thread 1 "woof" received signal SIGSEGV, Segmentation fault. __GI___libc_free (mem=0x8f8f0e0eececeeee) at malloc.c:3102 3102 malloc.c: No such file or directory. (gdb) bt

0 __GI___libc_free (mem=0x8f8f0e0eececeeee) at malloc.c:3102

1 0x00007ffff7d59533 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

2 0x00007ffff7d8d74a in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

3 0x00007ffff7d8d79d in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

4 0x00007ffff7d8fddf in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

5 0x000055555559e2a1 in I_FinishUpdate () at /home/andrew/Build-Doom/woof-changeres/Source/i_video.c:940

6 0x0000555555581d9c in D_Display () at /home/andrew/Build-Doom/woof-changeres/Source/d_main.c:344

7 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Doom/woof-changeres/Source/d_main.c:2379

8 0x0000555555598c58 in main (argc=1, argv=0x7fffffffdf18) at /home/andrew/Build-Doom/woof-changeres/Source/i_main.c:65

(gdb)

Here is another one from just now but it took 14 res switches to crash. Score 1 for intermittency.

Thread 1 "woof" received signal SIGSEGV, Segmentation fault. unlink_chunk (p=p@entry=0x555557565160, av=0x7ffff7c8db80 ) at malloc.c:1466 1466 malloc.c: No such file or directory. (gdb) bt

0 unlink_chunk (p=p@entry=0x555557565160, av=0x7ffff7c8db80 ) at malloc.c:1466

1 0x00007ffff7b3c00b in _int_free (av=0x7ffff7c8db80 , p=0x5555575650d0, have_lock=) at malloc.c:4342

2 0x00007fffca12f397 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

3 0x00007fffc9f3df61 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

4 0x00007fffc9f3e071 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

5 0x00007fffc9f36ce1 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

6 0x00007ffff7d3f636 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

7 0x00007ffff7d3c8ce in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

8 0x000055555559f519 in I_InitGraphicsMode () at /home/andrew/Build-Doom/woof-changeres/Source/i_video.c:1458

9 0x000055555559f959 in I_ResetScreen () at /home/andrew/Build-Doom/woof-changeres/Source/i_video.c:1623

10 0x00005555555a8906 in M_Responder (ev=0x555555756174 <events+660>) at /home/andrew/Build-Doom/woof-changeres/Source/m_menu.c:5060

11 0x0000555555581941 in D_ProcessEvents () at /home/andrew/Build-Doom/woof-changeres/Source/d_main.c:207

12 0x0000555555585fed in BuildNewTic () at /home/andrew/Build-Doom/woof-changeres/Source/d_loop.c:151

13 0x00005555555861f3 in NetUpdate () at /home/andrew/Build-Doom/woof-changeres/Source/d_loop.c:248

14 0x00005555555f1af9 in R_RenderPlayerView (player=0x555555756880 ) at /home/andrew/Build-Doom/woof-changeres/Source/r_main.c:691

15 0x0000555555581b91 in D_Display () at /home/andrew/Build-Doom/woof-changeres/Source/d_main.c:284

16 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Doom/woof-changeres/Source/d_main.c:2379

17 0x0000555555598c58 in main (argc=1, argv=0x7fffffffdf48) at /home/andrew/Build-Doom/woof-changeres/Source/i_main.c:65

EDIT: 24 res changes. it so small and cute! heh

Thread 1 "woof" received signal SIGSEGV, Segmentation fault. 0x00007fffc9f69fe2 in ?? () from /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so (gdb) bt

0 0x00007fffc9f69fe2 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so

1 0x00007ffff7d3c2db in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

2 0x00007ffff7d345bf in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0

3 0x000055555559e2ca in I_FinishUpdate () at /home/andrew/Build-Doom/woof-changeres/Source/i_video.c:942

4 0x0000555555581d9c in D_Display () at /home/andrew/Build-Doom/woof-changeres/Source/d_main.c:344

5 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Doom/woof-changeres/Source/d_main.c:2379

6 0x0000555555598c58 in main (argc=1, argv=0x7fffffffdf48) at /home/andrew/Build-Doom/woof-changeres/Source/i_main.c:65

hackneyed-one commented 2 years ago

PHONE EDIT: Sorry I didn't really understand your other post. How do I initialize something?

You would just replace int basetic; with int basetic = 0; in g_game.c. But according to @rfomin this part of the code is flawed anyway.

What would be more interesting for me is a backtrace of the crash from the "changeres" branch.

Just for completeness I tried this in the master branch. I changed Line 111 to read "int basetic = 0; // killough 9/29/98: for demo sync" is that right?

<!DOCTYPE html>

Click for Spoiler [Thread 0x7fff7bfff700 (LWP 75315) exited] [New Thread 0x7fff7bfff700 (LWP 75316)] --Type for more, q to quit, c to continue without paging--c Thread 1 "woof" received signal SIGSEGV, Segmentation fault. __GI___libc_free (mem=0x9b9b9c9b9a9a9a9a) at malloc.c:3102 3102 malloc.c: No such file or directory. (gdb) bt #0 __GI___libc_free (mem=0x9b9b9c9b9a9a9a9a) at malloc.c:3102 #1 0x00007ffff7d59533 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #2 0x00007ffff7d8d74a in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #3 0x00007ffff7d8d79d in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #4 0x00007ffff7d8fddf in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #5 0x000055555559e287 in I_FinishUpdate () at /home/andrew/Build-Doom/woof-master/Source/i_video.c:931 #6 0x0000555555581d9c in D_Display () at /home/andrew/Build-Doom/woof-master/Source/d_main.c:344 #7 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Doom/woof-master/Source/d_main.c:2379 #8 0x0000555555598c58 in main (argc=1, argv=0x7fffffffdf18) at /home/andrew/Build-Doom/woof-master/Source/i_main.c:65 (gdb) q

hackneyed-one commented 2 years ago

I was able to try the latest woof-master on my HTPC and it also crashes. This means I have 2 completely different machines exhibiting the same problem. My Desktop and HTPC are both running Ubuntu-Mate 20.04.3 but they have different gen Intel CPU and different gen AMD GPU (with a different the same driver?). Remember I also tried Ubuntu-Mate 21.10 on my Desktop and it crashes as well. Maybe I can try a recent Debian or even Manjaro on my desktop to see if it is an Ubuntu issue. Let me know because I have a spare HDD in a hotswap bay so I can just leave the installer over night and test the next day.

Also, I can make some time later to try other branches on my HTPC if you want but once again I manually reverted "use basetic for realtics calculation to compensate pause" and after compiling I wasn't able to make it crash anymore on the HTPC or Desktop.

P.S. So much work and care is put into these Doom engines by you all and those in the community and I get so much enjoyment from that work that I feel the least I can do is bug report and test, test, test etc. Thanks! :)

<!DOCTYPE html>

Click for HTPC bt and hw info [Thread 0x7fff9edfd700 (LWP 21635) exited] [New Thread 0x7fff9edfd700 (LWP 21636)] --Type for more, q to quit, c to continue without paging--c Thread 1 "woof" received signal SIGSEGV, Segmentation fault. unlink_chunk (p=p@entry=0x5555570abac0, av=0x7ffff7c90b80 ) at malloc.c:1466 1466 malloc.c: No such file or directory. (gdb) bt #0 unlink_chunk (p=p@entry=0x5555570abac0, av=0x7ffff7c90b80 ) at malloc.c:1466 #1 0x00007ffff7b40773 in _int_malloc (av=av@entry=0x7ffff7c90b80 , bytes=bytes@entry=145416) at malloc.c:4041 #2 0x00007ffff7b43d15 in __libc_calloc (n=, elem_size=) at malloc.c:3428 #3 0x00007fffca36356c in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #4 0x00007fffca36625e in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #5 0x00007fffca366b74 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #6 0x00007fffca96a366 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #7 0x00007fffca96ca2d in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #8 0x00007fffca96d832 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #9 0x00007fffca65eade in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #10 0x00007fffca975323 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #11 0x00007fffca97691b in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #12 0x00007fffca976ce1 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #13 0x00007fffca9779b8 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #14 0x00007fffc9dad9ad in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #15 0x00007fffc9d53c3f in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #16 0x00007fffe03e5e27 in glPrimitiveBoundingBox () at /lib/x86_64-linux-gnu/libGLX_mesa.so.0 #17 0x00007fffe03d8965 in () at /lib/x86_64-linux-gnu/libGLX_mesa.so.0 #18 0x00007ffff7dc7307 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #19 0x000055555559e2ee in I_FinishUpdate () at /home/andrew/Build-Doom/woof-master/Source/i_video.c:937 #20 0x0000555555581d9c in D_Display () at /home/andrew/Build-Doom/woof-master/Source/d_main.c:344 #21 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Doom/woof-master/Source/d_main.c:2379 #22 0x0000555555598c58 in main (argc=1, argv=0x7fffffffddd8) at /home/andrew/Build-Doom/woof-master/Source/i_main.c:65 (gdb) Some Hardware Info gamebox-9020 description: Space-saving Computer product: OptiPlex 9020 (OptiPlex 9020) vendor: Dell Inc. version: 01 serial: B0FV622 width: 64 bits capabilities: smbios-2.7 dmi-2.7 smp vsyscall32 configuration: administrator_password=disabled boot=normal chassis=space-saving frontpanel_password=disabled keyboard_password=disabled power-on_password=disabled sku=OptiPlex 9020 -core description: Motherboard product: 00V62H vendor: Dell Inc. physical id: 0 version: A00 -cpu description: CPU product: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz vendor: Intel Corp. physical id: 3a bus info: cpu@0 version: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz slot: SOCKET 0 size: 3459MHz capacity: 3800MHz width: 64 bits clock: 100MHz capabilities: lm fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp x86-64 constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d cpufreq configuration: cores=4 enabledcores=4 threads=4 -display description: VGA compatible controller product: Baffin [Radeon RX 550 640SP / RX 560/560X] vendor: Advanced Micro Devices, Inc. [AMD/ATI] physical id: 0 bus info: pci@0000:01:00.0 version: ff width: 64 bits clock: 33MHz capabilities: pm pciexpress msi vga_controller bus_master cap_list rom configuration: driver=amdgpu latency=0 resources: irq:29 memory:e0000000-efffffff memory:f0000000-f01fffff ioport:e000(size=256) memory:f7e00000-f7e3ffff memory:c0000-dffff

END

fabiangreffrath commented 2 years ago

I still cannot reproduce this issue on Debian unstable for the heck of it. I select the "High Resolution" item in the menu and literally keep my finger on the Enter key for a minute, triggering hundreds of video resets and nothing happens. Also, reportedly it doesn't crash on Windows. Thus, I don't think that a logic error is the culprit, i.e. there is no bug in our code but elsewhere.

Then, the line of code that you @hackneyed-one identified as the culprit is responsible for returning early out of TryRunTics(), which in turn is the code path that runs M_Responder() (through NetUpdate() --> BuildNewTic() --> D_ProcessEvents() --> M_Responder()). In M_Responder() the I_ResetScreen() function is called whenever e.g. the "High Resolution" feature is toggled.

So, I assume this to be a timing issue, as in "the renderer is not yet ready when returning from I_ResetScreen()" -- although this strictly doesn't make any sense. Anyway, @hackneyed-one could you please add this single line to the I_InitGraphicsMode() function on the master branch and try again?

--- a/Source/i_video.c
+++ b/Source/i_video.c
@@ -1564,6 +1564,8 @@ static void I_InitGraphicsMode(void)

    I_InitDiskFlash();        // Initialize disk icon   
    I_SetPalette(W_CacheLumpName("PLAYPAL",PU_CACHE));
+
+   if (changeres) I_Sleep(50);
 }

 void I_QuitVideo (int phase)
fabiangreffrath commented 2 years ago

If this doesn't work, here is another alternative approach: We let the renderer finish the last frame it was supposed to draw before destroying it. If this won't do it I am out of ideas for today...

--- a/Source/i_video.c
+++ b/Source/i_video.c
@@ -1449,6 +1449,7 @@ static void I_InitGraphicsMode(void)

    if (renderer != NULL)
    {
+      SDL_RenderPresent(renderer);
       SDL_DestroyRenderer(renderer);
       texture = NULL;
    }
rfomin commented 2 years ago

I select the "High Resolution" item in the menu and literally keep my finger on the Enter key for a minute, triggering hundreds of video resets and nothing happens.

I've done that for widescreen mode, windowed/fullscreen toggle, etc on Windows 7/10 - works fine. Interesting that @hackneyed-one turns off vsync. Maybe realtics method is not good when vsync is off on some drivers/hardware. Interesting that PrBoom+ has guards and tries not to update buffers too fast.

fabiangreffrath commented 2 years ago

Interesting that @hackneyed-one turns off vsync.

Yep, this supports the theory of an underlying timing problem, because vsync doesn't update immediately but waits for the next screen refresh.

Interesting that PrBoom+ has guards and tries not to update buffers too fast.

Oh, really! I'll have to look at this...

rfomin commented 2 years ago

Oh, really! I'll have to look at this...

For example this: https://github.com/coelckers/prboom-plus/blob/11c8550635737d942813fecfb9438994e9e9a32d/prboom2/src/d_main.c#L293-L294

There is also isExtraDDisplay variable.

fabiangreffrath commented 2 years ago

BTW, can we make sure we are not in a wiping sequence when this happens?

rfomin commented 2 years ago

I don't know, I suggest just reverting new_sync interpolation "fix". It works fine before in Crispy/Woof.

fabiangreffrath commented 2 years ago

Sure, and we will do that. I'd just like to get to the root cause of this issue, which has merely been brought to light by this unrelated change.

hackneyed-one commented 2 years ago

Still no good. :(

In general it does feel like it takes longer playing a map or that I have to spam the enter key when vsync is on to trigger it however it still randomly crashes out of the blue either way.

Anyway, on to today's testing...

Earlier today I installed Manjaro on my Desktop with a spare HDD and it crashes there too. I had to install woof-git from the AUR because of some SDL linking issue. I disabled vsync for consistency.

Back on Ubuntu tonight I've tried adding "if (changeres) I_Sleep(50);" and it crashes. I tried adding "SDL_RenderPresent(renderer);" in a separate copy and it crashes. Finally I applied both to the same compile and it crashes.

I don't know if it still helps but...

<!DOCTYPE html>

Click here for way too many backtraces? Interestingly the first crash often produces a longer bt and subsequent crashes are often shorter. 1st Manjaro [Thread 0x7fff8f7fe640 (LWP 10238) exited] [New Thread 0x7fff8f7fe640 (LWP 10239)] Thread 1 "woof" received signal SIGSEGV, Segmentation fault. 0x00007ffff7b0d77f in unlink_chunk.constprop () from /usr/lib/libc.so.6 (gdb) bt #0 0x00007ffff7b0d77f in unlink_chunk.constprop () from /usr/lib/libc.so.6 #1 0x00007ffff7b1027a in _int_malloc () from /usr/lib/libc.so.6 #2 0x00007ffff7b12175 in calloc () from /usr/lib/libc.so.6 #3 0x00007fffcabbad23 in ?? () from /usr/lib/dri/radeonsi_dri.so #4 0x00007fffcb65a804 in ?? () from /usr/lib/dri/radeonsi_dri.so #5 0x00007fffcb146fa2 in ?? () from /usr/lib/dri/radeonsi_dri.so #6 0x00007fffcb1519c2 in ?? () from /usr/lib/dri/radeonsi_dri.so #7 0x00007fffcb15254b in ?? () from /usr/lib/dri/radeonsi_dri.so #8 0x00007fffcae68c1c in ?? () from /usr/lib/dri/radeonsi_dri.so #9 0x00007fffcabb57b3 in ?? () from /usr/lib/dri/radeonsi_dri.so #10 0x00007fffcabb6432 in ?? () from /usr/lib/dri/radeonsi_dri.so #11 0x00007fffcb5e95d3 in ?? () from /usr/lib/dri/radeonsi_dri.so #12 0x00007fffcabc7068 in ?? () from /usr/lib/dri/radeonsi_dri.so #13 0x00007fffca722e84 in ?? () from /usr/lib/dri/radeonsi_dri.so #14 0x00007fffca6bc1e1 in ?? () from /usr/lib/dri/radeonsi_dri.so #15 0x00007fffe11dfc3c in ?? () from /usr/lib/libGLX_mesa.so.0 #16 0x00007ffff7d9e0c3 in ?? () from /usr/lib/libSDL2-2.0.so.0 #17 0x00005555555951e8 in ?? () #18 0x0000555555582045 in ?? () #19 0x0000555555576cbc in ?? () #20 0x00007ffff7aadb25 in __libc_start_main () from /usr/lib/libc.so.6 #21 0x0000555555576cfe in ?? () 2nd Manjaro P_SetupLevel: MAP07 (doom2.wad), Doom nodes Skill 2, Total 0:00:00 Demo Version 221 [Thread 0x7fff8f7fe640 (LWP 10476) exited] [New Thread 0x7fff8f7fe640 (LWP 10477)] [Thread 0x7fff8f7fe640 (LWP 10477) exited] [New Thread 0x7fff8f7fe640 (LWP 10478)] Thread 1 "woof" received signal SIGSEGV, Segmentation fault. 0x00007ffff7b0fe6f in _int_malloc () from /usr/lib/libc.so.6 (gdb) bt #0 0x00007ffff7b0fe6f in _int_malloc () from /usr/lib/libc.so.6 #1 0x00007ffff7b12175 in calloc () from /usr/lib/libc.so.6 #2 0x00007fffcae4720a in ?? () from /usr/lib/dri/radeonsi_dri.so #3 0x00007fffcae48ed0 in ?? () from /usr/lib/dri/radeonsi_dri.so #4 0x00007fffca71cc27 in ?? () from /usr/lib/dri/radeonsi_dri.so #5 0x00007fffca8b9694 in ?? () from /usr/lib/dri/radeonsi_dri.so #6 0x00007fffca8bcf79 in ?? () from /usr/lib/dri/radeonsi_dri.so #7 0x00007fffca8bd065 in ?? () from /usr/lib/dri/radeonsi_dri.so #8 0x00007ffff7cfd7a9 in ?? () from /usr/lib/libSDL2-2.0.so.0 #9 0x00007ffff7cf5609 in ?? () from /usr/lib/libSDL2-2.0.so.0 #10 0x00005555555951b9 in ?? () #11 0x0000555555582045 in ?? () #12 0x0000555555576cbc in ?? () #13 0x00007ffff7aadb25 in __libc_start_main () from /usr/lib/libc.so.6 #14 0x0000555555576cfe in ?? () (gdb) 1st woof-master-I_InitGraphicsMode [Thread 0x7fff94df9700 (LWP 7188) exited] [New Thread 0x7fff94df9700 (LWP 7189)] malloc(): invalid size (unsorted) --Type for more, q to quit, c to continue without paging--c Thread 1 "woof" received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff7ac7859 in __GI_abort () at abort.c:79 #2 0x00007ffff7b323ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7c5c285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155 #3 0x00007ffff7b3a47c in malloc_printerr (str=str@entry=0x7ffff7c5ea50 "malloc(): invalid size (unsorted)") at malloc.c:5347 #4 0x00007ffff7b3d234 in _int_malloc (av=av@entry=0x7ffff7c8db80 , bytes=bytes@entry=16) at malloc.c:3736 #5 0x00007ffff7b3f419 in __GI___libc_malloc (bytes=16) at malloc.c:3066 #6 0x00007ffff6f843a6 in () at /lib/x86_64-linux-gnu/libxcb.so.1 #7 0x00007ffff6f84958 in () at /lib/x86_64-linux-gnu/libxcb.so.1 #8 0x00007ffff784d56e in () at /lib/x86_64-linux-gnu/libX11.so.6 #9 0x00007ffff784d6ed in () at /lib/x86_64-linux-gnu/libX11.so.6 #10 0x00007ffff784d9ea in _XEventsQueued () at /lib/x86_64-linux-gnu/libX11.so.6 #11 0x00007ffff782ecce in XFlush () at /lib/x86_64-linux-gnu/libX11.so.6 #12 0x00007ffff7dbd742 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #13 0x00007ffff7d2362b in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #14 0x000055555559dcd8 in I_GetEvent () at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/i_video.c:708 #15 0x000055555559df09 in I_StartTic () at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/i_video.c:823 #16 0x0000555555585fe8 in BuildNewTic () at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/d_loop.c:150 #17 0x00005555555861f3 in NetUpdate () at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/d_loop.c:248 #18 0x00005555555f1b29 in R_RenderPlayerView (player=0x555555756880 ) at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/r_main.c:701 #19 0x0000555555581b91 in D_Display () at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/d_main.c:284 #20 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/d_main.c:2379 #21 0x0000555555598c58 in main (argc=1, argv=0x7fffffffded8) at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/i_main.c:65 (gdb) 2nd woof-master-I_InitGraphicsMode [Thread 0x7fff7bfff700 (LWP 7284) exited] [New Thread 0x7fff7bfff700 (LWP 7285)] Thread 1 "woof" received signal SIGSEGV, Segmentation fault. 0x00007ffff7d8d7b1 in ?? () from /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (gdb) bt #0 0x00007ffff7d8d7b1 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #1 0x00007ffff7d8fddf in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #2 0x000055555559e287 in I_FinishUpdate () at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/i_video.c:931 #3 0x0000555555581d9c in D_Display () at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/d_main.c:344 #4 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/d_main.c:2379 #5 0x0000555555598c58 in main (argc=1, argv=0x7fffffffded8) at /home/andrew/Build-Test/woof-master-I_InitGraphicsMode/Source/i_main.c:65 (gdb) 1st SDL_RenderPresent [Thread 0x7fff7bfff700 (LWP 7455) exited] [New Thread 0x7fff7bfff700 (LWP 7456)] corrupted double-linked list --Type for more, q to quit, c to continue without paging--q Quit (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff7ac7859 in __GI_abort () at abort.c:79 #2 0x00007ffff7b323ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7c5c285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155 #3 0x00007ffff7b3a47c in malloc_printerr (str=str@entry=0x7ffff7c5a457 "corrupted double-linked list") at malloc.c:5347 #4 0x00007ffff7b3aacc in unlink_chunk (p=p@entry=0x555557590360, av=0x7ffff7c8db80 ) at malloc.c:1460 #5 0x00007ffff7b3d773 in _int_malloc (av=av@entry=0x7ffff7c8db80 , bytes=bytes@entry=145416) at malloc.c:4041 #6 0x00007ffff7b40d15 in __libc_calloc (n=, elem_size=) at malloc.c:3428 #7 0x00007fffca36271c in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #8 0x00007fffca36540e in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #9 0x00007fffca365d24 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #10 0x00007fffca9695a6 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #11 0x00007fffca96bc6d in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #12 0x00007fffca96ca72 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #13 0x00007fffca65dc3e in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #14 0x00007fffca974563 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #15 0x00007fffca975b5b in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #16 0x00007fffca975f21 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #17 0x00007fffca976bf8 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #18 0x00007fffc9dac9ad in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #19 0x00007fffc9d52c3f in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #20 0x00007fffe03d7e27 in glPrimitiveBoundingBox () at /lib/x86_64-linux-gnu/libGLX_mesa.so.0 #21 0x00007fffe03ca965 in () at /lib/x86_64-linux-gnu/libGLX_mesa.so.0 #22 0x00007ffff7dc4307 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #23 0x000055555559e2ee in I_FinishUpdate () at /home/andrew/Build-Test/woof-master-SDL_RenderPresent/Source/i_video.c:937 #24 0x0000555555581d9c in D_Display () at /home/andrew/Build-Test/woof-master-SDL_RenderPresent/Source/d_main.c:344 #25 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Test/woof-master-SDL_RenderPresent/Source/d_main.c:2379 #26 0x0000555555598c58 in main (argc=1, argv=0x7fffffffded8) at /home/andrew/Build-Test/woof-master-SDL_RenderPresent/Source/i_main.c:65 (gdb) q 2nd SDL_RenderPresent Thread 0x7fff7bfff700 (LWP 7497) exited] [New Thread 0x7fff7bfff700 (LWP 7498)] Thread 1 "woof" received signal SIGSEGV, Segmentation fault. 0x00007ffff7d8fdcf in ?? () from /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (gdb) bt #0 0x00007ffff7d8fdcf in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #1 0x000055555559e287 in I_FinishUpdate () at /home/andrew/Build-Test/woof-master-SDL_RenderPresent/Source/i_video.c:931 #2 0x0000555555581d9c in D_Display () at /home/andrew/Build-Test/woof-master-SDL_RenderPresent/Source/d_main.c:344 #3 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Test/woof-master-SDL_RenderPresent/Source/d_main.c:2379 #4 0x0000555555598c58 in main (argc=1, argv=0x7fffffffded8) at /home/andrew/Build-Test/woof-master-SDL_RenderPresent/Source/i_main.c:65 (gdb) q 1st woof-master-both [Thread 0x7fff7ffff700 (LWP 9895) exited] [New Thread 0x7fff7ffff700 (LWP 9911)] --Type for more, q to quit, c to continue without paging--c Thread 1 "woof" received signal SIGSEGV, Segmentation fault. unlink_chunk (p=p@entry=0x55555758ab60, av=0x7ffff7c8db80 ) at malloc.c:1466 1466 malloc.c: No such file or directory. (gdb) bt #0 unlink_chunk (p=p@entry=0x55555758ab60, av=0x7ffff7c8db80 ) at malloc.c:1466 #1 0x00007ffff7b3d773 in _int_malloc (av=av@entry=0x7ffff7c8db80 , bytes=bytes@entry=145416) at malloc.c:4041 #2 0x00007ffff7b40d15 in __libc_calloc (n=, elem_size=) at malloc.c:3428 #3 0x00007fffca36271c in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #4 0x00007fffca36540e in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #5 0x00007fffca365d24 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #6 0x00007fffca9695a6 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #7 0x00007fffca96bc6d in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #8 0x00007fffca96ca72 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #9 0x00007fffca65dc3e in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #10 0x00007fffca974563 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #11 0x00007fffca975b5b in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #12 0x00007fffca975f21 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #13 0x00007fffca976bf8 in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #14 0x00007fffc9dac9ad in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #15 0x00007fffc9d52c3f in () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so #16 0x00007fffe03d7e27 in glPrimitiveBoundingBox () at /lib/x86_64-linux-gnu/libGLX_mesa.so.0 #17 0x00007fffe03ca965 in () at /lib/x86_64-linux-gnu/libGLX_mesa.so.0 #18 0x00007ffff7dc4307 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #19 0x000055555559e2ee in I_FinishUpdate () at /home/andrew/Build-Test/woof-master-both/Source/i_video.c:937 #20 0x0000555555581d9c in D_Display () at /home/andrew/Build-Test/woof-master-both/Source/d_main.c:344 #21 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Test/woof-master-both/Source/d_main.c:2379 #22 0x0000555555598c58 in main (argc=1, argv=0x7fffffffdf08) at /home/andrew/Build-Test/woof-master-both/Source/i_main.c:65 (gdb) q 2nd woof-master-both P_SetupLevel: MAP07 (doom2.wad), Doom nodes Skill 3, Total 0:00:00 Demo Version 221 [Thread 0x7fff7bfff700 (LWP 10314) exited] [New Thread 0x7fff7bfff700 (LWP 10318)] [Thread 0x7fff7bfff700 (LWP 10318) exited] [New Thread 0x7fff7bfff700 (LWP 10319)] [Thread 0x7fff7bfff700 (LWP 10319) exited] [New Thread 0x7fff7bfff700 (LWP 10320)] Thread 1 "woof" received signal SIGSEGV, Segmentation fault. 0x00007ffff7d8fdcf in ?? () from /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (gdb) bt #0 0x00007ffff7d8fdcf in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #1 0x000055555559e287 in I_FinishUpdate () at /home/andrew/Build-Test/woof-master-both/Source/i_video.c:931 #2 0x0000555555581d9c in D_Display () at /home/andrew/Build-Test/woof-master-both/Source/d_main.c:344 #3 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Test/woof-master-both/Source/d_main.c:2379 #4 0x0000555555598c58 in main (argc=1, argv=0x7fffffffdf08) at /home/andrew/Build-Test/woof-master-both/Source/i_main.c:65 (gdb)

fabiangreffrath commented 2 years ago

Thank you very much for your additional checks! I am sorry to bother you, but there is still some things I'd like to find out before throwing the towel. I remember from #372 that your renderer (apparently an issue with the radeonsi_dri driver) does not like to get destroyed and recreated. Therefor, I believe that the "keep_renderer" branch is closest to the solution. Would you please check this out and apply the I_Sleep(50) patch there?

hackneyed-one commented 2 years ago

No worries! Like I said before, you all do so much work for the game and users. Fixing bugs and listening to feature requests. If I can help you improve it for myself and others then its the least I can do. I kind of feel like I'm just spamming you with backtraces at this point but its no problem for me.

I downloaded the latest woof-keep_renderer from commit f4ca35f that you just made and applied the I_Sleep(50) change but it still crashes. :(

As a sort of control I tried again but this time running gdb with the Woof I already have installed on my system from over a week ago. Vsync is disabled, I loaded a map like normal and just held down the Enter key like you mentioned before. I held it down for over 5 minutes while I watched a video on my phone to pass/keep the time and old Woof did not crash. Whatever the issue is, if it was there before last week it was pretty well covered up it seems.

It also seems like it must have something to do with my GPU or more specifically the AMD driver and my 2 different generations of AMD cards (Desktop and HTPC). Neither of you can reproduce the crash on your systems and I can't reproduce it in a VM on my Desktop. I have another older Dell system (core2duo) with an even older AMD card I could try. It might run a different legacy driver. Also I have a laptop with Intel onboard graphics (sandy bridge) and another with hybrid Intel(sandy bridge)/nVidia GPU I could try sometime during/after the holidays just to see what happens.

<!DOCTYPE html>

Click here for even more backtrace P_SetupLevel: MAP01 (doom2.wad), Doom nodes Skill 3, Total 0:00:00 Demo Version 221 free(): invalid next size (normal) Thread 1 "woof" received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff7ac7859 in __GI_abort () at abort.c:79 #2 0x00007ffff7b323ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7c5c285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155 #3 0x00007ffff7b3a47c in malloc_printerr (str=str@entry=0x7ffff7c5e6b8 "free(): invalid next size (normal)") at malloc.c:5347 #4 0x00007ffff7b3bfbc in _int_free (av=0x7ffff7c8db80 , p=0x555557860370, have_lock=) at malloc.c:4322 #5 0x00007ffff7d59533 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #6 0x00007ffff7d90bf3 in () at /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 #7 0x000055555559f621 in I_InitGraphicsMode () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/i_video.c:1489 #8 0x000055555559f93c in I_ResetScreen () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/i_video.c:1616 #9 0x00005555555a88f3 in M_Responder (ev=0x55555575614c ) at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/m_menu.c:5060 #10 0x0000555555581941 in D_ProcessEvents () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/d_main.c:207 #11 0x0000555555585fed in BuildNewTic () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/d_loop.c:151 #12 0x00005555555861f3 in NetUpdate () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/d_loop.c:248 #13 0x0000555555586ab2 in TryRunTics () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/d_loop.c:709 #14 0x0000555555585efe in D_DoomMain () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/d_main.c:2373 #15 0x0000555555598c58 in main (argc=1, argv=0x7fffffffdeb8) at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/i_main.c:65 (gdb) 2nd crash P_SetupLevel: MAP07 (doom2.wad), Doom nodes Skill 3, Total 0:00:00 Demo Version 221 Thread 1 "woof" received signal SIGSEGV, Segmentation fault. R_DrawColumn () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/r_draw.c:163 163 *dest = colormap[source[(frac>>FRACBITS) & heightmask]]; (gdb) bt #0 R_DrawColumn () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/r_draw.c:163 #1 0x00005555555f5260 in R_DrawMaskedColumn (column=0x7ffff242d059) at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/r_things.c:348 #2 0x00005555555f5482 in R_DrawVisSprite (vis=0x7fffffffd260, x1=31, x2=272) at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/r_things.c:414 #3 0x00005555555f61df in R_DrawPSprite (psp=0x555555756990 ) at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/r_things.c:750 #4 0x00005555555f6327 in R_DrawPlayerSprites () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/r_things.c:787 #5 0x00005555555f6f4e in R_DrawMasked () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/r_things.c:1027 #6 0x00005555555f1b23 in R_RenderPlayerView (player=0x555555756880 ) at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/r_main.c:710 #7 0x0000555555581b91 in D_Display () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/d_main.c:284 #8 0x0000555555585f36 in D_DoomMain () at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/d_main.c:2379 #9 0x0000555555598c58 in main (argc=1, argv=0x7fffffffdeb8) at /home/andrew/Build-Test/woof-keep_renderer-f4ca35f -I_Sleep/Source/i_main.c:65 (gdb)

fabiangreffrath commented 2 years ago

Issue should be fixed (though not solved) on the master branch bh now.

hackneyed-one commented 2 years ago

Yep, current woof-master 1405f92 passes the 5 minute Enter key test as expected. Thank you @rfomin and @fabiangreffrath ! I suppose its mostly settled for now but I'm still willing to help with the investigation if I can. If you think of something you want me to try just let me know I don't mind. Reply here or PM me on Doomworld. Cheers! :)

fabiangreffrath commented 2 years ago

Thank you for confirmation!