MantisBT - Zandronum
View Issue Details
0001394Zandronum[All Projects] Bugpublic2013-07-05 07:112018-09-30 22:02
skyrimguy 
Torr Samaho 
normalminoralways
closedfixed 
Linux
1.0 
3.03.0 
0001394: Zandronum linux client freezes and doesn't respond.
This issue only happens when TiMidity++ is removed or not installed and the path for the gm.dls file is set for snd_midipatchset=
The following is displayed in the terminal:

I_InitSound: Initializing FMOD
OSS could not be initialized. Trying ALSA.
execvp failed
1- If you installed TiMidity++, removed it from your system.
2- Edit zandronum.ini and go to snd_midipatchset=
3- Set path for the gm.dls file and save.
4- Run Zandronum and start a new game.
5- Open menu and go to Options -> Sound Options
6- Select TiMidity++ as your MIDI Device and restart sound at least 3 times.

Result: Zandronum freezes and doesn't respond.


Is this an expected behavior for Zandronum?
It happens on Zandronum 1.0-r120819-2011 and 1.1-alpha-r130630-2011

Link for gm.dls file:
'http://www.solidfiles.com/d/765e42ac1c/ [^]'
No tags attached.
has duplicate 0001540closed  Selecting Timidity with no Timidity installed kills Zandronum on start and gives confusing error message 
child of 0002172closed Torr Samaho Upgrade GZDoom base to 1.8.6 
Issue History
2013-07-05 07:11skyrimguyNew Issue
2013-07-05 09:38Edward-sanNote Added: 0006576
2013-07-05 16:31skyrimguyNote Added: 0006578
2013-07-05 20:15Blzut3Note Added: 0006580
2013-07-06 04:49skyrimguyNote Added: 0006581
2013-07-06 06:03skyrimguyNote Edited: 0006581bug_revision_view_page.php?bugnote_id=6581#r3652
2013-07-06 06:04skyrimguyNote Edited: 0006581bug_revision_view_page.php?bugnote_id=6581#r3653
2013-07-06 07:56Edward-sanNote Added: 0006582
2013-07-06 09:19skyrimguyNote Added: 0006583
2013-07-06 19:30Edward-sanNote Added: 0006586
2013-07-07 01:24skyrimguyNote Added: 0006588
2013-07-07 01:29skyrimguyNote Edited: 0006588bug_revision_view_page.php?bugnote_id=6588#r3655
2013-07-07 02:54skyrimguyNote Edited: 0006588bug_revision_view_page.php?bugnote_id=6588#r3656
2013-07-07 02:54skyrimguyNote Edited: 0006588bug_revision_view_page.php?bugnote_id=6588#r3657
2013-07-07 03:27skyrimguyNote Edited: 0006588bug_revision_view_page.php?bugnote_id=6588#r3658
2013-07-07 11:24Edward-sanNote Added: 0006590
2013-07-07 11:24Edward-sanNote Edited: 0006590bug_revision_view_page.php?bugnote_id=6590#r3660
2013-07-08 03:32skyrimguyNote Added: 0006596
2013-07-08 17:07skyrimguyNote Added: 0006598
2013-07-08 17:10skyrimguyNote Edited: 0006598bug_revision_view_page.php?bugnote_id=6598#r3666
2013-07-08 18:33skyrimguyNote Edited: 0006598bug_revision_view_page.php?bugnote_id=6598#r3667
2013-07-08 20:32Edward-sanNote Added: 0006600
2013-07-08 20:32Edward-sanStatusnew => confirmed
2013-07-08 20:33Edward-sanNote Edited: 0006600bug_revision_view_page.php?bugnote_id=6600#r3669
2013-07-08 21:54skyrimguyNote Added: 0006601
2013-10-14 14:33ArcoRelationship addedhas duplicate 0001540
2013-10-14 14:35ArcoStatusconfirmed => acknowledged
2013-10-14 14:35ArcoResolutionopen => backport later
2015-04-05 07:38WaTaKiDRelationship addedchild of 0002172
2015-04-05 07:38WaTaKiDTarget Version => 3.0
2015-05-09 13:57DuskStatusacknowledged => assigned
2015-05-09 13:57DuskAssigned To => Torr Samaho
2015-05-09 13:58DuskStatusassigned => needs testing
2016-02-06 12:36Edward-sanResolutionbackport later => open
2016-02-06 12:43Edward-sanNote Added: 0014359
2016-05-24 02:25Ru5tK1ngNote Added: 0014977
2016-05-24 02:25Ru5tK1ngStatusneeds testing => resolved
2016-05-24 02:25Ru5tK1ngResolutionopen => fixed
2016-05-24 02:25Ru5tK1ngFixed in Version => 3.0
2018-09-30 22:02Blzut3Statusresolved => closed

Notes
(0006576)
Edward-san   
2013-07-05 09:38   
does it happen with gzdoom 323?
(0006578)
skyrimguy   
2013-07-05 16:31   
When I run GZDoom-r323, it opens a black window and suddenly close and in the terminal stays like this forever:


