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

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

Open
1 task done
bluebandit21 opened this issue Jun 5, 2022 · 3 comments
Open
1 task done

Comments

@bluebandit21
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

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

Encountered by another user just now (using 71.2)

Discord user jorgex_77osu
Crash dump

@bluebandit21
Copy link
Member Author

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 (nodegui/nodegui#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
Copy link
Member Author

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?

bluebandit21 added a commit to bluebandit21/Homebrew-Etterna that referenced this issue Mar 31, 2024
Build a version of OpenSSL that can be statically linked into our
 binary and work on OSX High Sierra!
Without this, the generated library will be unusable because of the lack
 of ____chkstk_darwin in High Sierra's libSystem.B.dylib
See: etternagame/etterna#1186
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants