Assertion Failed

The above is what is filling the command window when I try to run my program. My first instinct when I saw this was to investigate what was in the lines listed to find out what Panda3D is expecting to hold through but isn’t happening, but I have not been able to find nodePath.cxx among the source files, much less find any of the root folders of the file. Where are they located !?

EDIT: Whoops, wrong section, but I’m hoping you guys will be able to help me out anyways. =P

It means you tried to reference a NodePath that didn’t have any data. An empty NodePath is returned from a failed loadModel() command (for instance, because of a wrong filename), or from a failed find() operation, or really from anything that might return a NodePath but fails.

There’s usually an error message at the top that gives more information about what went wrong.


Haha, thanks for the excellent example, because while the problem wasn’t a failed load_model()command, the problem was in the same area. I was declaring the same object (NodePath) twice. So, I simply fixed that issue and it seems to be working fine now.

Thanks a lot.

Figured I’d just bump this topic instead of making a new one since issue is related.

So, I’m getting exactly the same assertion failed error message but this time, it’s not accompanied by a node leak, but rather on PStats, I’m getting App->Show Code->General using up all of the processor power giving me a great 4.0FPS and ~250ms latency between frames.

Anybody know what could be causing that?

Well, printing the error message itself will cost of a lot of time, of course. So it’s not surprising that you’re seeing a lot of time spent in PStats.

It still means the same thing: you’re trying to use an empty NodePath as if it weren’t empty. You need to find the empty NodePath and fix it (or at least test whether it’s empty before you use it).

One way to help track down the problem is to add the following to your Config.prc:

assert-abort 1

this will make the assertion raise a segment fault when it happens, instead of simply returning; and then you can catch it in the MSVS debugger and observe the stack trace. Then it might be clearer where you’re going wrong.


Apparently I just had the project set up incorrectly, perhaps I was missing a linker entry or the like, because I simply overwrote the code in an old project (that was setup correctly) and it ran just peachy. I wonder why it was giving the assertion failed error message in that case though…