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

Crashes with large libraries #18

Open
seavord opened this issue Apr 6, 2024 · 30 comments
Open

Crashes with large libraries #18

seavord opened this issue Apr 6, 2024 · 30 comments
Assignees
Labels
bug Something isn't working testing Testing is in-progress

Comments

@seavord
Copy link

seavord commented Apr 6, 2024

i have over 3500 games and it seems to crash as soon as it hits 2500 games

@syntax-tm
Copy link
Owner

Can you upload the error log file? Should be in the logs subdirectory.

I know people with similar library sizes didn't run into any issues but who knows maybe something changed

@syntax-tm syntax-tm self-assigned this Apr 7, 2024
@syntax-tm syntax-tm added the bug Something isn't working label Apr 7, 2024
@seavord
Copy link
Author

seavord commented Apr 7, 2024

errors.txt

@seavord
Copy link
Author

seavord commented Apr 7, 2024

there you go

@syntax-tm
Copy link
Owner

syntax-tm commented Apr 16, 2024

@seavord When you get the chance, can you please try with this version? I also updated the logging to hopefully provide more information so if there is still an issue if you could include the new logs that would be great. Thanks!

https://github.com/syntax-tm/SteamAchievementManager/releases/tag/v0.6.0-alpha

@syntax-tm syntax-tm added the testing Testing is in-progress label Apr 16, 2024
@DerekTurtleRoe
Copy link

I have a little under 10,000 games in my library and I also get a crash after it finishes loading about 3900 of the game names, I included both generated logs here:

errors.txt
log.txt

This was generated using the 0.6.0 alpha provided above.

@syntax-tm
Copy link
Owner

Okay looking at the errors I'm guessing that you're getting blocked by the Steam store API. Theoretically, if you wait and start the app eventually it will have cached all of the store information. The version doesn't matter as they all save that cache to %LOCALAPPDATA%\SAM.

You could try and delete the stuff that's there (I would move it in case you still need it to pick up where it last left off). It's possible that it crashed in the middle of writing one of those files and they're no longer valid.

I can also, just for you, make a debug build with the store stuff disabled if you want to try that? Would take me a few minutes but should be doable. That would at least tell us if the store data is the issue or not. I want to say that I automatically retry if you get a 429 (Too Many Requests) and if they're just blocking you that would likely be a 401 or 403.

@syntax-tm
Copy link
Owner

syntax-tm commented Apr 17, 2024

I tried to upload it but the limit on GitHub is 25 MB and the zip is 67 MB. So, I put it on my OneDrive here.

@DerekTurtleRoe
Copy link

I tried to upload it but the limit on GitHub is 25 MB and the zip is 67 MB. So, I put it on my OneDrive here.

That build works fine for me! So I think it might've been exactly what you said. 😄

@seavord
Copy link
Author

seavord commented Apr 18, 2024

@seavord When you get the chance, can you please try with this version? I also updated the logging to hopefully provide more information so if there is still an issue if you could include the new logs that would be great. Thanks!

https://github.com/syntax-tm/SteamAchievementManager/releases/tag/v0.6.0-alpha

crashes after 8000 games

I tried to upload it but the limit on GitHub is 25 MB and the zip is 67 MB. So, I put it on my OneDrive here.

crashes after 4000 games

still not sure why its crashing so much it seems to crash after 18%

edit: getting this in logs

"SAM: 2024-04-18 23:49:20,225 [1] INFO App [(null)] - Application startup.
SAM: 2024-04-18 23:49:29,164 [1] WARN SAM.Core.LocationHelper [(null)] - Unknown location format ('United Kingdom (Great Britain)'). Location will not be shortened.
SAM: 2024-04-18 23:49:29,500 [1] INFO HomeViewModel [(null)] - HomeViewModel Loaded
SAM: 2024-04-18 23:49:36,016 [1] INFO App [(null)] - Application startup.
SAM: 2024-04-18 23:49:43,280 [1] WARN SAM.Core.LocationHelper [(null)] - Unknown location format ('United Kingdom (Great Britain)'). Location will not be shortened.
SAM: 2024-04-18 23:50:55,489 [1] INFO App [(null)] - Application startup.
SAM: 2024-04-18 23:50:58,310 [1] WARN SAM.Core.LocationHelper [(null)] - Unknown location format ('United Kingdom (Great Britain)'). Location will not be shortened.
SAM: 2024-04-18 23:50:58,644 [1] INFO HomeViewModel [(null)] - HomeViewModel Loaded
"

