UPBGE 0.36.1 randomly crashes when doing stuff

While using UPBGE 0.3.6.1, every time I try to do something even minor like parenting an object or pushing P to start the game player, there is a chance that the entire app will crash (quit).

The last time it crashed like this was in 2.49 on Windows XP in 2008, although much more and it is obviously a bug/regression in UPBGE I have found. I cannot go back to 0.35 because I will lose Simulation Nodes. One good milestone I have noted is that UPBGE is no longer in Alpha stage anymore. :+1:t2: All that is needed to do is to fix up these crashes. :wrench:

Every time UPBGE crashes, I have noticed that there is always a Python Backtrace that is being created somewhere just milliseconds prior to the crash. It’s not a hardware problem (with the exception of rigging in Edit Mode which requires the GPU to be coded in), but a Python problem in 99% of cases because UPBGE is written in C++ (a small part of it), and 90% of it is written in Python, which would explain why the crashes are almost always Python-based.

By “stuff” in the title, I meant doing anything. Parenting, pushing P to start the game engine, they are one of the many things that can cause UPBGE 0.3.6.1 to crash on a random chance. Not to mention drivers. It seems to be related to some Python code changes within the app, but I’m not entirely sure, as I am not a developer. :computer_mouse:

While I realise Apple Silicon (and Intel) are much tougher to run 3rd party apps on them without running into crashes, UPBGE 0.36.1 shouldn’t really be crashing that much. Even Rosetta 2 does not seem to affect UPBGE, and really only seems to interfere with 2.79 and lower due to a bug. :beetle:

If a developer sees this post, hopefully they can make note of these crashes. I can switch over to Blender 3.4.1 and that can go 3 months or more without crashing.

The question is: Why is UPBGE 0.3.6.1 facing random crashes when I do something, even something really simple like parent an object or add a driver to a material? It never did this in past versions. I’m on macOS 12.0.1, running Apple Silicon, which is not the problem here. It appears to be a Python problem. I don’t think it is Rosetta 2, though it could be, but I highly doubt it since the compatibility rate is so high, and near-perfect.

Could it also be the transition to Metal which is causing crashes? This could be a possibility… :thinking:

If UPBGE is now out of Alpha, shouldn’t it be called Beta? :bulb:

Create a video of this happening
Open a report,

Don’t fear monger,
Just ask for stuff to be fixed if you find its been broke?

Also share your pc specs etc.

You could be crashing for a number of reasons (gpu, segfault, etc)

All experimental versions are expermental.

Release builds are not, and we backport fixes, when we have them *

Its all segfaults.

Nothing’s wrong with any files or anything in the file.

I’m not running a PC - I’m running a Mac.

The specs are M1, macOS 12.0.1 (Monterey).

GPU is totally fine.

M1 is a System on Chip (SoC).

UPBGE is run through Rosetta 2 (No Apple Silicon version yet)

UPBGE 0.35 didn’t have the random crashes I mentioned when I did stuff like this. I’m not entirely sure why these crashes happen like this, but nothing’s wrong with anything other than the fact that when I do something like parent an object, add a driver, start the game engine, etc, it has the chance to cause a crash, no other version does this. It can happen even on a clean file that has never crashed.

Clearly, UPBGE needs more optimisation for the macOS side…

“UPBGE is run through Rosetta 2 (No Apple Silicon version yet)”

so what your saying is you could be causing the segfault*

there is a metal backend on the way - don’t fret.

So, Rosetta 2 could actually be causing unintended segmentation fault crashes? That’s rather interesting, as Blender 2.79 worked fine on Intel, yet had lots of crashes on M1 due to the Rosetta 2 emulation layer. But, Rosetta 2 has a >99% compatibility rate…

The switch from openGL to Metal - I never accounted that for crashing UPBGE either. Given how Apple discontinued openGL in Mojave, this would be understandable.

But, what about Windows? That does not use Metal.

I’m not actually causing any segfaults here.

Windows has vulkan pipe on the way,

When exactly would the UPBGE 0.4 stable release come out? It’s been quite a while. I would love to see an Apple Silicon release that is properly optimised for the M1. (I do not expect to see any real performance changes until Metal and Eevee Next are sorted out). :wink:

UPDATE: Another crash here, this time with selecting a Cube in the Outliner. This seems to be a compatibility issue between Intel and Apple Silicon and some other stuff like the old depreciated openGL which appears to interfere with the operations of UPBGE, causing it to occasionally shut down (quit).

This also happened with 2.79, although much worse as it contained a bug in it, and it was never designed for Silicon processors.

While Apple Silicon does provide integrated support for Intel apps like UPBGE, it is apparently not enough in some cases, as issues based on different graphic languages will pop up, and sometimes, Rosetta may be incompatible, which can lead to crashes.

I think what I might be seeing here is an incompatibility between UPBGE (written for openGL) and my iMac’s Metal pipeline, which has yet to be addressed. The Rosetta emulation also places some stress on the app too, which is probably also a contributing factor.

I’d probably say UPBGE is in the Beta stage now. It most certainly has left Alpha I would say, but I’m not sure. A lot of things have to be fixed, like the crashing I just mentioned on macOS, which should in the coming months to year(s).

OpenGL and Metal are very different graphical languages. This is probably what causes the crashing. Add in Rosetta 2, and this also places stress on the app.

The crashes could also be because of recent code changes that need to be ironed out - Blender 3.4.1, although not a game engine, doesn’t crash anywhere near as much compared to this engine, though I have seen earlier versions of UPBGE really crash a lot more on macOS. I have only had one crash from Blender 3.4.1.

If you start blender.exe from the command line, it will print all UPBGE console output, even if it crashes. This can be helpful for diagnosing the bug. There should also be some scripts to start in debug mode or similar in the upbge folder. Log reports and data is generally going to be the most useful to the devs, otherwise there’s no easy way to figure out what’s going on.

I’m on a Mac, not a PC, so how would I launch it with this special debug info in which it prints out all console output?

The problem with submitting bug reports and crash.txt files is that to actually reach out to the devs on a particular crash, the site requires me to log in, which I don’t want to do, as I am not a developer of either Blender or UPBGE. UPBGE is quite fun to use at times, but when it goes wrong, then it is frustrating.

MacOS, just like any other platform, has a terminal that you can use to at least get crash message output. I’m pretty sure there’s also a way to start the debug mode, although I don’t know the specifics of it. Check the directory for any startup scripts I suppose.

It’s much better to submit bug reports on the github because it’s a lot more organized and allows the devs to easily assign and note the issue to be solved. They don’t usually read every forum post here, since this isn’t really a forum for bug reports and they have limited time. Most other open source projects have a similar system on github, it’s not really a special case.

The Metal port is why I am trying to hold off on writing shaders until they are properly supported. Since I’m on Apple Silicon, the only way for shaders on objects to be properly supported, will be Metal support. Apple Silicon does not properly support GLSL, so until Metal is fully supported, no shaders for me.

I expect Metal support to be in 0.4, I think.