MantisBT - Zandronum
View Issue Details
0003766Zandronum[All Projects] Bugpublic2020-02-21 08:302020-09-04 16:06
LinuxArch Linux5.5.4-arch1-1
0003766: Crash on Launch
This was the only verbose from the terminal. I've done a fresh install and the issue still persists. This has happened as of yesterday.

free(): double free detected in tcache 2
Aborted (core dumped)
Launch Zandronum on Arch Linux
No tags attached.
has duplicate 0003853closed  Core dumps at launch 
Issue History
2020-02-21 08:30PolygonNew Issue
2020-02-21 08:40PolygonNote Added: 0021215
2020-02-23 20:09Torr SamahoNote Added: 0021216
2020-02-23 21:29PolygonNote Added: 0021217
2020-02-23 22:20PolygonNote Added: 0021218
2020-02-23 22:46PolygonNote Edited: 0021218bug_revision_view_page.php?rev_id=13033
2020-02-23 22:48PolygonNote Added: 0021219
2020-02-24 00:42PolygonNote Deleted: 0021218
2020-02-24 20:32PolygonNote Added: 0021220
2020-02-27 23:36doomjoshuaboyNote Added: 0021222
2020-02-27 23:39doomjoshuaboyNote Edited: 0021222bug_revision_view_page.php?bugnote_id=21222#r13035
2020-03-03 05:03thanatosNote Added: 0021223
2020-03-03 14:35PolygonNote Added: 0021224
2020-03-03 14:43PolygonNote Edited: 0021224bug_revision_view_page.php?bugnote_id=21224#r13037
2020-05-17 20:18AOSPNote Added: 0021337
2020-05-17 20:26Edward-sanStatusnew => closed
2020-05-17 20:26Edward-sanResolutionopen => no change required
2020-09-04 15:58AOSPRelationship addedhas duplicate 0003853
2020-09-04 16:06AOSPNote Added: 0021534
2020-09-04 16:06AOSPStatusclosed => feedback
2020-09-04 16:06AOSPResolutionno change required => reopened
2020-09-04 16:06AOSPStatusfeedback => resolved
2020-09-04 16:06AOSPFixed in Version => 3.1
2020-09-04 16:06AOSPResolutionreopened => fixed
2020-09-04 16:06AOSPAssigned To => AOSP

2020-02-21 08:40   
Issue is present in both 3.0 and 3.1 180901-1533
Torr Samaho   
2020-02-23 20:09   
Can you compile in debug mode and see if it still crashes? If so, can you post a backtrace of the crash?
2020-02-23 21:29   
Yes, Give me a bit.
2020-02-23 22:48   
Starting program: /home/blushberry/zandronum_build/zandronum/buildclient/zandronum -iwad ~/.iwad/doom2.wad
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/".
[New Thread 0x7ffff4fdd700 (LWP 105381)]

