Bullet Convex Hull Crashes on Win32 with SSE #35071

Closed
opened 2013-04-25 03:00:56 +02:00 by Francisco De La Cruz · 7 comments

Category: Physics

%%%--- Operating System, Graphics card ---
Windows Vista 32-bit, Intel 495

- Blender version with error, and version that worked ---

trunk @ r56277 crashes when starting the game engine with the attached .blend

- Short description of error ---

Loading the attached .blend and starting the Game Engine crashes Blender (~ 80% of the time)
The scene consists of static body and a dynamic body with a Convex Hull collision box.

- Steps for others to reproduce the error (preferably based on attached .blend file) ---
  1. Open attached .blend
  2. Game->Start Game Engine

Note 1: If the collision box for Suzanne is changed to a non Convex Hull type there is no crash.

Note 2: Tracing shows that the crash seems to be related to SSE support in bullet WHEN embedding bullet aligned-classes (btVector etc) in non-aligned external classes.

Note 3: From the btScalar.h header
//---snip--
- define BT_USE_SSE
- ifdef BT_USE_SSE
BT_USE_SSE_IN_API is disabled under Windows by default, becauseit makes it harder to integrate Bullet into your application under Windows
*(structured embedding Bullet structs/classes need to be 16-byte aligned)*with relatively little performance gain
If you are not embedded Bullet data in your classes, or make sure that you align those classes on 16-byte boundariesyou can manually enable this line or set it in the build system for a bit of performance gain (a few percent, dependent on usage)
#define BT_USE_SSE_IN_API---snip---

   
 Nonetheless BT_USE_SSE_IN_API is defined in other places as such:
  • if defined (_WIN32) || defined (i386)
  • define BT_USE_SSE_IN_API
    #endif
A Proof-of-Concept patch that fixes the crashing under Win32 is also attached.

%%%

**Category**: Physics %%%--- Operating System, Graphics card --- Windows Vista 32-bit, Intel 495 - Blender version with error, and version that worked --- trunk @ r56277 crashes when starting the game engine with the attached .blend - Short description of error --- Loading the attached .blend and starting the Game Engine crashes Blender (~ 80% of the time) The scene consists of static body and a dynamic body with a Convex Hull collision box. - Steps for others to reproduce the error (preferably based on attached .blend file) --- 1) Open attached .blend 2) Game->Start Game Engine Note 1: If the collision box for Suzanne is changed to a non Convex Hull type there is no crash. Note 2: Tracing shows that the crash seems to be related to SSE support in bullet WHEN embedding bullet aligned-classes (btVector etc) in non-aligned external classes. Note 3: From the btScalar.h header //---snip-- - define BT_USE_SSE - ifdef BT_USE_SSE *BT_USE_SSE_IN_API is disabled under Windows by default, because*it makes it harder to integrate Bullet into your application under Windows *(structured embedding Bullet structs/classes need to be 16-byte aligned)*with relatively little performance gain *If you are not embedded Bullet data in your classes, or make sure that you align those classes on 16-byte boundaries*you can manually enable this line or set it in the build system for a bit of performance gain (a few percent, dependent on usage) *#define BT_USE_SSE_IN_API*---snip--- ``` Nonetheless BT_USE_SSE_IN_API is defined in other places as such: ``` - if defined (_WIN32) || defined (__i386__) - define BT_USE_SSE_IN_API #endif ``` A Proof-of-Concept patch that fixes the crashing under Win32 is also attached. ``` ``` ``` %%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member
%%%This issue *might* be related to http://projects.blender.org/tracker/index.php?func=detail&aid=35048&group_id=9&atid=306%%%

%%%Hmm, this looks fishy.
Seems like those defines were added in this commit: http://code.google.com/p/bullet/source/detail?r=2634
Don't really see why though.
As far as I can see it should be safe to remove them.

In my tests using SSE had only small benefits, but that depends on the scene and the processor of course.%%%

%%%Hmm, this looks fishy. Seems like those defines were added in this commit: http://code.google.com/p/bullet/source/detail?r=2634 Don't really see why though. As far as I can see it should be safe to remove them. In my tests using SSE had only small benefits, but that depends on the scene and the processor of course.%%%
Member

%%%I downloaded an actual version from the Buildbot and it works without crash.
But when I building Blender (Windows XP 32 bit with Microsoft Visual C++ and SCons) from the actual trunk, Blender will crash without this fix.%%%

%%%I downloaded an actual version from the Buildbot and it works without crash. But when I building Blender (Windows XP 32 bit with Microsoft Visual C++ and SCons) from the actual trunk, Blender will crash without this fix.%%%

%%%I committed Francisco's fix in svn r56519.
Could you test if the problem is fixed now?%%%

%%%I committed Francisco's fix in svn r56519. Could you test if the problem is fixed now?%%%

%%%It seems the problem is fixed, closing.%%%

%%%It seems the problem is fixed, closing.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#35071
No description provided.