Infinite Recursion during Splash Screen

Building and customizing Audacity from the source code.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
jack
Posts: 1
Joined: Tue Dec 01, 2020 9:11 pm
Operating System: macOS 10.15 Catalina or later

Infinite Recursion during Splash Screen

Post by jack » Tue Dec 01, 2020 9:51 pm

Hello,

I mistakenly updated to macOS Big Sur, which has given me some headaches when it comes to working on Audacity. Since then, I've moved to working on Windows 10 temporarily, but I thought I'd let you know of the bug that's currently been hitting me. While a pre-built version of Audacity runs normally on macOS Big Sur, building it from scratch creates a version that doesn't make it to the splash screen.

I'm getting a stack overflow caused by infinite recursion that occurs somewhere in the splash screen. It looks like it has to do with how the forked version of wxWidgets is being built. The error seems to actually be in the forked version of wxWidgets. I have been getting this both with latest commit on master (tested as of Nov 24) and stable release tag v2.4.2. Here are some screenshots showing the infinite recursion.

Here is the entry point within the Audacity Source code.

Image

This is the entry point for the infinite recursion. This line looks to be the culprit, as I'll get into later.

Image

As you can see, the macro wxSMALL_FONT is defined as this:

Image

Then lastly, to complete the circle, this method calls back to the entry point. Notice this method is first called with FONT_SMALL, which then recursively calls itself with FONT_NORMAL, which goes back to wxSystemSettings, the parent class of wxSystemSettingsNative, which calls wxFONT_SMALL, a macro defined to call this method with FONT_SMALL. You can see where this is going...

Image

The interesting thing is that I think the wxWidgets developers found this bug themselves, but it was fixed at some point after the Audacity team forked from the project. Here's what I found on GitHub.

Their most recent change on this file was 5 months ago with the commit message of "Avoid infinite recursion between wxStockGDI and wxSystemSettions" on July 10. Here's the line in question, and it's different from the one reflected in the Audacity forked version.

https://github.com/wxWidgets/wxWidgets/ ... gs.mm#L208

I tried rebasing on top of the wxWidgets release 3.1.4 tag, but wasn't able to get wxWidgets to properly build. I will keep you updated on what I do, but I was wondering if there was someone who had a little more familiarity with the Audacity changes to wxWidgets who could take a look at this.

Thanks!

steve
Site Admin
Posts: 81417
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Infinite Recursion during Splash Screen

Post by steve » Wed Dec 02, 2020 9:14 pm

jack wrote:
Tue Dec 01, 2020 9:51 pm
I think the wxWidgets developers found this bug themselves, but it was fixed at some point after the Audacity team forked from the project.
I think you're right. Thank you for bringing this to our attention.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Paul L
Posts: 1788
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: Infinite Recursion during Splash Screen

Post by Paul L » Wed Dec 02, 2020 11:01 pm

The fix in wxWidgets 3.1.4 is now cherry-picked onto Audacity's custom build of 3.1.3 at https://github.com/audacity/wxWidgets.git

(and one other commit as well for a different bug)

Paul

Post Reply