*** Fatal Error ***
Integer divide by zero (signal 8)

Generating zdoom-crash.log and killing process 5245, please wait...



I waited approximately 40 minutes but it didn't finish, so I kill it.


This is from the zdoom-crash.log and that is all:


*** Fatal Error ***
Integer divide by zero (signal 8)
Address: 0x52b2d3

System: Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux
GCC version: 4.7


GZDoom version 1.2.1 (r0) / ZDoom2.3.0 (r1552) (Feb 25 2013)

Command line: ./gzdoom

Wad 0: gzdoom.pk3
Wad 1: doom2.wad

Not in a level.

Executing: gdb --quiet --batch --command=gdb-respfile-6BUN1r --pid=5245
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7f02da77b700 (LWP 5248)]
[New Thread 0x7f02daf7c700 (LWP 5247)]
0x00007f02ee3b7c1d in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0


and yes, gdb is installed.

Because GZDoom-r323 does not run successfully, I'm unable to test on GZDoom-r323 the issue that is described in my bug report.
(0006580)
Blzut3   
2013-07-05 20:15   
Re-download and try again. New GZDoom tar.bz2's md5sum is fed94d1f854767ce8cd7130166131205.
(0006581)
skyrimguy   
2013-07-06 04:49   
(edited on: 2013-07-06 06:04)
Yes, the issue also happens on GZDoom-r323.

GZDoom-r323 suddenly close on Debian Squeeze i686:

I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
The program 'gzdoom' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRegion (invalid Region parameter)'.
  (Details: serial 10250 error_code 160 request_code 148 minor_code 10)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
The program 'gzdoom' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRegion (invalid Region parameter)'.
  (Details: serial 10250 error_code 160 request_code 148 minor_code 10)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)



I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
gzdoom: Fatal IO error 2 (No such file or directory) on X server :0.0.


My Debian Squeeze i686 info:

Linux debian 3.2.0-0.bpo.1-686-pae #1 SMP Sat Feb 11 14:57:20 UTC 2012 i686 GNU/Linux
Advanced Linux Sound Architecture Driver Version 1.0.24.
X.Org X Server 1.10.4
Release Date: 2011-08-19
X Protocol Version 11, Revision 0
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) Ironlake Mobile x86/MMX/SSE2
OpenGL version string: 2.1 Mesa 7.10.3
OpenGL shading language version string: 1.20



GZDoom-r323 suddenly close on Debian Wheezy x86_64:

I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.



I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
gzdoom: Fatal IO error 4 (Interrupted system call) on X server :0.0.



I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
gzdoom: Fatal IO error 2 (No such file or directory) on X server :0.0.


GZDoom-r323 freezes and does not respond on Debian Wheezy x86_64:

I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
child gone


My Debian Wheezy x86_64 info:

Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux
Advanced Linux Sound Architecture Driver Version 1.0.24.
X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) Ironlake Mobile
OpenGL version string: 2.1 Mesa 8.0.5
OpenGL shading language version string: 1.20



GZDoom-r323 suddenly close on Debian Sid x86_64:

I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.



I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
gzdoom: Fatal IO error 2 (No such file or directory) on X server :0.0.
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.



I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
gzdoom: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
gzdoom: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted



I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
gzdoom: Fatal IO error 2 (No such file or directory) on X server :0.0.
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
gzdoom: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted


GZDoom-r323 freezes and does not respond on Debian Sid x86_64:

I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed
gzdoom: Fatal IO error 2 (No such file or directory) on X server :0.0.
child gone


My Debian Sid x86_64 info:

Linux debian 3.9-8.dmz.1-liquorix-amd64 #1 ZEN SMP PREEMPT Fri Jun 28 03:38:35 UTC 2013 x86_64 GNU/Linux
Advanced Linux Sound Architecture Driver Version k3.9-8.dmz.1-liquorix-amd64.
X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ironlake Mobile
OpenGL version string: 2.1 Mesa 9.1.3
OpenGL shading language version string: 1.20


All ^above was done on OpenGL mode.

GZDoom-r323 (Software mode) freezes and does not respond on Debian Squeeze/Wheezy/Sid:

I_InitSound: Initializing FMOD
HOSS could not be initialized. Trying ALSA.
execvp failed


Zandronum (Software mode) freezes and does not respond on Debian Squeeze/Wheezy/Sid:

I_InitSound: Initializing FMOD
OSS could not be initialized. Trying ALSA.
execvp failed


In short, while following the instructions that I described in my bug report, the messages vary on OpenGL mode but the messages are the same on Software mode.

(0006582)
Edward-san   
2013-07-06 07:56   
Can you reproduce with the latest gzdoom version? The instructions to download it, as a package, is here.
(0006583)
skyrimguy   
2013-07-06 09:19   
I can't reproduce the issue with the latest versions of GZDoom (g1.8.1-74-gedd2142) or ZDoom (2.8pre-56-g8afece1)
(0006586)
Edward-san   
2013-07-06 19:30   
mmm surely this means that we need to backport something from zdoom. I remember randi fixed something in fmod and in timidity code, but I can't recall which revision did that.
(0006588)
skyrimguy   
2013-07-07 01:24   
(edited on: 2013-07-07 03:27)
From ZDoom git log, I think I found the revision that solves the issue:

