Using undo after adding an object in edit mode to an object hidden in viewport causes a crash #72097

Closed
opened 2019-12-01 20:18:51 +01:00 by IKU · 22 comments

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce GTX 1060 3GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 399.24

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: 26bd5ebd42
Worked: (optional)

Short description of error
Adding a mesh to a hidden object in edit mode, followed by an undo causes Blender to crash.

Exact steps for others to reproduce the error

  1. Select an object and switch to the edit mode
  2. Hide or disable the currently edited object in the viewport through the outliner (eye icon or monitor icon)
  3. Add a new geometry to the mesh, e.g. by adding a vertex
  4. Undo the previous step (CTRL + Z)
**System Information** Operating system: Windows-10-10.0.18362 64 Bits Graphics card: GeForce GTX 1060 3GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 399.24 **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: `26bd5ebd42` Worked: (optional) **Short description of error** Adding a mesh to a hidden object in edit mode, followed by an undo causes Blender to crash. **Exact steps for others to reproduce the error** 1. Select an object and switch to the edit mode 2. Hide or disable the currently edited object in the viewport through the outliner (eye icon or monitor icon) 3. Add a new geometry to the mesh, e.g. by adding a vertex 4. Undo the previous step (CTRL + Z)
Author

Added subscriber: @IKU

Added subscriber: @IKU

#73431 was marked as duplicate of this issue

#73431 was marked as duplicate of this issue

#72480 was marked as duplicate of this issue

#72480 was marked as duplicate of this issue

#72458 was marked as duplicate of this issue

#72458 was marked as duplicate of this issue

Added subscriber: @MaciejJutrzenka

Added subscriber: @MaciejJutrzenka

tried selever times both on linux and windows 10 can't reproduce.. can u make short video showing this? i might reproduce wrongly the steps

tried selever times both on linux and windows 10 can't reproduce.. can u make short video showing this? i might reproduce wrongly the steps
Maciej Jutrzenka changed title from Crush report to Hide object while editing. UNDO crash 2019-12-01 20:26:56 +01:00
Robert Guetzkow changed title from Hide object while editing. UNDO crash to Hide object while editing followed by UNDO causes crash 2019-12-01 23:48:08 +01:00

Added subscriber: @rjg

Added subscriber: @rjg

I can reproduce this issue on Windows. The crash is caused by the attempt to print the warning in ED_undo_object_set_active_or_warn(). The following stack trace was created from a build of f0e7fd4ad6

