Coughing Caused This App To Segfault

Brodie Robertson
23 Mar 202614:15

Summary

TLDRThis video dives into a quirky, long-standing bug in Performous, an open-source music and rhythm game. The host explores how extreme microphone input, such as coughing into a throat mic, triggered a fatal error, often mistaken for a segfault, back in 2013. Using technical insights, they explain how PortAudio’s cross-platform audio handling and buffer limitations contributed to the issue, and how it was eventually fixed. Beyond the bug, the video reflects on troubleshooting, library dependencies, and the joy of uncovering odd, historical software problems, while blending technical explanation with engaging, humorous commentary.

Takeaways

  • 😀 A strange bug in the open-source game *Performous* was reported where coughing into a throat microphone caused a crash.
  • 🎮 *Performous* is an open-source rhythm game that supports various peripherals like microphones, instruments, and dance pads.
  • 🎤 The issue arose when a throat microphone amplified sounds like coughing, causing the game to misinterpret the input and crash.
  • ⚙️ The bug was related to how *Performous* handles loud sounds, with the game failing when the input volume exceeded a certain threshold.
  • 💻 The bug was initially reported on Ubuntu 12.04 in 2013 and involved errors when the game tried to draw pitch notes on the screen.
  • 🔧 PulseAudio and PortAudio were key components in the issue, with PulseAudio's latency settings potentially causing the crash on certain devices.
  • 🎧 *Performous* relies on PortAudio, a cross-platform library, but it had limitations, particularly when dealing with Linux's PulseAudio system.
  • 📜 The bug wasn't a traditional segfault but a 'fatal error' as defined by the game's custom error handling in its code.
  • 🛠️ The game had issues with outdated dependencies and coding practices, including the use of *goto* statements in its source code.
  • 💡 Despite *Performous* being cross-platform (Linux, Windows, macOS), the audio handling wasn't consistent, especially on Linux with PulseAudio.
  • 😂 The speaker encourages viewers to share old, weird bugs they've encountered, especially those that haven't been fully explored or solved yet.

Q & A

  • What is Performous and what does it support?

    -Performous is an open-source music and rhythm game that combines features of SingStar, Guitar Hero, and DDR. It supports karaoke, band, and dancing gameplay, and can use microphones, instruments, and dance pads from various platforms.

  • What caused the crash in Performous as described in the transcript?

    -The crash was triggered by a very loud sound, such as a cough amplified by a throat microphone. The application encountered an invalid frequency during pitch analysis, resulting in a self-defined fatal error, not a true segfault.

  • Why did the terminal report 'terminate code without an active exception'?

    -This misleading message was reported because Performous crashed due to a fatal error in its pitch analysis logic, not a memory access violation. The error handling in the code made it appear as if it were an unhandled exception.

  • How does a throat microphone affect Performous differently than a standard headset mic?

    -A throat microphone picks up vibrations directly from the neck, minimizing background noise. However, it tends to over-amplify certain sounds like coughing, which can trigger errors in Performous’ pitch analysis system.

  • What role does PortAudio play in this issue?

    -PortAudio is a cross-platform library that abstracts audio input/output for Performous. The crash was partly caused by PortAudio's handling of small buffer sizes with PulseAudio, which led to invalid frequency errors during pitch analysis.

  • Why might this crash not appear during normal gameplay?

    -Normal gameplay typically does not generate the extreme input levels that a throat microphone might produce when coughing or making loud noises. Therefore, the error is unlikely to occur with standard microphones in typical use.

  • What steps were suggested to reproduce or debug the crash?

    -It was suggested to use the GDB debugger to generate a backtrace from the crash. Additionally, compiling Performous from the Git repository and testing with the affected microphone can help identify the exact cause.

  • How was the crash addressed in Performous’ development?

    -The crash was fixed in the development version through commits that improved audio input handling, adjusted buffer sizes, and made the software more robust against unexpected loud sounds. Users are encouraged to use the latest development branch.

  • What lessons can developers learn from this issue?

    -Developers should assume that most bugs originate from their own code, even when using third-party libraries. They should also handle extreme input values safely, provide clear error messages, and keep upstream dependencies updated or code defensively around their limitations.

  • Why do old bug reports like this resurface?

    -Old bug reports often resurface through social media, forums, or cross-references in other issues. Even if fixed in the development branch, users may still encounter them if using older releases, which is why proper tagging and clear communication in repositories is important.

  • What is the recommended workaround for PulseAudio users?

    -The recommended workaround is to adjust the latency request when using PulseAudio or the default audio input device. This reduces the likelihood of invalid frequency errors and improves compatibility with Performous’ pitch analysis system.

  • What does the transcript suggest about coding style and readability?

    -The transcript criticizes the use of single-line for loops with if statements and goto commands, emphasizing that such code is hard to read and maintain. Developers are encouraged to write clear, multi-line code to improve maintainability.

Outlines

plate

Этот раздел доступен только подписчикам платных тарифов. Пожалуйста, перейдите на платный тариф для доступа.

Перейти на платный тариф

Mindmap

plate

Этот раздел доступен только подписчикам платных тарифов. Пожалуйста, перейдите на платный тариф для доступа.

Перейти на платный тариф

Keywords

plate

Этот раздел доступен только подписчикам платных тарифов. Пожалуйста, перейдите на платный тариф для доступа.

Перейти на платный тариф

Highlights

plate

Этот раздел доступен только подписчикам платных тарифов. Пожалуйста, перейдите на платный тариф для доступа.

Перейти на платный тариф

Transcripts

plate

Этот раздел доступен только подписчикам платных тарифов. Пожалуйста, перейдите на платный тариф для доступа.

Перейти на платный тариф
Rate This

5.0 / 5 (0 votes)

Связанные теги
PerformousOpen SourceAudio BugThroat MicrophonePortAudioGame DevelopmentLinuxBug FixCross-PlatformTechnical AnalysisSoftware DebuggingRetro Issues
Вам нужно краткое изложение на английском?