Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite recursion with dummy sound system #629

Open
AMDmi3 opened this issue Jun 8, 2021 · 2 comments
Open

Infinite recursion with dummy sound system #629

AMDmi3 opened this issue Jun 8, 2021 · 2 comments
Labels
Bug Building compiling, etc.

Comments

@AMDmi3
Copy link
Contributor

AMDmi3 commented Jun 8, 2021

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
Copy link
Member

ryfactor commented Jun 8, 2021

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
Copy link
Contributor Author

AMDmi3 commented Jun 8, 2021

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

@red-kangaroo red-kangaroo added Bug Building compiling, etc. labels Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Building compiling, etc.
Projects
None yet
Development

No branches or pull requests

3 participants