ucrtbased.dll
vsnprintf(unsigned char * const _Buffer, const unsigned __int64 _BufferCount, const unsigned char * const _Format, unsigned char * _ArgList) Line 1440
clg_str_vappendf(CLogStringBuf * cstr, const unsigned char * fmt, unsigned char * args) Line 190
CLG_logf(CLG_LogType * lg, CLG_Severity severity, const unsigned char * file_line, const unsigned char * fn, const unsigned char * fmt, ...) Line 504
ED_undo_object_set_active_or_warn(ViewLayer * view_layer, Object * ob, const unsigned char * info, CLG_LogRef * log) Line 737
mesh_undosys_step_decode(bContext * C, Main * bmain, UndoStep * us_p, int UNUSED_dir, bool UNUSED_is_final) Line 778
undosys_step_decode(bContext * C, Main * bmain, UndoStack * ustack, UndoStep * us, int dir, bool is_final) Line 210
BKE_undosys_step_undo_with_data_ex(UndoStack * ustack, bContext * C, UndoStep * us, bool use_skip) Line 685
BKE_undosys_step_undo_with_data(UndoStack * ustack, bContext * C, UndoStep * us) Line 720
BKE_undosys_step_undo(UndoStack * ustack, bContext * C) Line 725
ed_undo_step_impl(bContext * C, int step, const unsigned char * undoname, int undo_index, ReportList * reports) Line 191
ed_undo_step_direction(bContext * C, int step, ReportList * reports) Line 254
ed_undo_exec(bContext * C, wmOperator * op) Line 389
wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1453
wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties) Line 2281
wm_handlers_do_keymap_with_keymap_handler(bContext * C, wmEvent * event, ListBase * handlers, wmEventHandler_Keymap * handler, wmKeyMap * keymap, const bool do_debug_handler) Line 2594
wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2731
wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2993
wm_event_do_handlers(bContext * C) Line 3480
WM_main(bContext * C) Line 420
main(int argc, const unsigned char * * UNUSED_argv_c) Line 498
I can reproduce this issue on Windows. The crash is caused by the attempt to print the warning in `ED_undo_object_set_active_or_warn()`. The following stack trace was created from a build of f0e7fd4ad6 ``` ucrtbased.dll vsnprintf(unsigned char * const _Buffer, const unsigned __int64 _BufferCount, const unsigned char * const _Format, unsigned char * _ArgList) Line 1440 clg_str_vappendf(CLogStringBuf * cstr, const unsigned char * fmt, unsigned char * args) Line 190 CLG_logf(CLG_LogType * lg, CLG_Severity severity, const unsigned char * file_line, const unsigned char * fn, const unsigned char * fmt, ...) Line 504 ED_undo_object_set_active_or_warn(ViewLayer * view_layer, Object * ob, const unsigned char * info, CLG_LogRef * log) Line 737 mesh_undosys_step_decode(bContext * C, Main * bmain, UndoStep * us_p, int UNUSED_dir, bool UNUSED_is_final) Line 778 undosys_step_decode(bContext * C, Main * bmain, UndoStack * ustack, UndoStep * us, int dir, bool is_final) Line 210 BKE_undosys_step_undo_with_data_ex(UndoStack * ustack, bContext * C, UndoStep * us, bool use_skip) Line 685 BKE_undosys_step_undo_with_data(UndoStack * ustack, bContext * C, UndoStep * us) Line 720 BKE_undosys_step_undo(UndoStack * ustack, bContext * C) Line 725 ed_undo_step_impl(bContext * C, int step, const unsigned char * undoname, int undo_index, ReportList * reports) Line 191 ed_undo_step_direction(bContext * C, int step, ReportList * reports) Line 254 ed_undo_exec(bContext * C, wmOperator * op) Line 389 wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1453 wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties) Line 2281 wm_handlers_do_keymap_with_keymap_handler(bContext * C, wmEvent * event, ListBase * handlers, wmEventHandler_Keymap * handler, wmKeyMap * keymap, const bool do_debug_handler) Line 2594 wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2731 wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2993 wm_event_do_handlers(bContext * C) Line 3480 WM_main(bContext * C) Line 420 main(int argc, const unsigned char * * UNUSED_argv_c) Line 498 ```
Robert Guetzkow changed title from Hide object while editing followed by UNDO causes crash to Using undo after adding an object in edit mode to an object hidden in viewport causes a crash 2019-12-01 23:54:54 +01:00

Added subscriber: @esminis

Added subscriber: @esminis

Issue happens in mesh_undosys_step_decode because us->elems / us->elems_len is empty. It is empty because hidden objects are not added to MeshUndoStep (in this case it is currently selected object).

