Convert to Curve from Mesh crashes Blender #80596

Closed
opened 2020-09-08 15:31:42 +02:00 by Simon Thommes · 15 comments
Member

System Information
Operating system: Linux-5.4.0-7634-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: Quadro RTX 6000/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.100

Blender Version
Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-09-08 11:23, hash: ab6f59ff3b
Worked: v2.83.5

Short description of error
The convert Curve from Mesh operator does not work and in some cases crashes Blender immediately.

Exact steps for others to reproduce the error
Add a plane -> Convert to Curve from Mesh -> Crash

(Note: on the default cube it does not crash, but also does not do any conversion)

**System Information** Operating system: Linux-5.4.0-7634-generic-x86_64-with-debian-bullseye-sid 64 Bits Graphics card: Quadro RTX 6000/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.100 **Blender Version** Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-09-08 11:23, hash: `ab6f59ff3b` Worked: v2.83.5 **Short description of error** The convert Curve from Mesh operator does not work and in some cases crashes Blender immediately. **Exact steps for others to reproduce the error** Add a plane -> Convert to Curve from Mesh -> Crash (Note: on the default cube it does not crash, but also does not do any conversion)
Author
Member

Added subscriber: @SimonThommes

Added subscriber: @SimonThommes

#80618 was marked as duplicate of this issue

#80618 was marked as duplicate of this issue

#80607 was marked as duplicate of this issue

#80607 was marked as duplicate of this issue

Added subscriber: @rjg

Added subscriber: @rjg

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I can confirm this issue. object_convert_exec tries to remove the object from the rigid bodies by calling ED_rigidbody_object_remove. However, since it isn't a rigid body and there's also no other rigid body in the scene the RigidBodyWorld is NULL when calling BKE_ptcache_id_from_rigidbody and it tries to dereference it.

If you add rigid body physics to the plane or any other object in the scene it won't crash, since a rigid body world exists.

BKE_ptcache_id_from_rigidbody(PTCacheID * pid, Object * ob, RigidBodyWorld * rbw) Line 1854	C
BKE_rigidbody_remove_object(Main * bmain, Scene * scene, Object * ob, const bool free_us) Line 1567	C
ED_rigidbody_object_remove(Main * bmain, Scene * scene, Object * ob) Line 106	C
object_convert_exec(bContext * C, wmOperator * op) Line 2577	C
WM_menu_invoke_ex(bContext * C, wmOperator * op, int opcontext) Line 972	C
WM_menu_invoke(bContext * C, wmOperator * op, const wmEvent * UNUSED_event) Line 993	C
wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1301	C
wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const short context, const bool poll_only, wmEvent * event) Line 1514	C
WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, short context, PointerRNA * properties) Line 1563	C
ui_apply_but_funcs_after(bContext * C) Line 928	C
ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 10739	C
wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 639	C
wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2755	C
wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2866	C
wm_event_do_handlers(bContext * C) Line 3290	C
WM_main(bContext * C) Line 485	C
main(int argc, const unsigned char * * UNUSED_argv_c) Line 531	C
I can confirm this issue. `object_convert_exec` tries to remove the object from the rigid bodies by calling `ED_rigidbody_object_remove`. However, since it isn't a rigid body and there's also no other rigid body in the scene the `RigidBodyWorld` is `NULL` when calling `BKE_ptcache_id_from_rigidbody` and it tries to dereference it. If you add rigid body physics to the plane or any other object in the scene it won't crash, since a rigid body world exists. ``` BKE_ptcache_id_from_rigidbody(PTCacheID * pid, Object * ob, RigidBodyWorld * rbw) Line 1854 C BKE_rigidbody_remove_object(Main * bmain, Scene * scene, Object * ob, const bool free_us) Line 1567 C ED_rigidbody_object_remove(Main * bmain, Scene * scene, Object * ob) Line 106 C object_convert_exec(bContext * C, wmOperator * op) Line 2577 C WM_menu_invoke_ex(bContext * C, wmOperator * op, int opcontext) Line 972 C WM_menu_invoke(bContext * C, wmOperator * op, const wmEvent * UNUSED_event) Line 993 C wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1301 C wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const short context, const bool poll_only, wmEvent * event) Line 1514 C WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, short context, PointerRNA * properties) Line 1563 C ui_apply_but_funcs_after(bContext * C) Line 928 C ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 10739 C wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 639 C wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2755 C wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2866 C wm_event_do_handlers(bContext * C) Line 3290 C WM_main(bContext * C) Line 485 C main(int argc, const unsigned char * * UNUSED_argv_c) Line 531 C ```

Added subscriber: @Josephbburg

Added subscriber: @Josephbburg

thank you for closing mine. I am so embarrassed that I forgot to search 😭

thank you for closing mine. I am so embarrassed that I forgot to search 😭

@Josephbburg Don't worry about it.

@Josephbburg Don't worry about it.

Added subscriber: @ZedDB

Added subscriber: @ZedDB

@ZedDB This issue was introduced by f20f82ce3e with the changes to BKE_rigidbody_remove_object.

@ZedDB This issue was introduced by f20f82ce3e with the changes to `BKE_rigidbody_remove_object`.

This issue was referenced by d51c8f78ff

This issue was referenced by d51c8f78ff8a210675dae44048156c23e3793508

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sebastian Parborg self-assigned this 2020-09-09 11:49:32 +02:00

Thanks for bisecting and providing the backtrace!

The issue was two fold:

  1. First I should check if rbw is null before trying to get a pointcache from it.

  2. This would only trigger when using the convert function as it does not have a sanity check. (Is this object actually a rigid body object?)

So I fixed both.

Thanks for bisecting and providing the backtrace! The issue was two fold: 1. First I should check if rbw is null before trying to get a pointcache from it. 2. This would only trigger when using the convert function as it does not have a sanity check. (Is this object actually a rigid body object?) So I fixed both.

Added subscriber: @3di

Added subscriber: @3di
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
5 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#80596
No description provided.