-
Notifications
You must be signed in to change notification settings - Fork 175
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
Feature request: dynamically link against openssl #3803
Comments
A really simple example.c to show the problem is:
Compilable with If compiled against openssl 1.0.2 it'll crash because of OPENSSL_ia32_cpuid() is now OPENSSL_ia32_cpuid(unsigned int *) [https://github.com/openssl/openssl/commit/c5cd28bd64fa2b02f29e74486539e4b2f6741114]. |
I don't think the symbols were intentionally exported, they shouldn't be exposed from steamclient.so. |
Well, would be a solution to have absolute addressing within steamclient.so and no exported symbols. But still, linking dynamically would be the preferable solution, I'd say. Unless you really want to ship everything, using the system libraries is probably better for security and performance reasons and would reduce distribution sizes. |
I found my way here by google, so I am not sure if my following Star Conflict crash is related to the issue here or not:
|
I am getting a crash that may be related with Total War: Attila. I have trouble getting the relevant information but dmesg indicates this: |
Well, I don't own any of those games you mention, but the backtrace looks like it's the same issue. For me the problem is triggered for games linked against openssl, since having openssl 1.0.2 system libraries. For a dirty workaround you can try LD_PRELOAD=/path/to/steam/ubuntu12_32/steamclient.so for the affected game. |
Star Conflict is free to play. Just give it a try: http://store.steampowered.com/app/212070/ |
Well, after downloading 5GB of StarConflict, it seems to have the very same problem (0):[INFO] ////////////////////////////////////////////////////////////////////////////// Program received signal SIGSEGV, Segmentation fault. Can be hacked around by: env LD_LIBRARY_PATH=/path/to/steam/ubuntu12_32/ LD_PRELOAD=/path/to/steam/ubuntu12_32/steamclient.so ./StarConflict Does forcing steam-runtime help? |
@mboquien Either run attilla through gdb and print the backtrace (bt) on crash, or at least look up the address of OPENSSL_ia32_cpuid with |
@htto It appears to be the same problem if I believe objdump:
and the gdb backtrace:
I have tried your workaround but I cannot get it to work. Attila has a 64 bit executable
I have tried adapting your command line to get the 64 bit files. It still crashes but the backtrace is very different so I think it is another bug that should not be discussed here. Thanks! |
I am getting this error with steam while trying to run a game I am developing with the unreal engine 4 (which uses steam, openssl and libcurl) and trying to work out how to resolve it. Is the solution to build my game against the same version of openssl or libcurl as steam is built with? If so, what version is steam built with? |
Can you guys try opting into the Beta? We fixed something there that should address these issues. For the linking question, in general to ship software through Steam you should build against the Steam Runtime SDK: |
Steam Built: Jan 21 2016, at 20:12:46 Star Conflict is working again. Thanks! |
Thanks Plagman, so it looks like we need to build our game through the steam environment? but it installs an older version (2.10) where UE4 requires version 3 or above. I then opted into the steam beta and the game ran fine. So I am wondering if the proper procedure is to build via steam environment or to simply leave our game build through our own environment and tell people to opt into the steam beta if they hit the crash? |
@Plagman Is there some more precise changelog/information available about the change? Still the need for statically including openssl into steamclient.so would be interesting. @supagu It should suffice to adjust LD_LIBRARY_PATH for runtime or use a proper -rpath path when linking if you require and distribute some specific openssl version. You just need to make sure to pick up only one version. This bug is basically about crashes due to different/incompatible openssl libraries being loaded into the same process. So if steam-runtime uses the same openssl version as is linked into steamclient.so, and that version suffices for your needs, then using/building against steam-runtime should work. @mboquien It looks like the same issue to me. steamclient.so should use the OPENSSL_ia32_cpuid from it's library instead the system's one. Also note, that running the game from command-line probably breaks the use of steam-runtime (by picking up some different openssl library, e.g. the system's one) and has different results than starting through steam. Though, I've not traced the library path setup... |
This remains a problem for the Fedora world... but its not a game that's crashing yet.. but steam itself. gdb shows this: #0 0xf6275b85 in OPENSSL_ia32_cpuid () from /lib/libcrypto.so.10 Ideas...? |
my ugly work around was to remove that function from OpenSSL, c'mon Steam you're doing a horrible job here with your building of the Steam binary.. |
I noticed that your steamclient.so (and probably others as well) include a whole (statically linked?) copy of openssl. This leads to problems for games, that themselves link against openssl. This results in libssl.so* and libcrypto.so* loaded by ld for the game itself, which is fine. Unfortunately, libsteam_api.so dlopens steamclient.so, which as stated above also has openssl symbols. Now if the application does call something in steamclient.so that uses ssl, this issues ssl initialization of the statically linked OPENSSL_cpuid_setup() that then dynamically calls the first occurrence of OPENSSL_ia32_cpuid() which resides in the prior loaded libcrypto.so from the system or the game itself. Game crashes like the following are then bound to happen if the openssl versions differ:
#0 OPENSSL_ia32_cpuid () at x86cpuid.s:26
#1 0xf2934701 in OPENSSL_cpuid_setup () from /games/Steam/linux32/steamclient.so
#2 0xf7913dcc in __libc_calloc (n=0, elem_size=0) at malloc.c:3258
#3 0xf1def5b4 in ?? () from /games/Steam/linux32/steamclient.so
#4 [..]
The crash happens in OPENSSL_ia32_cpuid() because it got a parameter added in openssl commit c5cd28bd64fa2b02f29e74486539e4b2f6741114, which your statically builtin version doesn't set up.
Is there a specific reason for including openssl in steamclient.so instead of dynamically linking against it?
The text was updated successfully, but these errors were encountered: