Pauan / SaltyBetBot

Bot which automatically bets on saltybet.com
39 stars 12 forks source link

Chrome crashing when using bot #16

Closed spaghetti-guy closed 4 years ago

spaghetti-guy commented 4 years ago

I'm creating a new issue for this, though my behavior is similar to #9. I just don't want to re-open that issue when the OP's original post was 2 months ago with no clear info.

I was having issues with Chrome crashing a little over 2 days ago (I was on an old build of unknown date) so I did a fresh install after the "Fixed bug with IndexDB" (ca8bb2ce17ebfe716c13e5e100d5c4b5ecf3c17b) commit. The bot worked on that commit until about 3 hours ago when I opened my laptop to see that Chrome had crashed. I tried to reopen Saltybet, but Chrome would crash when:

I did a pull (latest commit "The bot now bets..." (62b92b34084b1131c7707491bd5f1bc195f18f27)) and the issue remains the same.

I've tried watching the console of both the extension popup and the Saltybet page console, but Chrome crashes too quickly to see any output. Same as OP of #9 , I verified the bot works in Brave. In Chrome, I have tried clearing the cache to no avail. I've also monitored Windows's task manager as well as Chrome's while launching mugen.saltybet.com. Before crashing, I do not see any large change in memory usage, though my laptop fans do spin up pretty loudly.

For reference: CPU - i7-5600U RAM - 8GB Chrome version - 79.0.3945.117

Pauan commented 4 years ago

Thanks for the detailed info!

8 GB is a little low in RAM, but that should be enough (assuming you aren't running a lot of other programs/tabs in the background). How much unused RAM do you have when you start the bot?

Does it work if you completely uninstall the bot and reinstall it from scratch (with the latest change)?

spaghetti-guy commented 4 years ago

I had between 4.5GB and 5.0GB.

Just did a fresh install per your recommendation and it seems to be working now. I'll close this issue for now and will reopen it if the bot breaks after a couple days like last time.

Unrelated, when the bot is crashes while trying to export records, is there a way to manually export them on my computer? I noticed the record files in the static folder don't actually get updated automatically, so I'm guessing the data is stored elsewhere until an export is done. Can I grab my records from somewhere else and manually merge them?

Pauan commented 4 years ago

Unfortunately not, the only way to access the records is to Export them. For security reasons, Chrome doesn't allow for writing files.

spaghetti-guy commented 4 years ago

The bot was running fine after my last comment. I came home from work about 18 hours later and saw the bot had crashed again. Now, the bot is crashing in the same way I mentioned in my original post (loading site, trying to export, etc.).

I enabled verbose logging in Chrome and grabbed 2 crash logs: one upon loading the saltybet site, one upon trying to export records. Both are captured from a session launched with the "--incognito" flag, and I verified all other extensions were disabled. I stripped my Windows username and email address from the logs, but they are otherwise unmodified.

Export Attempt.log Loading SaltyBet Site.log

Pauan commented 4 years ago

Thanks! That's really helpful.

Unfortunately, I don't see anything that stands out. It seems that as soon as it tries to load the records it just crashes, there's no errors or out of memory or anything like that. I've never had that happen.

Does it crash if you leave it open for 1-2 days with the bot uninstalled?

I'm starting to suspect it might be a hardware failure. You should do a check to verify that your harddrive is in good condition: https://docs.microsoft.com/en-us/previous-versions/technet-magazine/ee872425(v=msdn.10)?redirectedfrom=MSDN

Also check your RAM as well: https://www.cnet.com/how-to/test-your-ram-with-windows-memory-diagnostic-tool/

Also, how much spare harddrive space do you have?

spaghetti-guy commented 4 years ago

Thanks for checking the logs. Chkdsk and the memory test both came back without errors. Free space on my drive is about 116 GB (it's a 256 GB SSD). I appreciate the thoroughness of your troubleshooting ideas. I work in IT and more than once I've been a victim of struggling with a software issue when the culprit was hardware.

Last night before bed, I left Chrome running with a few random tabs open as well as Brave with the bot running. I just got home from work and Brave had crashed but Chrome was still running. Brave is now crashing when loading the SaltyBet site or trying to export records just as Chrome was in my first post.

One thing I forgot to mention is that after the fresh installs I was also importing my old records file, which is about 136 MB. Because I'm not sure what else I can do to troubleshoot, I am going to try a fresh install without importing my records and leaving the bot running to see what happens. Maybe 8 GB RAM isn't enough for a record file that large?

If you have any other troubleshooting ideas, I'm happy to listen and test. If not, I will report back and close the issue if the bot is running fine without my original records.

Pauan commented 4 years ago

The default records are 133 MB, and judging by the logs your computer can handle that.

So it's possible that there is some corruption in your old records which is causing the issue. If you could send those records to me, that would be great.

One more thing: are you using a 32-bit or 64-bit OS? Even if you have 8 GB of RAM, a 32-bit OS can only use ~4 GB of RAM max.

spaghetti-guy commented 4 years ago

Sure, I'll attach them here. I'm using Windows 10 64-bit. SaltyBet Records (2020-01-08T07_13_59.530Z).zip

Cillu commented 4 years ago

Hey guys, it's unlikely that its a hardware failure at this point as I am now also experiencing the same issues as OP.

Here are the specs: OS: Windows 10 Enterprise 1909 CPU: i7 8700K Memory: 64GB Disk1 (SSD): 500GB w/ 148GB free Disk2 (HDD): 2TB w/ 1.71TB free

I'll attach the last records I've exported before updating.

SaltyBet Records (2020-01-07T16_22_45.856Z).zip

Update: Just for testing purposes, I deleted all match records to see if it would crash again and it didn't; I can load saltybet and the records now without an issue. This leads me to believe that the crashes happen due to the corrupt records file.

Pauan commented 4 years ago

Just today my Chrome started crashing too. It never did that before. So it seems that Chrome itself is buggy, possibly caused by a recent update.

Since I can now reproduce this, I have a chance to actually fix it. Thanks for all of your help so far.

Pauan commented 4 years ago

So it seems that Chrome simply cannot handle the large amount of data from the records. This is indeed a bug in Chrome, so I'll need to change some things to workaround it.

Pauan commented 4 years ago

I released a new version which fixes the crash. I needed to completely rewrite how it stores the records, but now it should work reliably no matter how much data there is. As a bonus, it now loads the data ~7 times faster.