britzl / steamworks-defold

Steamworks support for Defold using the Defold extension system
34 stars 6 forks source link

Steamworks should not crash when attempting to use it when Steam is not running / Steamworks has been finalized #19

Closed subsoap closed 4 years ago

subsoap commented 4 years ago

Tested on Windows 10

If you try to get persona name while Steam is not running it will crash.

If you try to use Steamworks functions after calling steamworks.finall() accidentally it will crash.

The way the extension is generated dealing with this may be really annoying to do though since I think every function would need to know if Steam is running or not first?

At least it's important to know the pitfalls and not make dumb user mistakes. 😇

britzl commented 4 years ago

It should be quite easy to add this since it is generated code. And if some functions shouldn't have a check that's also something that is easy to add as exclusions.

subsoap commented 4 years ago

We've had more

Assertion failed: i < Size(), file D:\a\defold\defold\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h, line 429

Even though we have checks to make sure Steam is running. There might be other cases it happens like possibly if an achievement id is wrong.

subsoap commented 4 years ago

I think just having steam.update() happen in update of a script can cause crashes sometimes too. I'm not 100% sure on that, but it's the only real difference between Dire and our previous games when using this extension and they didn't crash, so I'm disabling it and will see if we get any more crash reports related to achievements.

The symbols in this post will probably be helpful https://github.com/defold/defold/issues/5158

subsoap commented 4 years ago

Had it crash even with steam.update() disabled so probably not related to that.

Assertion failed: i < Size(), file D:\a\defold\defold\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h, line 429

subsoap commented 4 years ago

We are reverting to Steamworks 1.4.1 which appears to not cause crashes in the same situation (at least for us, I'll push a build public and see if users crash still). I'll try making a stand alone project for latest version and see if I can get it to crash. But it may be related to loading a lot of resources in some way too since it seems to happen when unlocking an achievement + loading a new screen.

subsoap commented 4 years ago

I've tried with standalone project but I can't get it to crash with the latest version and only unlocking achievements. It must be some interaction.

subsoap commented 4 years ago

Just had a crash report on the latest version. Not sure what's up, and I don't think proper engine crashes are being created either as I realized that the one I was sent is from the 4th not not today. Still investigating and trying to get full info.

subsoap commented 4 years ago

Confirming today that when this crash happens

Assertion failed: i < Size(), file D:\a\defold\defold\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h, line 429

No new crash dump appears in %APPDATA%\Defold

@jcash how would you suggest we try to debug this? It does crash on my computer though rarely.

Since it still happens with the older Steamworks extension (1.4.1) occasionally we're going to try and disable the Steamworks extension entirely to see if it ever still happens.

subsoap commented 4 years ago

It crashed with Steamworks extension disabled! So it's not even related to that and was only incidental that we were seeing it happen when achievements were popping.

Same error again

Assertion failed: i < Size(), file D:\a\defold\defold\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h, line 429

The situation the game is in is lots of particles are playing and then you can press continue to load a new screen. We're going to disable the particles next to see if they are making an impact.

subsoap commented 4 years ago

Current suspects, we are still trying to test. It felt random before so for now we just have to test a lot and see if it crashes after these changes.

2020-09-10 17_24_41-Sourcetree

It's possible there is a bug in our code where dismissed notifications can still be attempted to be disabled / stopped / deleted in some weird way that is causing a crash, not sure yet still.

JCash commented 4 years ago

I suggest you build with debug symbols, then run the app through Visual Studio. Make sure that it finds/loads the symbols (the dmengine.pdb), and that you can set breakpoints and that you can see the code.

That should give you a much better callstack.

subsoap commented 4 years ago

Today I tried with the project in the state where it was crashing before but couldn't get it to crash in VS yet. I will keep trying running it through VS with the debug symbols there periodically until I can get the better callstack.

subsoap commented 4 years ago

@JCash We managed to isolate the issue and it's similar to one we reported / thought was fixed back with FSH. I got it to crash in VS but even with the debug symbols included it wanted abort.cpp to get stack trace. I'm sending you the project on the forum a zip. Let it run for ~10 cycles and it should crash. It seems like even with this minimal project a proper crash dump is still not being created.

subsoap commented 4 years ago

Closing this issue since it's unrelated to Steamworks and a sample project has now been created

britzl commented 4 years ago

It's great that you managed to create a repro case! We'll look into it!