GithubHelp home page GithubHelp logo

Comments (18)

stephengold avatar stephengold commented on May 25, 2024 1

for the record:

        Collection<PhysicsJoint> joints = physicsSpace.getJointList();
        for (PhysicsJoint joint : joints) {
            physicsSpace.removeJoint(joint);
        }
        Collection<PhysicsCollisionObject> pcos = physicsSpace.getPcoList();
        for (PhysicsCollisionObject pco : pcos) {
            physicsSpace.removeCollisionObject(pco);
        }

from minie.

stephengold avatar stephengold commented on May 25, 2024 1

I've been busy with other bugs. If you could provide a simple Java app to trigger the crash, that might be very helpful.

from minie.

stephengold avatar stephengold commented on May 25, 2024 1

I have a possible fix: stephengold/Libbulletjme@489383e

from minie.

ertugrulcetin avatar ertugrulcetin commented on May 25, 2024 1

Once you release a test version, I can test it on my machine.

from minie.

ertugrulcetin avatar ertugrulcetin commented on May 25, 2024 1

Seems like it's fixed! Thank you so much, good job!

from minie.

stephengold avatar stephengold commented on May 25, 2024

Thanks for the debug crash log ... that's helpful!

To self: findLinearSearch() on the world's collision-object array caused a segmentation violation. Was the world in some inconsistent state?

from minie.

ertugrulcetin avatar ertugrulcetin commented on May 25, 2024

Could be, I was using re-init fn in here (several times in a row) clear fn does the real job. Maybe I'm doing something wrong. The goal is to re-initialize the app without restarting it.

from minie.

stephengold avatar stephengold commented on May 25, 2024

Sorry, I don't understand Clojure yet. I've been studying the C++ code to figure out how an inconsistency might've arisen. No clarity yet. I may build a modified library and ask you to re-test...

from minie.

ertugrulcetin avatar ertugrulcetin commented on May 25, 2024

Sure, I'll re-test it. From my understanding, whatever we do in Java, Clojure in any other JVM language that uses jMonkeyEngine this crash should not happen right? It's the C++ code that has the problem? Or user code?

from minie.

stephengold avatar stephengold commented on May 25, 2024

I'm convinced this is a Minie bug, not a bug in JME or your application. It's likely you can work around it by clearing out physics spaces before they get GC'ed, but Minie shouldn't require that.

I expect the ultimate fix will probably involve changes to Minie's native libraries.

from minie.

ertugrulcetin avatar ertugrulcetin commented on May 25, 2024

I see. Also, I get JVM crash on bullet and bullet-native deps too (That's why I switched to Minie in the first place). One question regarding that, how can I manually clear physics spaces?

from minie.

ertugrulcetin avatar ertugrulcetin commented on May 25, 2024

@stephengold is there any update? Also, is there anything that I can help with? (testing, Java-related stuff). Sorry, I don't know C++ :(

from minie.

stephengold avatar stephengold commented on May 25, 2024

The new "Minie-3.1.0-test4" build incorporates a possible workaround for this issue. Try it and let me know whether (or not) it makes any difference for your application.

from minie.

ertugrulcetin avatar ertugrulcetin commented on May 25, 2024

Sure, will try ASAP.

from minie.

ertugrulcetin avatar ertugrulcetin commented on May 25, 2024

@stephengold I was going to write manual clearing physics space worked, but it failed last minute. Here is the JVM crash log: https://gist.github.com/ertugrulcetin/a28089705073b17cbf51137a2bba3ca1 it took longer compared to previous crashes.
jmonkey version: 3.3.2-stable, Minie version: 3.1.0-test4

In clear function, those are the steps:

  • Detach all children from rootNode
  • Clear all lights from rootNode
  • Get all states from stateManager using getStates method (reflection) and call .detach method, exclude these AppStates: AudioListenerState, DebugKeysAppState, FlyCamAppState, ResetStatsState, StatsAppState
    • If BulletApp state then call clear-physics
  • invoke terminatePending method from stateManager (reflection)
  • call simpleInitApp method

from minie.

ertugrulcetin avatar ertugrulcetin commented on May 25, 2024

UPDATE: False alarm. It turns out I forgot to add manual clear fn to some other part that required it. It works, thanks!

It does not work if I don't clear physics spaces manually tho.

from minie.

stephengold avatar stephengold commented on May 25, 2024

By commenting out the physicsSpace.destroy() in "TestIssue13.java" I have reproduced this issue on my Linux system. Therefore, this issue is not OSX-specific.

from minie.

stephengold avatar stephengold commented on May 25, 2024

The new "Minie-3.1.0" build incorporates the (proposed) fix. Try it and let me know whether (or not) it makes any difference for your application.

from minie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.