commit 39940fe20acbd3b2f0ebc6bd94d4c84c28653085
Author: Randy Heit <rheit@zdoom.fake>
Date: Thu Mar 27 04:25:52 2008 +0000

    - Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
      from doing prebuffering of the song. This was causing the Linux version to
      hang while waiting for input from the pipe, since Timidity hadn't been
      started yet. I tried using a select call in the FillStream() method, but it
      always seems to return the pipe as having nothing available. Unfortunately,
      the game still falls all over itself if Timidity isn't available. Instead
      of execvp failing nicely, X errors kill the game. I don't know why it's
      doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
      set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
      and set the snd_midipatchset cvar to point to it. It's faster and also
      sounds a whole lot better than the crappy freepats Ubuntu wants to install
      with Timidity++.
    - GCC fixes.
    
    
    
    SVN r858 (trunk)


all thanks to:

git log | grep -A15 -B15 snd_midipatchset


Update:
I recently discovered that I could have used this:

git log --grep=snd_midipatchset

instead of my previous ugly method.

(0006590)
Edward-san   
2013-07-07 11:24   
You should start after r1551. r858 is too old and is already in.

(0006596)
skyrimguy   
2013-07-08 03:32   
I can't reproduce the issue:
ZDoom SVN r3803
ZDoom SVN r3468
ZDoom SVN r3463
ZDoom SVN r3432


commit 26f9540d3c7d9ec2c769ef5d7e26f7cf56d0e753
Author: Randy Heit <rheit@zdoom.fake>
Date: Sat Aug 4 01:42:49 2012 +0000

    - Fixed: I missed a nuance of the MIDI spec when writing MIDIStreamer::CreateSMF(): Running status
      is supposed to be canceled by sysex events and meta events. This confused FMOD when the
      resulting song used used running status right after these events.
    
    SVN r3803 (trunk)

commit bff5a9b8d80380988eebe4e76a02d3d9e13bbd88
Author: Randy Heit <rheit@zdoom.fake>
Date: Thu Mar 22 22:40:30 2012 +0000

    - Fixed: Trying to init FMOD with profiling enabled when the network socket was in use would fail.
      We now fallback to no profiling when this happens.
    
    SVN r3468 (trunk)

commit cd122f944b6c3b5f07be72fcfb80e6e4a5f6966f
Author: Randy Heit <rheit@zdoom.fake>
Date: Thu Mar 22 21:23:18 2012 +0000

    - Similar fix to the previous: The child TiMidity++ process quitting would not necessarily be
      detected, so S_ChangeMusic() would not restart one-shot songs that had finished if it was
      the MIDI device.
    
    SVN r3463 (trunk)

commit ce43552ebb4c405d0ff8e10d468143d12c64085e
Author: Randy Heit <rheit@zdoom.fake>
Date: Mon Mar 12 04:05:15 2012 +0000

    - Use _exit() instead of exit() when Timidity++ cannot be execed, because
      exit() can (and does) make the process hang. (It sure would be nice if
      POSIX-land had a simple CreateProcess API, but I guess that would be too
      easy, huh?)
    
    
    
    SVN r3432 (trunk)


I can reproduce the issue:
ZDoom SVN r3431
ZDoom SVN r3429
ZDoom SVN r3427
ZDoom SVN r3425
ZDoom SVN r3357
ZDoom SVN r3350
ZDoom SVN r3297
ZDoom SVN r3278
ZDoom SVN r3212
ZDoom SVN r2864
ZDoom SVN r2862
ZDoom SVN r2861
ZDoom SVN r2555
ZDoom SVN r2282
ZDoom SVN r2271
ZDoom SVN r2177
ZDoom SVN r2174
ZDoom SVN r2170
ZDoom SVN r1987
ZDoom SVN r1727

I can't reproduce the issue in the same way as described at "Steps To Reproduce" but ZDoom freezes if TiMidity++ is the default MIDI device when starting a new game:
ZDoom SVN r3087
ZDoom SVN r2980
ZDoom SVN r2942
ZDoom SVN r2927
ZDoom SVN r2882
(0006598)
skyrimguy   
2013-07-08 17:07   
(edited on: 2013-07-08 18:33)
UPDATE:

zandronum/src/sound/music_midi_timidity.cpp

Go to line 529 and change:

exit (0);


To:

_exit (0);


and I can't reproduce the issue on Zandronum. With this change, I can consider the issue as fixed.

(0006600)
Edward-san   
2013-07-08 20:32   
(edited on: 2013-07-08 20:33)
Ok, this means we need to backport r3432. Thanks for your help!

(0006601)
skyrimguy   
2013-07-08 21:54   
You're welcome.
(0014359)
Edward-san   
2016-02-06 12:43   
What about now in zandronum 3.0 beta?
(0014977)
Ru5tK1ng   
2016-05-24 02:25   
Reporter seems to have disappeared... So closing for now since changes were back-ported.