replaceMesh() / LibNew() crashing game engine #38170

Closed
opened 2014-01-12 16:59:44 +01:00 by solarlune · 17 comments

System Information
Windows 7 64-bit, AMD RADEON HD 7750

Blender Version
Broken: Recent 2.69 Buildbot Version
Hash 74216cf
Date 1/12/14

Worked: 2.69 Release (Note that the first two bugs don't happen in the release version, but the last one still does)

There's a few errors shown in this blend file. The first two are more critical, while the last one isn't game-breaking, but doesn't work correctly.

LibNewBug.blend

1 - When you use the LibNew() function on a recent version of Blender (like the one I posted above), and then escape out of it, it crashes Blender out.

2 - When you use the replaceMesh() function using a mesh that you know exists (in the example blend, it's the one currently on the object), it crashes Blender without even starting the game engine.

3 - When you use LibNew, it makes a new visual mesh, but not a physical mesh. You can see that the two different cubes share physical meshes in the "LibNewFail" scene.

To reproduce the errors, just switch to the corresponding scenes and press P to play the game engine on the provided blend file. You can also use LibNew() or replaceMesh() on a mesh on a new blend file.

**System Information** Windows 7 64-bit, AMD RADEON HD 7750 **Blender Version** Broken: Recent 2.69 Buildbot Version Hash 74216cf Date 1/12/14 Worked: 2.69 Release (Note that the first two bugs don't happen in the release version, but the last one still does) There's a few errors shown in this blend file. The first two are more critical, while the last one isn't game-breaking, but doesn't work correctly. [LibNewBug.blend](https://archive.blender.org/developer/F67242/LibNewBug.blend) 1 - When you use the LibNew() function on a recent version of Blender (like the one I posted above), and then escape out of it, it crashes Blender out. 2 - When you use the replaceMesh() function using a mesh that you know exists (in the example blend, it's the one currently on the object), it crashes Blender without even starting the game engine. 3 - When you use LibNew, it makes a new visual mesh, but not a physical mesh. You can see that the two different cubes share physical meshes in the "LibNewFail" scene. To reproduce the errors, just switch to the corresponding scenes and press P to play the game engine on the provided blend file. You can also use LibNew() or replaceMesh() on a mesh on a new blend file.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @solarlune

Added subscriber: @solarlune

Added subscriber: @Moguri

Added subscriber: @Moguri

It looks like error 1 is caused by 709041, which looks like the threaded depsgraph commit. I wonder if the BGE is missing something for cleanup.

It looks like error 1 is caused by 709041, which looks like the threaded depsgraph commit. I wonder if the BGE is missing something for cleanup.

And error 2 is caused by 6a4733

And error 2 is caused by 6a4733
Author

Bumping (?) for more info. I just tried this in the recent Release Candidate for Blender 2.7, and two of the bugs still seem to be there. The replaceMesh bug seems to have been fixed.

Bumping (?) for more info. I just tried this in the recent Release Candidate for Blender 2.7, and two of the bugs still seem to be there. The replaceMesh bug seems to have been fixed.

Added subscriber: @Sergey

Added subscriber: @Sergey

@Moguri, #1 is caused by calloc-ing main in KX_PythonMain.cpp:755, you need to use BKE_main_new() to properly allocate bMain. One liner fix :)

Other things i'm not sure.

@Moguri, #1 is caused by calloc-ing main in KX_PythonMain.cpp:755, you need to use `BKE_main_new()` to properly allocate bMain. One liner fix :) Other things i'm not sure.

Thanks for the fix sergey. Any idea why we have BKE_main functions defined in BKE_library.h instead of BKE_main.h?

So, now 1 and 2 should be fixed. 3 sounds like a missing feature rather than a bug. I'm not sure if it will be tackled prior to 2.70 being released.

Thanks for the fix sergey. Any idea why we have BKE_main functions defined in BKE_library.h instead of BKE_main.h? So, now 1 and 2 should be fixed. 3 sounds like a missing feature rather than a bug. I'm not sure if it will be tackled prior to 2.70 being released.

@Moguri, i think it's historical question -- BKE_main_free() was in BKE_library at the time i've added BKE_main_new(). Not really fussed with wither leaving this as is or re-shuffling functions/headers.. You could poke cambo -- he loves doing cleanup like this :)

@Moguri, i think it's historical question -- `BKE_main_free()` was in BKE_library at the time i've added `BKE_main_new()`. Not really fussed with wither leaving this as is or re-shuffling functions/headers.. You could poke cambo -- he loves doing cleanup like this :)

Added subscriber: @raco

Added subscriber: @raco

@solarlune: Could we maybe open a new task for this third issue (LibNew doesn't update Physics Mesh) so this can be closed? Or change the title?

@solarlune: Could we maybe open a new task for this third issue (LibNew doesn't update Physics Mesh) so this can be closed? Or change the title?
Author

I would edit the title and change the main text, but even though I'm the owner of the task, for some reason I can't edit it. I can create a new task if necessary.

I would edit the title and change the main text, but even though I'm the owner of the task, for some reason I can't edit it. I can create a new task if necessary.

Added subscriber: @brita

Added subscriber: @brita

@brita I created a new task related to just the third bug. The first two are already solved. So this could be merged with #40955.

@brita I created a new task related to just the third bug. The first two are already solved. So this could be merged with #40955.

Changed status from 'Open' to: 'Duplicate'

Changed status from 'Open' to: 'Duplicate'

✘ Merged into #40955.

✘ Merged into #40955.
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
4 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#38170
No description provided.