Game random crash on a start

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Sasha264
Party member
Posts: 131
Joined: Mon Sep 08, 2014 7:57 am

Game random crash on a start

Post by Sasha264 »

Hi everyone :oops:
Waited for a few months before asking this, and now is the time, because I found nothing :ehem:

I have a relatively complex game on love 11.2 (or 11.3 no difference for that aspect).
I am running it through SublimeText Ctrl+B that executes love.exe with folder parameter.
It runs correctly in approximately 49 from 50 runs (with no change in code (or sublime settings or whatever) between runs).
And in 1 run from 50 I have this:
  • game 'loads' correctly as I see with my custom console output, no warnings no errors
  • then I see a pure white window for a few seconds
  • then game crashes, sometimes with no output, sometimes with following output:

Code: Select all

Loaded 'current' in 0.18 seconds
Detected refreshrate 60 Hz
Loaded in 1.36 seconds
[Finished in 5.0s with exit code 3221225477]
[cmd ['D_repoMegaFactorycode_buildlove-win64love.exe', 'D_repoMegaFactorycode']]
[dir D_repoMegaFactorycodejournal]
[path CProgram Files (x86)Common FilesOracleJavajavapath;CProgram Files (x86)Common FilesIntelShared FilescppbinIntel64;CProgram Files (x86)Razer Chroma SDKbin;CProgram FilesRazer Chroma SDKbin;CWINDOWSsystem32;CWINDOWS;CWINDOWSSystem32Wbem;CWINDOWSSystem32WindowsPowerShellv1.0;CProgram FilesGitcmd;CProgram FilesMicrosoft Windows Performance Toolkit;CProgram FilesMicrosoft SQL Server120ToolsBinn;CProgram FilesMicrosoft SQL Server130ToolsBinn;CProgram Files (x86)Lua5.1;CProgram Files (x86)Lua5.1clibs;CProgram Files (x86)NVIDIA CorporationPhysXCommon;CProgram FilesLua;CProgram Files (x86)Lua5.1;CUsersUserAppDataLocalMicrosoftWindowsApps;CProgram Files (x86)GtkSharp2.12bin;CWINDOWSsystem32;CWINDOWS;CWINDOWSSystem32Wbem;CWINDOWSSystem32WindowsPowerShellv1.0;CWINDOWSSystem32OpenSSH;CProgram FilesMicrosoft VS Codebin;CProgram FilesNVIDIA CorporationNVIDIA NvDLISR;CProgram FilesLua;CProgram Files (x86)Lua5.1;CUsersUserAppDataLocalMicrosoftWindowsApps;CProgram FilesMicrosoft VS Codebin;CUsersUserAppDataLocalGitHubDesktopbin;%USERPROFILE%AppDataLocalMicrosoftWindowsApps;]
I googled 3221225477 and found this:

Code: Select all

3221225477 converted to hex is 0xC0000005, which stands for STATUS_ACCESS_VIOLATION, which means you tried to access (read, write or execute) invalid memory.
And this happening only with this particular game, so it is lua-code-related.
And when I concatenate love.exe with zipped folder to obtain mygame.exe and then run it, I have not noticed that behaviour, but maybe I just did not do this enough times.
I have no clue how to find the source of that error?
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Game random crash on a start

Post by ReFreezed »

Does the game freeze with the white window during a specific function call? Did you try running the game through cmd.exe instead of Sublime?

Maybe try printing something before each operation that interacts with the system (like loading an image, iterating over folder items or resizing the window) to see if the problem happens in the same place. (You can easily monkey patch all the functions in the love table. Make sure buffering is disabled for STDOUT and STDERR too.) Try using a different computer to see if the problem is maybe just on your computer.

After some googling, I think using a debugger may possibly be necessary to find the actual problem, which I'm assuming is in LÖVE, SDL, or some other part of the framework rather than in your code (unless you're using FFI or something in a bad way).
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
duaner
Prole
Posts: 41
Joined: Thu May 07, 2020 6:43 pm
Contact:

Re: Game random crash on a start

Post by duaner »

I don't think you've got exactly the same symptoms I did. However, the last time I ran into a random crash like that, it turned out that I was starting the game before my editor had actually finished saving it. Love was trying to run the project with a missing or partial file (with hilarious consequences).

The real problem was my ssd going into sleep mode unnecessarily, delaying the write. After fixing that, the problem went away.
User avatar
Sasha264
Party member
Posts: 131
Joined: Mon Sep 08, 2014 7:57 am

Re: Game random crash on a start

Post by Sasha264 »

ReFreezed wrote: Sat Jun 20, 2020 7:28 pm Does the game freeze with the white window during a specific function call?
Judging by my console output that happens after all initial loading, so there is no specific function...
Did you try running the game through cmd.exe instead of Sublime?
It is hard to tell, because it happens really rare and I can not reproduce it deliberately with cmd...
Make sure buffering is disabled for STDOUT and STDERR too.)
That is a really good advice =)
After some googling, I think using a debugger may possibly be necessary to find the actual problem, which I'm assuming is in LÖVE, SDL, or some other part of the framework rather than in your code (unless you're using FFI or something in a bad way).
No FFI mess on my side.
Debugger? What debugger? How?
duaner wrote: Sat Jun 20, 2020 9:00 pm I don't think you've got exactly the same symptoms I did. However, the last time I ran into a random crash like that, it turned out that I was starting the game before my editor had actually finished saving it. Love was trying to run the project with a missing or partial file (with hilarious consequences).
The real problem was my ssd going into sleep mode unnecessarily, delaying the write. After fixing that, the problem went away.
Maybe that was exactly the point. Because now (for month or so) I can not reproduce that at all. And there was no significant code change... But no hardware change also. Maybe some drivers, I don't know =)
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Game random crash on a start

Post by ReFreezed »

Sasha264 wrote: Sat Aug 22, 2020 2:31 pm Debugger? What debugger? How?
I meant a debugger like, for example, the the one that comes with Visual Studio - for debugging C/C++ (i.e. not a "Lua debugger"). I mentioned a debugger because it would probably help pinpoint what part of the framework that causes the memory-related STATUS_ACCESS_VIOLATION error. It's a big topic and I can't say much more than that.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
Sasha264
Party member
Posts: 131
Joined: Mon Sep 08, 2014 7:57 am

Re: Game random crash on a start

Post by Sasha264 »

So, to do that I must run Love2d from source in debug mode and try to reproduce that error... Sounds hard =)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 32 guests