Jump to content

[SOLVED] After a long runtime WorldExpressions causing crash


photo

Recommended Posts

Hello

 

WorldExpressions placed staticly in the world file causing after a long runtime a engine crash:

 

WorldExpression:

#ifndef EXP_FLAG_WIND_H 
#define EXP_FLAG_WIND_H
#include <unigine.h>
#include <relics_of_annorath/scripts/client/logic/world/weather/windManager.h>

void main()
{ 
// Get current node  
Node node = node_cast(getNode());
// Get sound source  
SoundSource sound = node_cast(node.getChild(0));
// Get physical wind  
PhysicalWind wind = node_cast(node.getChild(1));
// Set values  
sound.setGain(engine.world.call("World::Weather::WindManager::getExpressionValue",System::Configuration::Weather::WindManager::CONFIG_ARG_PHYSIC_SET_SOUND_VOLUME));  
sound.setPitch(engine.world.call("World::Weather::WindManager::getExpressionValue",System::Configuration::Weather::WindManager::CONFIG_ARG_PHYSIC_SET_SOUND_SPEED));
wind.setVelocity(vec3(engine.world.call("World::Weather::WindManager::getExpressionValue",System::Configuration::Weather::WindManager::CONFIG_ARG_PHYSIC_SET_VELOCITY),0,0));
}
main();
#endif // EXP_FLAG_WIND_H

Error:

20:43:57 NameSpace::NameSpace(): maximum namespace is 65535

Everything that is created after this, lets the engine crash because:

20:43:57 engine/utils/Stack.h:85: Type& Stack<Type, Capacity>::push() [with Type = Interpreter::Instance, int Capacity = 128]: Assertion: 'depth < Capacity && "Stack::push(): stack overflow"'

Greets

Manuel

 

 

PS: Is there a way to get currently count of the namespaces? Could be very usefully to find and detect problems.

Link to comment

Hello Frustum

 

I checked possible code paths.

We are spawning one WorldExpression per connected player. But this WorldExpression is empty. (No code or file used for any logical behavior)

 

Else we only working with static placed WorldExpressions: Switching torches on/off during daytime, etc.

 

Is it possible that the empty WorldExpressions can cause this?

 

If there is a way to get the number of current NameSpaces I can try to debug it in more detail.

 

Greets

Manuel

Link to comment

But this WorldExpression is empty. (No code or file used for any logical behavior)

Manuel, don't understand this, what is an empty expression good for ? Also for problem isolation: how many static expressions are in the world file, how many expressions are spawned by players ? It should be quite easy to track dynamically spawned player expressions in your own code. Trying to find the real problem by namespace counting does not seem strait forward to me.

Link to comment

Hello Frustum, Ulf

 

We have ~40 static WorldExpression in the world.  We are currently migrating config based nodes to WorldExpressions but how it looks we are better stand with our own system for the moment.

 

The empty expression was for testing purpose only and gets removed. I'm just curious if this can cause the problems.

Beside this empty expressions we do not spawn any other expressions.

 

A last question I have, for what exactly WorldExpression should be used? (I think we want to do much more with them, then it was designed for)

 

Greets

Manuel

Link to comment

Don't create big number of WorldExpression classes manualy. In that case you will have a "maximum namespace is 65535" error. Because for each new WorldExpression a new script expression will be compiled.
Cloned WorldExpressions share a same script so there is no overflow problem with multiple NodeReferences which contain WorldExpression nodes. And of course all WorldExpressions from the World file are ok.

Link to comment
  • 2 months later...

Expression class will release their NameSpaces. So NameSpace overflow problem will be solved.

Interpeter opcodes will be cleared only if Epressions will be deleted in the correct order:

e0 = new Expression();
e1 = new Expression();
e2 = new Expression();
delete e2;
delete e1;
delete e0;
In the other case Interpreter's internal opcodes array will growth.
Link to comment
×
×
  • Create New...