Blender Crashes during python modal operator #87223

Closed
opened 2021-04-06 01:07:55 +02:00 by paul geraskin · 9 comments
Member

System Information
Operating system: Windows

Short description of error
I did an addon which creates objects in modal mode during mesh editing. And I found that blender crashes during parameters changing. I recorded video.
I attached my addon and a test file.

If I comment a line 395 (vs_coll.objects.link(new_obj)) then there will be no crash. The crash happens during objects linking.

BSpheres.zip
tmp1.blend

tmp_vid1.mp4
2UAEJ2hMopc.jpg

Exact steps for others to reproduce the error

  • install my addon
  • Press Run button as in video
  • rightclick->subdivide
  • change subdivide parameters several times as in video.
    Crash.
**System Information** Operating system: Windows **Short description of error** I did an addon which creates objects in modal mode during mesh editing. And I found that blender crashes during parameters changing. I recorded video. I attached my addon and a test file. If I comment a line 395 (vs_coll.objects.link(new_obj)) then there will be no crash. The crash happens during objects linking. [BSpheres.zip](https://archive.blender.org/developer/F9921234/BSpheres.zip) [tmp1.blend](https://archive.blender.org/developer/F9921235/tmp1.blend) [tmp_vid1.mp4](https://archive.blender.org/developer/F9921236/tmp_vid1.mp4) ![2UAEJ2hMopc.jpg](https://archive.blender.org/developer/F9921568/2UAEJ2hMopc.jpg) **Exact steps for others to reproduce the error** - install my addon - Press Run button as in video - rightclick->subdivide - change subdivide parameters several times as in video. Crash.
Author
Member

Added subscriber: @PaulGeraskin

Added subscriber: @PaulGeraskin
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

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

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

Can confirm.
These might be related:

#84647 (Crash: Python/Undo related crash in BKE_scene_object_base_flag_sync_from_base) (adding manual undo push does not help)
#85436 (Separate by loose parts weird result.) (same backtrace)

1   BKE_scene_object_base_flag_sync_from_base scene.c              2923  0x35b6ee4 
2   BKE_scene_set_background                  scene.c              2126  0x35b5654 
3   setup_app_data                            blendfile.c          379   0x4c062f6 
4   setup_app_blend_file_data                 blendfile.c          417   0x4c063fd 
5   BKE_blendfile_read_setup_ex               blendfile.c          455   0x4c064ee 
6   BKE_blendfile_read_setup                  blendfile.c          464   0x4c06539 
7   BKE_memfile_undo_decode                   blender_undo.c       96    0x4c05692 
8   memfile_undosys_step_decode               memfile_undo.c       193   0x48f6b82 
9   undosys_step_decode                       undo_system.c        215   0x4c66119 
10  BKE_undosys_step_load_data_ex             undo_system.c        813   0x4c67c2a 
11  ed_undo_step_by_name                      ed_undo.c            350   0x48f4c7f 
12  ED_undo_pop_op                            ed_undo.c            429   0x48f4fc8 
13  ED_undo_operator_repeat                   ed_undo.c            704   0x48f5913 
14  ED_undo_operator_repeat_cb_evt            ed_undo.c            750   0x48f5ac8 
15  ui_apply_but_funcs_after                  interface_handlers.c 964   0x4917e5e 
16  ui_handler_region_menu                    interface_handlers.c 10863 0x4932b7f 
17  wm_handler_ui_call                        wm_event_system.c    693   0x3a2a1ca 
18  wm_handlers_do_intern                     wm_event_system.c    2815  0x3a2f79f 
19  wm_handlers_do                            wm_event_system.c    2931  0x3a2fc56 
20  wm_event_do_handlers                      wm_event_system.c    3348  0x3a30e70 

Will tag Core module since this is Undo-related.

Can confirm. These might be related: #84647 (Crash: Python/Undo related crash in BKE_scene_object_base_flag_sync_from_base) (adding manual undo push does not help) #85436 (Separate by loose parts weird result.) (same backtrace) ``` 1 BKE_scene_object_base_flag_sync_from_base scene.c 2923 0x35b6ee4 2 BKE_scene_set_background scene.c 2126 0x35b5654 3 setup_app_data blendfile.c 379 0x4c062f6 4 setup_app_blend_file_data blendfile.c 417 0x4c063fd 5 BKE_blendfile_read_setup_ex blendfile.c 455 0x4c064ee 6 BKE_blendfile_read_setup blendfile.c 464 0x4c06539 7 BKE_memfile_undo_decode blender_undo.c 96 0x4c05692 8 memfile_undosys_step_decode memfile_undo.c 193 0x48f6b82 9 undosys_step_decode undo_system.c 215 0x4c66119 10 BKE_undosys_step_load_data_ex undo_system.c 813 0x4c67c2a 11 ed_undo_step_by_name ed_undo.c 350 0x48f4c7f 12 ED_undo_pop_op ed_undo.c 429 0x48f4fc8 13 ED_undo_operator_repeat ed_undo.c 704 0x48f5913 14 ED_undo_operator_repeat_cb_evt ed_undo.c 750 0x48f5ac8 15 ui_apply_but_funcs_after interface_handlers.c 964 0x4917e5e 16 ui_handler_region_menu interface_handlers.c 10863 0x4932b7f 17 wm_handler_ui_call wm_event_system.c 693 0x3a2a1ca 18 wm_handlers_do_intern wm_event_system.c 2815 0x3a2f79f 19 wm_handlers_do wm_event_system.c 2931 0x3a2fc56 20 wm_event_do_handlers wm_event_system.c 3348 0x3a30e70 ``` Will tag `Core` module since this is Undo-related.

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'

the code of this addon is broken (if you do not return 'FINISHED' while changing the data, you skip generating the undo step while having modified data, which is invalid and will break undo system).

Please do not use this tracker for python development support.

the code of this addon is broken (if you do not return 'FINISHED' while changing the data, you skip generating the undo step while having modified data, which is invalid and will break undo system). Please do not use this tracker for python development support.
Author
Member

Hi @mont29 , let me express some statements, please:

1 I've created a procedural mdeling tool and I'm using this code here https://blendermarket.com/products/bspheres
2 I donate to the Blender Foundation from every sale
3 I have to use a modal operator to achieve realtime performance.
4 Blender crashes. Not my addon. I assume this is a bug of Blender.
5 I reported a bug as I had a crash from Blender's side. I assume I reported correctly.

Thanks.

Hi @mont29 , let me express some statements, please: 1 I've created a procedural mdeling tool and I'm using this code here https://blendermarket.com/products/bspheres 2 I donate to the Blender Foundation from every sale 3 I have to use a modal operator to achieve realtime performance. 4 Blender crashes. Not my addon. I assume this is a bug of Blender. 5 I reported a bug as I had a crash from Blender's side. I assume I reported correctly. Thanks.

Blender crashes after using you addon, because said addon does not behave properly (as explained in previous comment). Support for proper python coding is not part of this tracker's targets.

An addon is a program, not a user interacting with the software, therefore it has more power, which comes with more responsibilities when it comes to not breaking the rest of the software. There are millions of ways to make Blender crash from python code, just as from changing its C code.

Blender crashes after using you addon, because said addon does not behave properly (as explained in previous comment). Support for proper python coding is not part of this tracker's targets. An addon is a program, not a user interacting with the software, therefore it has more power, which comes with more responsibilities when it comes to not breaking the rest of the software. There are millions of ways to make Blender crash from python code, just as from changing its C code.
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#87223
No description provided.