I have implemented initial solution that disables hiding object when it is in edit mode, but it is still not a complete solution (need feedback from someone with better knowledge of internals):

  • Now user can still go into edit mode and press hide icon on whole collection - disabling hide button for collection will be very unituitive to user in this case
  • Should we also disallow python script to hide object in such case
  • Maybe there is some other way to hide object I don`t know (that should be fixed)

#72097.patch

Issue happens in mesh_undosys_step_decode because us->elems / us->elems_len is empty. It is empty because hidden objects are not added to MeshUndoStep (in this case it is currently selected object). I have implemented initial solution that disables hiding object when it is in edit mode, but it is still not a complete solution (need feedback from someone with better knowledge of internals): - Now user can still go into edit mode and press hide icon on whole collection - disabling hide button for collection will be very unituitive to user in this case - Should we also disallow python script to hide object in such case - Maybe there is some other way to hide object I don`t know (that should be fixed) [#72097.patch](https://archive.blender.org/developer/F8185684/T72097.patch)
Member

Added subscriber: @zazizizou

Added subscriber: @zazizizou
Member

In #72097#822785, @esminis wrote:
I have implemented initial solution that disables hiding object when it is in edit mode.

I don't think that's a desired solution. Doing the same steps above for bones gives a warning but not a crash, so it should be possible to do undo for meshes without a crash.

Also, you might find the intro into how to submit a patch useful: https://wiki.blender.org/wiki/Process/Contributing_Code

> In #72097#822785, @esminis wrote: > I have implemented initial solution that disables hiding object when it is in edit mode. I don't think that's a desired solution. Doing the same steps above for bones gives a warning but not a crash, so it should be possible to do undo for meshes without a crash. Also, you might find the intro into how to submit a patch useful: https://wiki.blender.org/wiki/Process/Contributing_Code

From how blender works it seems to me that disabling "Hide object" while you are editing it is most logical solution.

Which of those do you think would be desired solution:

  • Disable hiding object while it is in edit mode (as if you hide an object edit mode dissapears)
  • Record object hiding action to undo history log (now it is not done) - second best solution to my mind
  • Rewrite how undo history is recorded to support hidden objects (worst solution I think)
  • ? Offer something else maybe
From how blender works it seems to me that disabling "Hide object" while you are editing it is most logical solution. Which of those do you think would be desired solution: - Disable hiding object while it is in edit mode (as if you hide an object edit mode dissapears) - Record object hiding action to undo history log (now it is not done) - second best solution to my mind - Rewrite how undo history is recorded to support hidden objects (worst solution I think) - ? Offer something else maybe

Added subscriber: @QUANTED

Added subscriber: @QUANTED

Added subscriber: @Gasased

Added subscriber: @Gasased

Added subscriber: @Tryfast

Added subscriber: @Tryfast
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member

@rjg see if this: #73234 and the one linked to it: #73416 are related to it.

Campbell:

Note that this happens with many operations (bisect for example) and isn't spesific to bevel.
This is caused by the undo system not taking local collection into account.

@rjg see if this: #73234 and the one linked to it: #73416 are related to it. Campbell: >Note that this happens with many operations (bisect for example) and isn't spesific to bevel. >This is caused by the undo system not taking local collection into account.

In #72097#859782, @ankitm wrote:
@rjg see if this: #73234 and the one linked to it: #73416 are related to it.

Campbell:

Note that this happens with many operations (bisect for example) and isn't spesific to bevel.
This is caused by the undo system not taking local collection into account.

#73234 seems to be different bug, plus it happens only on Blender 2.82 (on Blender 2.81 I have it does not happen), reason is that no undo is done (this bug happens when undo is executed on hidden objects)

Depending on what solution is chosen for this bug it might also solve #73234 as it fails at same place and due to similar reasons.

> In #72097#859782, @ankitm wrote: > @rjg see if this: #73234 and the one linked to it: #73416 are related to it. > > Campbell: >>Note that this happens with many operations (bisect for example) and isn't spesific to bevel. >>This is caused by the undo system not taking local collection into account. #73234 seems to be different bug, plus it happens only on Blender 2.82 (on Blender 2.81 I have it does not happen), reason is that no undo is done (this bug happens when undo is executed on hidden objects) Depending on what solution is chosen for this bug it might also solve #73234 as it fails at same place and due to similar reasons.

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Germano Cavalcante self-assigned this 2020-02-06 04:59:05 +01:00

I reproduced this bug in the informed version, but not the latest daily build, so it appears the bug has been fixed already.

Please try the latest daily build: https://builder.blender.org/download/

If the problem persists, we can re-open the report.

I reproduced this bug in the informed version, but not the latest daily build, so it appears the bug has been fixed already. Please try the latest daily build: https://builder.blender.org/download/ If the problem persists, we can re-open the report.
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
8 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#72097
No description provided.