Menu

#1 Segfaults on sound stuff when loading "Silver Level"

closed-fixed
None
5
2000-11-19
2000-11-19
No

When I enter the game and try to load the "Silver Level" as the first level, it segfaults (after loading the entire level). Gdb output:

mainGameLoop [main.c:242] Map 0 Loaded
mainGameLoop [main.c:244] Flag num: 10
[Switching to Thread 5055]

Program received signal SIGSEGV, Segmentation fault.
0x8053e7c in mix_sound () at sound.c:213
213 int siz = mod[slot].header->ins[channel[c].sample].size;
(gdb) bt
#0 0x8053e7c in mix_sound () at sound.c:213
#1 0x8059208 in mod ()
#2 0x80553ca in play_thread (arg=0x0) at sound.c:787
#3 0x4002261d in pthread_start_thread (arg=0xbf7ffe60) at manager.c:213

If I load another level, and then load the "Silver Level", there are no problems.

Discussion

  • Ismael Orenstein

    To be more precise, this segfault happens whenever I try to load a level that doesn't have any music... like the "Leo Level" as well.

     
  • Claudio Matsuoka

    • status: open --> open-fixed
     
  • Claudio Matsuoka

    Added the 'loaded_sound' flag to level.c to check whether a sound file was loaded for this level. If not, load the default sound module to play the sound effects only (no music will be played). This deferred module loading could also be used to handle all level module loading, but having two slots and keeping the intro tune in memory increases performance (it's small anyway).

     
  • Ismael Orenstein

    • priority: 7 --> 5
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.