Summary: | crash starting kolf | ||
---|---|---|---|
Product: | [Applications] kolf | Reporter: | Jaime Torres <jtamate> |
Component: | general | Assignee: | Stefan Majewsky <majewsky> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | dmk, josan_pansa, kde-games-bugs |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kolf/08e0ec93940ca2da4f46bd277ecafeb5f7ffa772 | Version Fixed In: | 4.10 |
Sentry Crash Report: | |||
Attachments: | New crash information added by DrKonqi |
Description
Jaime Torres
2010-12-06 12:03:41 UTC
SVN commit 1204551 by majewsky: Let's see if that does away with that weird crash some people get when starting Kolf. BUG: 258998 M +4 -2 shape.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1204551 Unfortunately, it is still there.. More information: const qreal angle = -i * angleStep; //CCW order as required by Box2D vertices[i].x = c.x + rx * cos(angle); vertices[i].y = c.y + ry * sin(angle); fprintf(stderr, "vertices %f,%f\n", vertices[i].x, vertices[i].y); // yes, I know about kDebug, but... Those are the vertices of the elipse that generates the crash: 0,200000,0,000000 0,141421,-0,159099 0,000000,-0,225000 -0,141421,-0,159099 -0,200000,-0,000000 -0,141421,0,159099 -0,000000,0,225000 0,141421,0,159099 when creating a blackhole (and a crash :-(). A patch that fixes the problem for me. An area can not be a negative number in the R*R universe. Index: external/Box2D/Collision/Shapes/b2PolygonShape.cpp =================================================================== --- external/Box2D/Collision/Shapes/b2PolygonShape.cpp (revisiĆ³n: 1237890) +++ external/Box2D/Collision/Shapes/b2PolygonShape.cpp (copia de trabajo) @@ -103,8 +103,7 @@ static b2Vec2 ComputeCentroid(const b2Ve b2Vec2 e2 = p3 - p1; qreal D = b2Cross(e1, e2); - qreal triangleArea = 0.5f * D; + qreal triangleArea = D < 0 ? -0.5f * D : 0.5f * D; area += triangleArea; // Area weighted centroid Created attachment 65854 [details]
New crash information added by DrKonqi
kolf (1.10) on KDE Platform 4.7.3 (4.7.3) using Qt 4.7.4
Just some additional information. This is with KDE 4.7.3 on FreeBSD 8.2-RELEASE.
-- Backtrace (Reduced):
#11 0x28135925 in ComputeCentroid (vs=0x2bf0f0a0, count=8) at /usr/ports/games/kdegames4/work/kdegames-4.7.3/kolf/external/Box2D/Collision/Shapes/b2PolygonShape.cpp:115
#12 0x28135b4e in b2PolygonShape::Set (this=0x2bf0f080, vertices=0xbfbfd3b8, count=8) at /usr/ports/games/kdegames4/work/kdegames-4.7.3/kolf/external/Box2D/Collision/Shapes/b2PolygonShape.cpp:170
#13 0x28107798 in Kolf::EllipseShape::createShape (this=0x2c2619c0) at /usr/ports/games/kdegames4/work/kdegames-4.7.3/kolf/shape.cpp:184
#14 0x28107b65 in Kolf::Shape::update (this=0x2c2619c0) at /usr/ports/games/kdegames4/work/kdegames-4.7.3/kolf/shape.cpp:119
#15 0x28107d7f in Kolf::EllipseShape::setRect (this=0x2c2619c0, rect=@0xbfbfd630) at /usr/ports/games/kdegames4/work/kdegames-4.7.3/kolf/shape.cpp:150
*** Bug 311392 has been marked as a duplicate of this bug. *** Git commit 5ff7428e8481f285c5e32c3a4b0be01f921fd388 by Jaime Torres. Committed on 19/12/2012 at 20:51. Pushed by jtamate into branch 'master'. fix a crash in box2d (that also crashes kolf) with some data extracted from a kolf course, box2d calculates a negative area, that is not possible in Real*Real vector space. fixed using the abs area of each triangle. Also filled a bug in box2d (I have had to use okteta to bypass their captcha). FIXED-IN: 4.10 REVIEW: 107739 M +1 -1 external/Box2D/Collision/Shapes/b2PolygonShape.cpp http://commits.kde.org/kolf/5ff7428e8481f285c5e32c3a4b0be01f921fd388 FYI: The box2d info about this bug: http://www.box2d.org/forum/viewtopic.php?f=4&t=8998 Git commit 08e0ec93940ca2da4f46bd277ecafeb5f7ffa772 by Jaime Torres. Committed on 19/12/2012 at 20:51. Pushed by jtamate into branch 'KDE/4.10'. fix a crash in box2d (that also crashes kolf) with some data extracted from a kolf course, box2d calculates a negative area, that is not possible in Real*Real vector space. fixed using the abs area of each triangle. Also filled a bug in box2d (I have had to use okteta to bypass their captcha). FIXED-IN: 4.10 REVIEW: 107739 M +1 -1 external/Box2D/Collision/Shapes/b2PolygonShape.cpp http://commits.kde.org/kolf/08e0ec93940ca2da4f46bd277ecafeb5f7ffa772 |