Godotsteam: Potential crash in steamInit().

Created on 16 Mar 2020  路  9Comments  路  Source: Gramps/GodotSteam

Using a custom build of Godot 3.2.1 on Windows. I've run into a crash while having Godot launch Steam, and then periodically attempting to initialize Steam. (I'm trying to do this for convenience while launching the app from the editor.)

I understand this is not a typical use case, but perhaps it exposes a potential crash in other situations. Also, maybe there's a better way of launching Steam from the editor and waiting for it to become available.

Here is a minimal project and the trace.

Steam Init Crash.zip

image

[0] Steam::steamInit (C:\Godot\Version 3.2\Steam Build\modules\godotsteam\godotsteam.cpp:62)
[1] MethodBind0R<Steam,Dictionary>::call (C:\Godot\Version 3.2\Steam Build\core\method_bind.gen.inc:325)
[2] Object::call (C:\Godot\Version 3.2\Steam Build\core\object.cpp:921)
[3] Variant::call_ptr (C:\Godot\Version 3.2\Steam Build\core\variant_call.cpp:1112)
[4] GDScriptFunction::call (C:\Godot\Version 3.2\Steam Build\modules\gdscript\gdscript_function.cpp:1086)
[5] GDScriptFunctionState::resume (C:\Godot\Version 3.2\Steam Build\modules\gdscript\gdscript_function.cpp:1852)
[6] GDScriptFunctionState::_signal_callback (C:\Godot\Version 3.2\Steam Build\modules\gdscript\gdscript_function.cpp:1822)
[7] MethodBindVarArg<GDScriptFunctionState>::call (C:\Godot\Version 3.2\Steam Build\core\method_bind.h:344)
[8] Object::call (C:\Godot\Version 3.2\Steam Build\core\object.cpp:921)
[9] Object::emit_signal (C:\Godot\Version 3.2\Steam Build\core\object.cpp:1217)
[10] Object::emit_signal (C:\Godot\Version 3.2\Steam Build\core\object.cpp:1275)
[11] SceneTree::idle (C:\Godot\Version 3.2\Steam Build\scene\main\scene_tree.cpp:564)
[12] Main::iteration (C:\Godot\Version 3.2\Steam Build\main\main.cpp:2028)
[13] OS_Windows::run (C:\Godot\Version 3.2\Steam Build\platform\windows\os_windows.cpp:3159)
[14] widechar_main (C:\Godot\Version 3.2\Steam Build\platform\windows\godot_windows.cpp:162)
[15] _main (C:\Godot\Version 3.2\Steam Build\platform\windows\godot_windows.cpp:184)
[16] main (C:\Godot\Version 3.2\Steam Build\platform\windows\godot_windows.cpp:196)
[17] __scrt_common_main_seh (d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[18] BaseThreadInitThunk
-- END OF BACKTRACE --
bug question

Most helpful comment

Well, can confirm that it crashes with that same error. Interesting. I'll definitely have to investigate as to why this happens. Thanks for the heads up!

All 9 comments

Well, can confirm that it crashes with that same error. Interesting. I'll definitely have to investigate as to why this happens. Thanks for the heads up!

No problem, hopefully nothing serious.

Perhaps not. Guess we'll find out!

Update: I misread the initial bug. SteamInit() works. So do functions like getLoggedOn() but getSteamId() doesn't on Windows. Works fine on Linux.

I also can confirm getSteamID() causes a crash. If I hardcode the steamId and use getFriendPersonalName() I can retrieve the name. I've read there can be issues in general with getSteamId via the steamworks discussions and using mingw https://steamcommunity.com/groups/steamworks/discussions/search/?gidforum=882962698564893826&include_deleted=1&q=getsteamid+crash

Supposedly compile this in Visual Studio fixes this but I just tried to test this and all the modules but godotsteam compile. Errors below:
[Initial build] Compiling ==> modules\godotsteam\godotsteam.cpp godotsteam.cpp C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(547): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(547): error C2146: syntax error: missing ')' before identifier 'items' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(547): error C3646: 'items': unknown override specifier C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(547): error C2059: syntax error: ')' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): error C2146: syntax error: missing ')' before identifier 'outputItems' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): error C3646: 'outputItems': unknown override specifier C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): error C3646: 'outputQuantity': unknown override specifier C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): warning C4228: nonstandard extension used: qualifiers after comma in declarator list are ignored C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): error C3646: 'inputItems': unknown override specifier C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): warning C4228: nonstandard extension used: qualifiers after comma in declarator list are ignored C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): error C3646: 'inputQuantity': unknown override specifier C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): error C2059: syntax error: ')' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): error C2086: 'bool Steam::uint32': redefinition C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): note: see declaration of 'Steam::uint32' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): warning C4228: nonstandard extension used: qualifiers after comma in declarator list are ignored C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(553): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(553): error C2146: syntax error: missing ')' before identifier 'items' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(553): error C3646: 'items': unknown override specifier C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(553): error C3646: 'quantity': unknown override specifier C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(553): error C2059: syntax error: ')' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(553): error C2086: 'bool Steam::uint32': redefinition C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): note: see declaration of 'Steam::uint32' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(553): warning C4228: nonstandard extension used: qualifiers after comma in declarator list are ignored C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(555): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(556): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(556): error C2061: syntax error: identifier 'uint32' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(557): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(557): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(558): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(559): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(560): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(563): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(566): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(569): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(569): error C2146: syntax error: missing ')' before identifier 'items' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(569): error C3646: 'items': unknown override specifier C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(569): error C3646: 'quantity': unknown override specifier C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(569): error C2059: syntax error: ')' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(569): error C2182: 'uint32': illegal use of type 'void' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(569): error C2371: 'Steam::uint32': redefinition; different basic types C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(552): note: see declaration of 'Steam::uint32' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(569): warning C4228: nonstandard extension used: qualifiers after comma in declarator list are ignored C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(570): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(570): error C2061: syntax error: identifier 'uint32' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(571): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(574): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(575): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(576): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(577): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(577): error C2061: syntax error: identifier 'uint64_t' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(578): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(582): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(582): error C2061: syntax error: identifier 'uint32' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(583): error C2061: syntax error: identifier 'uint32' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(592): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(593): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(594): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(594): error C2061: syntax error: identifier 'uint64_t' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(595): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(596): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(597): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(598): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(599): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(600): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(601): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(601): error C2061: syntax error: identifier 'uint64_t' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(602): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(603): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(604): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(605): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(605): error C2061: syntax error: identifier 'uint64_t' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(606): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(607): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(608): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(609): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(610): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(611): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(612): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(612): error C2061: syntax error: identifier 'uint64_t' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(613): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(613): error C2061: syntax error: identifier 'uint64_t' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(664): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(666): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(667): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(668): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(671): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(671): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(671): error C2146: syntax error: missing ')' before identifier 'data' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(671): error C3646: 'data': unknown override specifier C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(671): error C2062: type 'int' unexpected C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(682): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(683): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(683): error C2061: syntax error: identifier 'uint64_t' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(684): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(684): error C2061: syntax error: identifier 'uint64_t' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(685): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(685): error C2061: syntax error: identifier 'uint32' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(686): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(687): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(688): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(688): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(689): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(690): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(691): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(694): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(695): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(696): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(696): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(697): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(698): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(699): error C2327: 'Steam::uint32': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(700): error C2327: 'Steam::uint64_t': is not a type name, static, or enumerator C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(703): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(703): error C2143: syntax error: missing ',' before '&' C:\Users\agent\git\godot\modules\godotsteam\godotsteam.h(703): fatal error C1003: error count exceeds 100; stopping compilation scons: *** [modules\godotsteam\godotsteam.windows.opt.tools.64.obj] Error 2 scons: building terminated because of errors.

