Windows app resize crash

I have an app that runs in the Solar2D simulator just fine. Works well on iOS, Android, and Mac desktop. A Windows desktop build runs well at first but crashes on resize after a few adjustments (within 5 seconds of “continuous” resizing). The Mac version has identical options and resizes without issues. The Windows crash is complete: the app disappears with no error message, and it is not running in the background. Any ideas on what might be causing this? Any ideas on a workaround?

Just now I tried a barebones app: a blank app created by the “New Project” tool with a windows section added to build.settings as follows:

	window =
		defaultMode = "normal",

		resizable = true,

		enableCloseButton = true,
		enableMinimizeButton = true,
		enableMaximizeButton = true,

		titleText =
		   default = "ResizeTESTING",

I build this for Windows with standard settings. When I run the compiled app, if I grab the lower right resize corner (diagonal, double-arrow cursor) and “swirl” it around a few times, the app “stutters” and then crashes hard.

Thanks in advance for any ideas.

Well, without seeing any code related to your resize event listener, it’s difficult to make any sort of guesses. There could be some API call that isn’t supported on Windows or there’s some file access error.

Please read my original post again. THERE IS NO OTHER CODE. It’s an absolutely empty app (except the skeleton provided by “New Project”) and one line that does print('Hello, World') to console in the main code --just to make sure it’s running. The only unique settings are found in build.settings as listed in my original post. That’s all there is – the entire app.

Sorry about that then. I tried running exactly that and I encountered no issues on my Windows machine, that’s why I assumed that there must have been more code that was causing the crash.

What version of Solar2D are you running?

You could open up your event viewer in Windows and look at Windows Logs > Application, and see if there’s a mention of your app when it crashes.

A few other things that you can do are:

  1. Try to show runtime errors, Solar2D Documentation — Developer Guides | Basics, this may or may not work if the app crashes right away.
  2. Create an unhandledError listener, Solar2D Documentation — API Reference | Events | unhandledError, and have it send the error message and stacktrace somewhere outside of the app so that you can view it even after the app has crashed.

I did wax on and wax off while resizing the window and couldn’t replicate the issue either.

In addition to the Solar2D version Xedur asked, what version of Windows and graphics card specs?
Also, are your graphics drivers up to date?

The stuttering when resizing, especially on an empty project, definitely not normal.

Couldn’t replicate either on my Windows 10 machine. Both with an empty project and the (relatively) big one we’re working on. Still, even if it’s a rare thing that only happens on some specific hardware/software combinations, this sounds quite serious and would be great to fix if further details are discovered.

Absolutely. If there’s a situation where some software and/or hardware causes Solar2D to crash on Windows following a resize event, it needs to be sorted out.

Seems like this will be more difficult to pinpoint, however, since others can’t reproduce the issue.

Thank you, XeduR. You and the other respondents have at least convinced me that it’s unique to my system in the sample so far. I should have tried a few more Windows installations myself [but you know… that means getting up and walking down the hall :wink: ].

The Solar2D version is recent: 3686. Plus this seems like a very low level problem, and I can’t imagine it’s something that’s subject to any breaking changes in Solar2D, especially given the secondary priority of Windows builds. Do Solar2D Windows builds have any other dependencies? VisualStudio maybe?

The low probability of hitting this bug is “good news”, but it suggests a certain “fragility” to the whole house of cards.

Thanks again.

Thank you, Siu, for trying out the test, and I appreciate your reference: yes, it’s a “wax-on/wax-off” motion of the two-dim resize that crashes it :). Of note, grabbing the window height resize and flailing around with that motion does not crash it. Grabbing width resize and going crazy does not lead to a crash either. It’s only the corner 2D resize that leads to a crash.

The most likely culprit is a graphics card or video driver issue as you suggest. I tried updating to newer drivers. Now it crashes a little faster. So… progress! :). But even though the circumstances are rare that still seems like un-necessary fragility. I can’t sell apps and then tell my customers, “aw yeah, your computer is at fault if my app doesn’t run.”

You wrote: “this sounds quite serious”. Yeah, and that’s why I decided to post about it. This isn’t something that I can work around with a little lua code. It’s deep in there. And an app that just vanishes off the screen with no warning and no opportunity to recover could be a real problem.

Thanks again for your reply.

1 Like

@fer5, we understand how you feel, this is why we’re getting involved. :slightly_smiling_face:

If you were missing any Solar2D requirements the app would notify you, namely .net framework and OpenGL supported graphics card.

  1. Are you running Windows 10 or 11?
  2. Are you running on a physical machine or VM?
  3. Are you using Intel or AMD, and what’s the model?
  4. How much RAM does your machine have?

For the sake to rule things out, can you upload here the empty test build you made?


  1. Win 10 (Home)
  2. physical machine (Dell G7 7500 laptop)
  3. Intel i7-10750H
  4. 16G ram

Code and build attached, as you requested. I do suspect a video driver issue, but nothing else has crashed like this in the 18-ish months that I have been using this laptop. And similar trivial cross-platform apps created with Flutter and Xojo show no unusual behavior and do not crash when subjected to the same resize testing. So… still weird.

Thanks again for your reply. (2.6 MB)

I decided to make a screen cap of the crash event. I loaded up ScreenToGif (from screentogif[dot]com). Then ran the app. And it wouldn’t crash. A Miracle. Did a new video driver finally somehow fix things?! So I rebooted… Nope. Still crashes, and quicker with the new drivers than previously. Here it is in action in an animated GIF… Note that although my mouse passes over the “close” button, I did not click it. The app crashed and vanished without interaction shortly after that.


Tried your project and nothing crashed. Try booting windows into VGA mode to rule out
graphics drivers. If it works fine then the problem is your drivers.

Definitely something funky going on.

At this point the issue seems to be isolated to your machine.

Going to share a few things you might or might not already know…

NVIDIA uses Optimus on laptops to switch between Intel’s GPU and NVIDIA’s GPU (discrete).

Solar2D doesn’t force itself on discrete graphics cards, thus by default it’ll run on the integrated Intel’s GPU; a possible scenario where it will use the discrete graphics card is if your laptop is connected to an external monitor via HDMI.

By using the NVIDIA GPU Activity application, you can tell whether Solar2D’s app is running on it or not. If it shows on up on the list then it’s running on NVIDIA:

You can use NVIDIA Control Panel to manage which application will use which GPU.
I’m mentioning all of this so you can try doing your tests on each GPU and see whether there’s a difference.

That being said, if one of them is the culprit then drivers for the culprit would be the one in question. Aside of that, I would also check updates for chipset drivers and BIOS.

Hope some of that helps!

Thank you. That will be useful for testing in the future. I appreciate your input and posts! And now I’ll count this as closed. Thanks again.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.