Thread 1 "zandronum" received signal SIGSEGV, Segmentation fault.
0x00007ffff61b4f1e in malloc () from /usr/lib/
#0 0x00007ffff61b4f1e in malloc () at /usr/lib/
#1 0x00007ffff6a2ede5 in FMOD::MemPool::alloc(int, char const*, int, unsigned int, bool) () at /home/blushberry/zandronum_build/zandronum/fmodapi42416linux64/api/lib/
0000002 0x00007ffff6a52d41 in FMOD::OutputALSA::addALSADriver(char const*) () at /home/blushberry/zandronum_build/zandronum/fmodapi42416linux64/api/lib/
0000003 0x00007ffff6a52f8d in FMOD::OutputALSA::getALSANameHintDrivers() () at /home/blushberry/zandronum_build/zandronum/fmodapi42416linux64/api/lib/
0000004 0x00007ffff6a5356d in FMOD::OutputALSA::enumerate() () at /home/blushberry/zandronum_build/zandronum/fmodapi42416linux64/api/lib/
0000005 0x00007ffff6a53915 in FMOD::OutputALSA::getNumDrivers(int*) () at /home/blushberry/zandronum_build/zandronum/fmodapi42416linux64/api/lib/
0000006 0x00007ffff6a43e6e in FMOD::SystemI::getNumDrivers(int*) () at /home/blushberry/zandronum_build/zandronum/fmodapi42416linux64/api/lib/
0000007 0x00007ffff6a40cf3 in FMOD::System::getNumDrivers(int*) () at /home/blushberry/zandronum_build/zandronum/fmodapi42416linux64/api/lib/
0000008 0x0000555555ca8633 in FMODSoundRenderer::Init() (this=0x555557a9c7c0) at /home/blushberry/zandronum_build/zandronum/src/sound/fmodsound.cpp:846
0000009 0x0000555555ca819b in FMODSoundRenderer::FMODSoundRenderer() (this=0x555557a9c7c0) at /home/blushberry/zandronum_build/zandronum/src/sound/fmodsound.cpp:622
0000010 0x0000555555cafde0 in I_InitSound() () at /home/blushberry/zandronum_build/zandronum/src/sound/i_sound.cpp:266
0000011 0x0000555555813699 in I_Init() () at /home/blushberry/zandronum_build/zandronum/src/sdl/i_system.cpp:349
0000012 0x000055555589fa4f in D_DoomMain() () at /home/blushberry/zandronum_build/zandronum/src/d_main.cpp:2912
0000013 0x0000555555812f4e in main(int, char**) (argc=3, argv=0x7fffffffe648) at /home/blushberry/zandronum_build/zandronum/src/sdl/i_main.cpp:380
2020-02-24 20:32   
Here is some additional information if needed [^]
2020-02-27 23:36   
(edited on: 2020-02-27 23:39)
I figured out what went wrong, FMODEx 4.24.16 on arch linux causes a memory leak so an upgrade of FMODEx is needed.

2020-03-03 05:03   
I also run Arch, and I'm seeing this issue. It's rendered Zandronum unplayable. :(

Zandronum broke immediately after I did a system upgrade. That's not to suggest that doomjoshuaboy's analysis is wrong here: an upgraded library can absolutely trigger bugs in other code that were latent by pure chance before the upgrade. However, it seems some recent upgrades in Arch broke a *lot* of games — more than just Zandronum, including many Unity games.

There's some discussion on the Arch BBS:

Topic A: [^]
Topic B: [^]

Topic B links to a GitHub issue against alsa-lib: [^] — my reading of it, and in particular, of this comment: [^] and the commit just prior to it, suggest that there might have been a legitimate bug that is either responsible or at least the trigger.

Topic B on the BBS also contained this gem:

> Downgrading alsa-lib (and alsa-utils) to version (and 1.2.1-2 respectively) solved the issue.

*Which worked for me!* (Though I can't keep those downgraded forever; however, hopefully a subsequent release of alsa-libs will contain the fix in the bug, and hopefully that version will work, removing the need for downgrading.) Both of those were upgraded on 20 Feb.

The downgrade commands are:

sudo pacman -U [^]
sudo pacman -U [^]

(N.b. your next normal full upgrade will undo this. Which is good, once fixes come out.)

So, that gets me back into being knee-deep in the dead for the moment. Again, it isn't 100% clear to me if this is a straight-up bug in alsa-lib, or if it triggers bad memory management in other libraries, or some mix of both — I don't mean to contradict any plans to push other fixes. But I thought I'd link in the other posts/topics, since they seem to be helpful.
2020-03-03 14:35   
(edited on: 2020-03-03 14:43)
I can confirm with both Josh's and Thanatos' posts that these both do fix the issue. It's probably better to go with Thanatos' fix until the library itself has been fixed.

2020-05-17 20:18   
As of recent 3.1 builds, Zandronum is compiled with FMOD 4.44.64 which no longer exhibits this issue.

A workaround for 3.0 is to start with -nosound and set output type to SDL, then restart the game normally.
2020-09-04 16:06   
I'm going to re-open this ticket and then re-close it as resolved as this did indeed require a change, as 3.1 builds are now compiled with a newer FMOD Ex and the source code had to be updated to support this.