uspgamedev / luasteam

Bindings to connect lua with Steam API
https://luasteam.readthedocs.io/en/stable/
MIT License
136 stars 25 forks source link

Random segmentation faults on x86 macOS #51

Open kongeor opened 3 days ago

kongeor commented 3 days ago

Hello,

Thank you for your work on this library.

I'm having very similar issues to the ones reported in #44.

I'm using love 11.5, luasteam 3.2.1 and steamworks 1.61 (had the same issues with 1.60 and 1.59).

On windows and linux everything works without issues.

On intel macs (tested on Sonoma and Monterey versions of OSX) my game is crashing randomly. Initially I thought it was related to Steam input as the game was crashing almost instantly on boot. When Steam input was disabled the issue was still happening but more sporadically although it didn't seem to be related to some specific API trigger. I'm using Steam stats and achievements but those are registered fine. I don't make use of Steam.userStats.onUserStatsReceived()

I'll try to get my hands on an arm based mac to test it there and will report back if this issue is appearing there.

Attaching the OSX report in case it can provide something useful: macrash.txt

Any help would be much appreciated.

kongeor commented 3 days ago

After some further poking with this I tried rebuilding the library on my mac, but ran onto this error:

$ make osx
c++ src/*.cpp -Wno-invalid-offsetof -Wall -arch arm64 sdk/redistributable_bin/osx/libsteam_api.dylib ./third-party/lib/libluajit-5.1.a -o luasteam.so.arm64 -shared -fPIC -I./third-party/include/ -std=c++11 -mmacosx-version-min=10.11
src/user_stats.cpp:280:38: error: no member named 'RequestCurrentStats' in 'ISteamUserStats'
  280 |     bool success = SteamUserStats()->RequestCurrentStats();
      |                    ~~~~~~~~~~~~~~~~  ^
1 error generated.

Docs stated that this callback was removed as it was not needed, so I commented out the corresponding luasteam bits. This was built against steamworks 1.61. I've then bundled my game with the produced luasteam.so for osx and it felt that the error went away. I enabled Steam input but then the game started crashing again. I disabled Steam input again, and I continued experiencing random crashes.