etternagame / etterna

Advanced cross-platform rhythm game focused on keyboard play
https://etternaonline.com/
MIT License
475 stars 134 forks source link

[Bug]: Weird crash inside OpenSSL functions for some OSX High Sierra users #1186

Open bluebandit21 opened 2 years ago

bluebandit21 commented 2 years ago

Is there an existing issue for this?

Contact Details

No response

Version Info

Latest available release

What operating system are you seeing the problem on?

macOS

Bug Behavior

Multiple OSX High Sierra users have encountered a crash within OpenSSL when trying to open the game.

The crash is consistently within ssl3_write_bytes transitively called by DownloadManager::UpdateHTTP.

A workaround is having them disable their wifi when starting the game and re-enable it after it opens.

Attached below are some crash dumps that may or may not be helpful.

Expected Behavior

No response

Reproduction Steps

No response

Anything else?

bluebandit21 commented 1 year ago

Encountered by another user just now (using 71.2)

Discord user jorgex_77osu Crash dump

bluebandit21 commented 1 year ago

Some additional information:

The crash (at least for one El Capitan user on the EO server) appears to be caused by the symbol ____chkstk_darwin not being present within /usr/lib/libSystem.B.dylib

Some online searching (https://github.com/nodegui/nodegui/issues/391) suggests that this might be caused by CMake targeting too recent a macOS version, with the configuration variable CMAKE_OSX_DEPLOYMENT_TARGET possibly offering a solution.

I attempted to use ^ but it did not seem to fix the problem for the user. (However, it's very possible I just incorrectly set it within the CMake files)

bluebandit21 commented 5 months ago

Had an idea that might let us hackily + easily fix this.

What's the real problem? -- Dyld can't lazily bind ____chkstk_darwin because it simply doesn't exist. However, the function doesn't do anything we care about; it's just to check for stack smashing occurring and abort if detected. It's a void(void) function!

What if we can make our own libSystem.B.dylib containing a stub ____chkstk_darwin and use dynamic library preloading shenanigans to let our stub version be found when dyld tries to find the real version?