bng86 / jbox2d

Automatically exported from code.google.com/p/jbox2d
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

AssertionError while setting a body inactive. #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run attached code with enabled assertions!

What is the expected output? What do you see instead?

Expecting no errors. Getting:

Exception in thread "main" java.lang.AssertionError
    at org.jbox2d.collision.broadphase.DynamicTree.destroyProxy(DynamicTree.java:115)
    at org.jbox2d.collision.broadphase.BroadPhase.destroyProxy(BroadPhase.java:104)
    at org.jbox2d.dynamics.Fixture.destroyProxy(Fixture.java:314)
    at org.jbox2d.dynamics.Body.setActive(Body.java:993)
    at matt.jbox2D.AssertionErrorReproductionForSetActive.main(AssertionErrorReproductionForSetActive.java:26)

What version of the product are you using? On what operating system?

jbox2d-library-2.1.2.2.jar
On Windows 7 x64
With JDK 1.7.0_02

Please provide any additional information below.

If seems that this problem occurs randomly when massively 
activating/deactivating bodies. I have not found a pattern yet.

Original issue reported on code.google.com by matthias...@st.ovgu.de on 8 Apr 2012 at 12:38

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Got the same problem. Fix please.

Original comment by Vladisla...@solverlabs.com on 12 Apr 2012 at 4:56

GoogleCodeExporter commented 8 years ago

Original comment by toucansa...@gmail.com on 12 Apr 2012 at 7:36

GoogleCodeExporter commented 8 years ago
I am getting this error not only with setActive(false) but also by deleting 
bodies.
I can't see a pattern either, sometimes I can get rid of 400 bodies and 
sometimes 3 before it pops up.
It's sort of making my game unplayable.

Original comment by Gandolfm...@gmail.com on 26 Dec 2012 at 5:39

GoogleCodeExporter commented 8 years ago
I just rolled back to version 2.1.2.0 and it no longer errors.

Original comment by Gandolfm...@gmail.com on 26 Dec 2012 at 5:47

GoogleCodeExporter commented 8 years ago
First attempt to bisect on trunk failed miserably:
Bisected to:
556 (last good commit)
First non-working commit
557 NOT STABLE huge update:
(everything thereafter does not compile due to errors in jbox2d-library)

[ERROR] 
jbox2d-library/src/main/java/org/jbox2d/dynamics/joints/WheelJoint.java:[42,7] 
error: WheelJoint is not abstract and
does not override abstract method solvePositionConstraints(SolverData) in Joint

There is only a solvePositionConstraints(float), hmm?

Second attempt on 2.1.2.0 and 2.1.2.2 worked better. See below.

Preparation:
Get source:
$ git clone --stdlayout http://jbox2d.googlecode.com/svn/trunk/ jbox2d

- Get the AssertionErrorReproductionForSetActive.java file and modify the while 
loop to catch assertion errors and then exit with 42. Also remove package 
matt.jbox2D.
- Get the testcase.sh file
Store the class file and testcase.sh file in the same parent directory as 
jbox2d.

Then the bisect process:
(verified here that 2.1.2.2 is broken and 2.1.2.0 works properly)
$ git bisect start tags/jbox2d-2.1.2.2 tags/jbox2d-2.1.2.0
6a760500b94762e8ef659961b32e6511a2063bfd is the first bad commit
commit 6a760500b94762e8ef659961b32e6511a2063bfd
Author: toucansam99@gmail.com 
<toucansam99@gmail.com@bc622014-446a-afc6-a9a4-7d0e215fe39e>
Date:   Mon Jan 16 01:33:29 2012 +0000

    - fixed issue 28, thanks Max!  Cause was incorrect centroid calculation in polygon shape.
    - threw in updated broadphase for stability

    git-svn-id: http://jbox2d.googlecode.com/svn/branches/jbox2d-2.1.2.1@562 bc622014-446a-afc6-a9a4-7d0e215fe39e

:040000 040000 b6ead0ed3fa45e52a1954109aaa7d68480da0a26 
8774b8dd5f11cc61245d97699412b77b549f0980 M      jbox2d-library
:040000 040000 9fbb714619a0e73efd231d12b4080efdf3115728 
48b9821d263d80f9929b2878eb75ab857be82bdf M      jbox2d-testbed
bisect run success

REVISION 562 caused this regression.

Original comment by lekenst...@gmail.com on 14 Jan 2013 at 5:06

Attachments:

GoogleCodeExporter commented 8 years ago
Alright, so after way too much time on this, it turns out that the assert was 
using the wrong limit variable.  It should be m_nodeCapacity, not m_nodeCount.  
So this assert was a false negative, and everything is fine.  New version soon.

Original comment by toucansa...@gmail.com on 27 Jan 2013 at 4:37

GoogleCodeExporter commented 8 years ago
Fixed in both 2.1.2 branch and 2.2.1.1

Original comment by danielmu...@gmail.com on 6 May 2013 at 5:27