Attnam / ivan

Iter Vehemens ad Necem - a continuation of the graphical roguelike by members of http://attnam.com
GNU General Public License v2.0
296 stars 42 forks source link

Infinite recursion with dummy sound system #629

Open AMDmi3 opened 3 years ago

AMDmi3 commented 3 years ago

I'm trying to run recent ivan on FreeBSD. With #628 change I've built it, but now it hangs after "Generating game...". gdb shows infinite recursion:

...
#36571 0x00000000007849df in soundsystem::initSound () at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:345
#36572 0x0000000000783aa4 in soundsystem::playSound (Buffer=...) at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:489
#36573 0x0000000000783381 in msgsystem::AddMessage (Format=0x22ef04 "Unable to initialize audio: %s\n") at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:65
#36574 0x00000000007849df in soundsystem::initSound () at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:345
#36575 0x0000000000783aa4 in soundsystem::playSound (Buffer=...) at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:489
#36576 0x0000000000783381 in msgsystem::AddMessage (Format=0x22ef04 "Unable to initialize audio: %s\n") at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:65
#36577 0x00000000007849df in soundsystem::initSound () at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:345
#36578 0x0000000000783aa4 in soundsystem::playSound (Buffer=...) at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:489
#36579 0x0000000000783381 in msgsystem::AddMessage (Format=0x22ef04 "Unable to initialize audio: %s\n") at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:65
#36580 0x00000000007849df in soundsystem::initSound () at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:345
#36581 0x0000000000783aa4 in soundsystem::playSound (Buffer=...) at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:489
#36582 0x0000000000783381 in msgsystem::AddMessage (Format=0x22ef04 "Unable to initialize audio: %s\n") at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:65
#36583 0x00000000007849df in soundsystem::initSound () at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:345
#36584 0x0000000000783aa4 in soundsystem::playSound (Buffer=...) at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:489
#36585 0x0000000000783381 in msgsystem::AddMessage (Format=0x22ef04 "Unable to initialize audio: %s\n") at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:65
#36586 0x00000000007849df in soundsystem::initSound () at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:345
#36587 0x0000000000783aa4 in soundsystem::playSound (Buffer=...) at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:489
#36588 0x0000000000783381 in msgsystem::AddMessage (Format=0x22ef04 "Unable to initialize audio: %s\n") at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:65
#36589 0x00000000007849df in soundsystem::initSound () at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:345
#36590 0x0000000000783aa4 in soundsystem::playSound (Buffer=...) at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:489
#36591 0x0000000000783381 in msgsystem::AddMessage (Format=0x22ef04 "Unable to initialize audio: %s\n") at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:65
#36592 0x00000000007849df in soundsystem::initSound () at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:345
#36593 0x0000000000783aa4 in soundsystem::playSound (Buffer=...) at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:489
#36594 0x0000000000783381 in msgsystem::AddMessage (Format=0x20ef2b "You commence your journey to Attnam. Use direction keys to move, '>' to enter an area and '?' to view other commands.") at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/message.cpp:65
#36595 0x000000000066829f in game::Init (loadBaseName=...) at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/game.cpp:901
#36596 0x0000000000773155 in main (argc=1, argv=0x7fffffffe8c8) at /usr/work/usr/ports/games/ivan/work/ivan-058/Main/Source/main.cpp:142
ryfactor commented 3 years ago

I haven't tried this, but I think there is a NOSOUND flag in the source code. As usual, there's no guarantee this will solve the problem.

If you want to use cmake for this, you'll have to get it to propagate the flag to the compiler a la WIZARD mode.

For example in the CMakeLists.txt:

option(NOSOUND "Disable sound effects" OFF)

...

if(NOSOUND)
  add_definitions(-DNOSOUND)
endif()

Then do cmake configuration step with flag -DNOSOUND=ON. Alternatively just put #define NOSOUND 1 somewhere :)

AMDmi3 commented 3 years ago

Yes, this works for me. Still it's a logic error in the code.