@syntax-tm
Copy link
Owner

Hey @seavord, that warning is not relevant. It's just saying that your location is either too few or too many comma-separated segments to be able to shorten it (in this case it's too few since it's only one segment). If you're curious this is the relevant bit of code that logs the warning:

var segments = location.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);

if (segments.Length is < 2 or > 3)
{
    // if it's anything else don't bother trying to shorten it
    log.Warn($"Unknown location format ('{location}'). Location will not be shortened.");
    return;
}

Currently nothing actually uses that profile info it's just loaded automatically on startup.

Anyways, there should be a separate log file just for errors called errors.txt that'll be in the same folder as log.txt. If it's missing or empty then you're going to have to check the Windows Event Viewer.

You can ping me on Discord if you want help looking into it (@Gundwn).

@seavord
Copy link
Author

seavord commented Apr 19, 2024

event viewer says

Application: SAM.exe
CoreCLR Version: 7.0.1724.11508
.NET Version: 7.0.17
Description: The process was terminated due to an internal error in the .NET Runtime at IP 0x79F803C6 (0x79ED0000) with exit code 0x80131506.

and

Faulting application name: SAM.exe, version: 1.0.0.0, time stamp: 0x65ce0000
Faulting module name: coreclr.dll, version: 7.0.1724.11508, time stamp: 0x65ce991a
Exception code: 0xc0000005
Fault offset: 0x000b03c6
Faulting process ID: 0x0xC7E4
Faulting application start time: 0x0x1DA927766DD7374
Faulting application path: SAM.exe
Faulting module path: Fcoreclr.dll
Report ID: ec21b439-3694-4bf0-8e00-fabd9364388f
Faulting package full name:
Faulting package-relative application ID:

weirdly enough after loading the second one then loading the 1st again it now loads albiet keeps freezing but the progress has gone up, but trying to load just loading the 1st then the 2nd it crashes, so somehow i have to load the second then the first ...

@seavord
Copy link
Author

seavord commented Apr 19, 2024

nvm as soon as i clicked the window it crashed lol

@syntax-tm
Copy link
Owner

I'm almost done with a big update that should hopefully fix a lot of things. I'll try to get it done today.

@syntax-tm
Copy link
Owner

@seavord Any chance you'd be down to try the new changes? I've rewritten a lot of things so I apologize for the delay. It'd be nice if someone, or a few people, would be willing to try it before I made a new release to make sure I didn't miss anything.

@DerekTurtleRoe
Copy link

DerekTurtleRoe commented Jun 2, 2024

It crashes when loading ROMs for me for some reason, It seems to be when starting to render the images...

I attached logs here:

errors.txt
log.txt

@psy0ch
Copy link

psy0ch commented Jun 7, 2024

Hi, noticed your update. Thank you so much for continuing this project :)
Just tried it out and it loads my library of ~13k games very fast. During the first usage it worked fine for some time. I opened some games and it seemingly worked. After like a minute it crashed.
Reopening it lets it load the library but now crashes very fast after that.
Unfortuntely the errors.txt is empty, log.txt just says "Application startup."

@syntax-tm
Copy link
Owner

@psy0ch Hmmm, you could try deleting the cache. If you go to %LOCALAPPDATA%\SAM you can delete everything in there and see if that fixes it.

Chances are one of the files that was being cached got interrupted when the app crashed. I'll look into making it more resilient and taking that into account because currently it just assumed the file is valid if it exists.

@syntax-tm
Copy link
Owner

%LOCALAPPDATA%\SAM is C:\Users\USER_NAME\AppData\Local\SAM where USER_NAME is your Windows user name. You can paste the %LOCALAPPDATA% in file explorer and it'll open it. Also works in the Run dialog (Win + R).

@psy0ch
Copy link

psy0ch commented Jun 8, 2024

Cleared the folder and let the program reload. Sadly it still leads to a crash and the log+error files are still without any information.

@syntax-tm
Copy link
Owner