Weirdly enough, that link shows 13 results but no actually show up. Had to search it in the actual group in the Steam client.

That big blob of errors is after you made some changes? What did you change? The block is hard to read.

Seems like MinGW is back causing issues again. I'll read through the issues and see if there is a fix but it doesn't look great from what I'm reading.

Thanks for the head's up!

I apparently suck at markdown and couldn't figure out how to put that code in a nice scrollbox.

So far I've only had an issue with getSteamId but it's kind of an important one. Those errors are just from me using scons on windows with Visual studio.

scons p=windows vsproj=yes target=release_debug tools=yes

Visual Studio isn't my thing (or windows for that matter) but for VR I need to support windows. I don't really understand my Visual Studio has such a hard time with basic things like uint32. It seems to imply Steam::uint32 so doing ::uint32 seems to fix it but that's only one portion of the VS confusion. If I figure out it's a compiler switch or something I'll report back. I would much rather compile on Linux so I'm reluctant to put too much time into catering to VS.

Do you know of any workarounds in the meantime?

Haha, it's all good. I do it myself every so often.

Yeah, the getSteamID things shows up before but we didnt' have any leads until now. Always with MinGW.

I usually tell people to install the native command prompt tools instead of using the editor. Less fuss and more like Linux terminal. It should be an option in the VS installer components. Since then I never even open the VS editor.

This is also solved by the null check from bbb2f039714af5208b26852c522768c2b05c0d11.

Must of been really busy, can't recall why I didn't do an inspection on this.

Haha, you and me both, sir!

Was this page helpful?
0 / 5 - 0 ratings