Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#34 Sound Bug, sound causes Segfaulyt in RC3

closed-fixed
nobody
None
5
2011-06-23
2011-06-13
Zombie Ryushu
No

I am getting segfaults whenever I play Hexen 2 with sound enabled.

This is all gdb gives me
#0 0x000000000046875a in read_config_file ()
#1 0x00000000004240bb in S_TIMIDITY_CodecInitialize ()
#2 0x0000000000422be1 in S_CodecInit ()
#3 0x00000000004213a3 in S_Init ()
#4 0x0000000000447d65 in Host_Init ()
#5 0x0000000000466524 in main ()

but, tthe program gives me this error.

ALSA: Using device: default
ALSA: WARNING: non-power of 2 buffer size. sound may be
unsatisfactory. Recommend using either the plughw or hw
devices or adjusting dmix to have a power of 2 buf size
ALSA: 4233 bytes buffer with mmap interleaved access
Audio: 16 bit, stereo, 22050 Hz, using ALSA

gdb was not helpful.

Discussion

  • Ozkan Sezer
    Ozkan Sezer
    2011-06-13

    Thanks for the bug report. Can you please compile using DEBUG=yes, like:

    make DEBUG=yes glh2

    That should keep the debug symbols for gdb. Since the seg is in read_config_file() of timidity, can you please post your timidity.cfg, too? I'd like to fix this first priority.

    PS: I wonder whether you can generate any segfaults with an SDL_sound- or libtimidity-using midi application, because our timidity is based on those code.

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-13

    > make DEBUG=yes glh2
    NOTE: please do a "make clean" in both hexen2 as well as in libs/timidity directory, first.

     
  • Zombie Ryushu
    Zombie Ryushu
    2011-06-14

    The moment I recompiled it with Debug support sound and music started working.

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-14

    I see. This makes it difficult.

    How about only compiling libtimidity.a with debug support, ie.
    cd libs/timidity && make DEBUG=yes
    cd engine/hexen2 && make glh2

    Although I suspect that optimization is a problem and this might not help, still worth a try.

    I also need to see your timidity.cfg and some details about your timidity configuration to get a hint about the problem.

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-14

    Knowing about your software environment might help, too, ie. version details about gcc, binutils, glibc, etc.

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-14

    Attached a test patch removing the #extension parsing from read_config_file(), Does it eliminate the segfault in your normal (non-debug) builds? (This is just a blind guess following gcc's warning.)

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-14

    Attachced another patch, tes01.diff, which removes gcc's shadowing warnings. I really don't think that this one will help with your problem but still worth a try.

    Note that test00.diff and test01.diff are completely independent. You can test each of them independently and then together.

     
  • Zombie Ryushu
    Zombie Ryushu
    2011-06-14

    I run Mandriva 2010.2

    binutils-2.20.51.0.7-3mnb2
    glibc-2.11.1-8.2mnb2
    gcc-4.4.3-2mnb2
    Linux 2.6.36.2-server-2mnb #1 SMP Wed Dec 22 17:48:39 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux

    timidity.cfg
    dir /usr/share/timidity/eawpats
    source /usr/share/timidity/eawpats.cfg

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-14

    I don't have access to any Mandriva dristro,
    - Can you please also show the contents of your /usr/share/timidity/eawpats.cfg?
    - Does any of the attached patches help in any way? (Just attached a new test02.diff which is another bugfix but still suspicious whether it would help with this case.)
    - Some experimenting: Please download SDL_sound (either the official 1.03 version or the one in the mercurial repo), apply the attached SDL_sound.patch so that it works and compile the testmidi program, like:
    cd decoders/timidity
    make -f Makefile.testmidi
    ./testmidi <some_midi_file>
    Does it work for you or does it segfault?

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-15

    Update note: test01 and test02 patches are committed to svn. Svn is at rev. 4043 as of this writing. Neither me nor Steve still can not reproduce a segfault...

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-15

    • status: open --> pending
     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-15

    Please try with svn snapshot rev. 4044 (or later.

    Setting status to 'pending'

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-16

     
    Attachments
  • Zombie Ryushu
    Zombie Ryushu
    2011-06-23

    • status: pending --> open
     
  • Zombie Ryushu
    Zombie Ryushu
    2011-06-23

    I have upgraded to RC4, the sound segfaults eemto have gone away, however a new sound problem appears in ALSA mode only, sound skips.

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-23

    OK, closing as fixed.

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-06-23

    • status: open --> closed-fixed