@psy0ch Is there anything in the Windows Event Viewer? Either in Administrative Events or Application (under Windows Logs).

If not, any chance you have Visual Studio installed? 😄

@Billerens
Copy link

Billerens commented Jun 9, 2024

@psy0ch Is there anything in the Windows Event Viewer? Either in Administrative Events or Application (under Windows Logs).

If not, any chance you have Visual Studio installed? 😄

I have VS installed. Also 4k+ library crash :_)

debug.log

@syntax-tm
Copy link
Owner

@Billerens If you have VS installed (you'll need 2022) you should be able to build and then run this so long as you have the .NET 8 SDK installed. Really even VS Code should work but this will likely need the VS debugging tools since you might need to change the exception settings to break on any exception.

Also, thank god for Google translate because otherwise I wouldn't be able to read any of that log.

@psy0ch I updated the build.yml workflow to build SAM in Debug configuration (releases will be Release) so there should be additional details about errors in the log file(s).

Build #113

@syntax-tm
Copy link
Owner

@Billerens @psy0ch I figured it out.

I only have 300-400-ish games but I had the idea to just add them multiple times. When I did, I got the same crashing behavior. Turns out the crash was caused by an OutOfMemoryException from the thousands of games having the header image in memory. SAM is 32-bit since it's using the x86 steamclient.dll so the memory is limited to you have roughly a <2GB limit. So, I swapped those to just be a Uri and the Image Source is just bound to that. Long story short, it works now. There's still a theoretical limit on the number of apps but it should be much much higher and would depend on the length of your Windows username, how many Grid images you have set, etc.

image

With 2,870 games it's only using ~200MB.

image

It is super laggy though with this many games so I'll see what I can do about that. Should just be a virtualization thing with the view. Either way, that'll be my next priority when I get time.

@syntax-tm
Copy link
Owner

You guys have too many games too fyi.

@syntax-tm
Copy link
Owner

Let me know if this works for you if you get a chance.

https://github.com/syntax-tm/SteamAchievementManager/releases/tag/v0.7.0-alpha

@psy0ch
Copy link

psy0ch commented Jun 10, 2024

I used the debug build from the latest build "SAM_debug_24.06.10.114" - no crashes so far.
Uses ~200MB for ~13K games.

But you are completely right. Those images make the program quite slow to use.
Maybe a toggle to disable this would be great?

Attached the errors.txt (this process just kept going with 429s. I decided to close it so that the file doesn't get EVEN bigger than it has to be).
errors.txt

@syntax-tm
Copy link
Owner

Oh that's from the Steam Web API rate limiting you. There's a few fixes. Easiest one is waiting. The better solution is to download your own grid images and SAM will load those automatically and won't need to download the image from the CDN.

SteamGridDB (Setup)

All that app does by the way is just download and save the images to your Grid folder. This is what mine looks like for reference.

image

For the apps you see in errors.txt if you find cool Grid images for them that's what it'll use. It's annoying but a lot of games don't have header images set so it has to download them from the web and that's why you get rate limited with your 13k games.

Note

Animated images aren't supported, yet. I have a bunch set too because they look cool in Steam, but WebP and animated PNG (APNG) can't be loaded the same way normal images are. If GIFs are supported then I can probably just convert them to a GIF and load that. Either way, animated ones won't load.

@syntax-tm
Copy link
Owner

The Grid thing is worth doing either way. Can make your tiny 13k Steam library or more realistically your favorite collections or games look nice.

@psy0ch
Copy link

psy0ch commented Jun 10, 2024

Yeah I was familiar with the rate limit, just thought of letting you know with the log.
But the manual downloading of the grid is a neat thing that i didn't know. Will give it a look.
Thank you again for your work :)

@syntax-tm
Copy link
Owner

No problem! The grid thing isn't in the old one I think I added it like a month ago. Was supposed to mitigate the rate limiting but also I wanted my grid images to show up. For reference, this is the order that images are loaded:

  • User's Grid (userdata\STEAMID\config\grid)
  • Steam's AppCache (appcache\librarycache)
  • Steam CDN (https://cdn.cloudflare.steamstatic.com/steam/apps/APPID/header.jpg)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing Testing is in-progress
Projects
Development

No branches or pull requests

5 participants