Ubuntu Inconsistency ld.so NullPointerException; audio related?

Hi!



I am having the below problem on Ubuntu.

It usually happens when I am shooting several balls on a dynamic object, but I cant reproduce always :frowning:

I read that error could be related to audio?

Someone using linux has had such a problem and was able to fix without messing too much with the OS ?

I followed the fixing tips but none worked :frowning:



Here is the error(I can have these "normal messages?" all day long, but sometimes it crashes…):


...
Sep 7, 2010 12:20:18 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (null)
Sep 7, 2010 12:20:18 PM com.jme3.scene.Node attachChild
INFO: Child (Bullet:146) attached to this node (null)
Sep 7, 2010 12:20:18 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (null)
Sep 7, 2010 12:20:18 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
   at com.bulletphysics.collision.dispatch.CollisionDispatcher.freeCollisionAlgorithm(CollisionDispatcher.java:119)
   at com.bulletphysics.collision.dispatch.CompoundCollisionAlgorithm.destroy(CompoundCollisionAlgorithm.java:76)
   at com.bulletphysics.collision.dispatch.CollisionDispatcher.freeCollisionAlgorithm(CollisionDispatcher.java:120)
   at com.bulletphysics.collision.dispatch.CompoundCollisionAlgorithm.destroy(CompoundCollisionAlgorithm.java:76)
   at com.bulletphysics.collision.dispatch.CollisionDispatcher.freeCollisionAlgorithm(CollisionDispatcher.java:120)
   at com.bulletphysics.collision.broadphase.HashedOverlappingPairCache.cleanOverlappingPair(HashedOverlappingPairCache.java:219)
   at com.bulletphysics.collision.broadphase.HashedOverlappingPairCache.removeOverlappingPair(HashedOverlappingPairCache.java:91)
   at com.bulletphysics.collision.broadphase.DbvtBroadphase.collide(DbvtBroadphase.java:145)
   at com.bulletphysics.collision.broadphase.DbvtBroadphase.calculateOverlappingPairs(DbvtBroadphase.java:235)
   at com.bulletphysics.collision.dispatch.CollisionWorld.performDiscreteCollisionDetection(CollisionWorld.java:139)
   at com.bulletphysics.dynamics.DiscreteDynamicsWorld.internalSingleStepSimulation(DiscreteDynamicsWorld.java:372)
   at com.bulletphysics.dynamics.DiscreteDynamicsWorld.stepSimulation(DiscreteDynamicsWorld.java:337)
   at com.jme3.bullet.PhysicsSpace.update(PhysicsSpace.java:359)
   at com.jme3.bullet.PhysicsSpace.update(PhysicsSpace.java:303)
   at com.jme3.app.SimpleBulletApplication.update(SimpleBulletApplication.java:301)
   at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:112)
   at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:101)
   at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:166)
   at java.lang.Thread.run(Thread.java:636)
Inconsistency detected by ld.so: dl-close.c: 731: _dl_close: Assertion `map->l_init_called' failed!


I had the same message (and still have in specific conditions) in Ubuntu 10.4, 32bit. My investigations on the subject lead me to the conclusion that it is not the source of the problem but a side effect of some java exception raised somewhere else.



I think the message pops out because some native part is left in a wrong state because of the raise of the "real" exception, but this is a feeling, not a proper analysis.



Anyway, the problem of your program (if what I found applies to your case of course) is the NullPointerException: if you solve that than the "Inconsistency…" stuff will vanish as well.

Thats the problem, the exception happens on a side thread that doesnt seem directly related to my application (indirectly of course is). So I cant play changing my code to see what happens, and the worst is I dont know how to simulate the problem as I shot several and several times and nothing happened.

If i were you i'll play a little with the jbullet code to see if changing something can get rid of the problem. For example, the latest jbullet sources says that the line throwing the exception is:


   @Override
   public void freeCollisionAlgorithm(CollisionAlgorithm algo) {
      CollisionAlgorithmCreateFunc createFunc = algo.internalGetCreateFunc();


>algo.internalSetCreateFunc(null);[/b]<
      createFunc.releaseCollisionAlgorithm(algo);
      algo.destroy();
   }



If this is the same version used by jme, then "internalGetCreateFunc" should be named "interalGetCreateFuncIfYouCan" because you stepped into a case, how particular doesn't matter, where "algo.internalGetCreateFunc" doesn't get or create anything.

Thx, I will see if I can find the sources of jbullet.jar that is used with jme3…

I just would like to not depend on it, I mean, if we find a fix, and next jme3 is updated with a updated jbullet.jar, I will have to patch the new jbullet.jar and so on…

The best would be to go at jbullet forum and post a testcase and provide the fix there for a chance of new jme3 come with the fixed jar.

I will see if I can do this later, despite it could be a linux related problem also, so a "fix" would just hide a problem in the SO that showed up in jbullet ( now I believe in a multidimensional world :stuck_out_tongue: ).



Btw, it is still happening sometimes, I have updated Ubuntu and didnt help.

This last time it happened on my app thread after calling:

    getPhysicsSpace().remove(phys);

The problem really seems related to the removal of a physics! All times, as I remember, it happened at exactly that situation! Also, I would like to add that I am almost sure that the phys object being removed was colliding/"overlapping?" with another!



This time it had this stack, but the ending is the same…:

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
   at com.bulletphysics.collision.dispatch.CollisionDispatcher.freeCollisionAlgorithm(CollisionDispatcher.java:119)
   at com.bulletphysics.collision.dispatch.CompoundCollisionAlgorithm.destroy(CompoundCollisionAlgorithm.java:76)
   at com.bulletphysics.collision.dispatch.CollisionDispatcher.freeCollisionAlgorithm(CollisionDispatcher.java:120)
   at com.bulletphysics.collision.dispatch.CompoundCollisionAlgorithm.destroy(CompoundCollisionAlgorithm.java:76)
   at com.bulletphysics.collision.dispatch.CollisionDispatcher.freeCollisionAlgorithm(CollisionDispatcher.java:120)
   at com.bulletphysics.collision.broadphase.HashedOverlappingPairCache.cleanOverlappingPair(HashedOverlappingPairCache.java:219)
   at com.bulletphysics.collision.broadphase.HashedOverlappingPairCache$CleanPairCallback.processOverlap(HashedOverlappingPairCache.java:447)
   at com.bulletphysics.collision.broadphase.HashedOverlappingPairCache.processAllOverlappingPairs(HashedOverlappingPairCache.java:190)
   at com.bulletphysics.collision.broadphase.HashedOverlappingPairCache.cleanProxyFromPairs(HashedOverlappingPairCache.java:207)
   at com.bulletphysics.collision.dispatch.CollisionWorld.removeCollisionObject(CollisionWorld.java:172)
   at com.bulletphysics.dynamics.DiscreteDynamicsWorld.removeRigidBody(DiscreteDynamicsWorld.java:423)
   at com.jme3.bullet.PhysicsSpace.removeNode(PhysicsSpace.java:589)
   at com.jme3.bullet.PhysicsSpace.remove(PhysicsSpace.java:475)