Undo crash after hiding object in edit mode #62450

Closed
opened 2019-03-11 14:39:23 +01:00 by Pierre Schiller · 23 comments

System Information
Operating system: Windows 7 X64 SP1
Graphics card: Nvidia Titan X

Blender Version
Broken: blender2.8, 2019-03-08, a0f2923fd8

Worked: (optional)

Short description of error
Blender crashes when the visibility of the selected object is off and "undo" is performed.

Exact steps for others to reproduce the error

  1. create cube(works with existing objects) 2) Select object in object mode 3) Turn on edit mode 4) Hide object with eye symbol (don’t turn off edit mode) 5) Hit Ctrl + z
**System Information** Operating system: Windows 7 X64 SP1 Graphics card: Nvidia Titan X **Blender Version** Broken: blender2.8, 2019-03-08, a0f2923fd821 Worked: (optional) **Short description of error** Blender crashes when the visibility of the selected object is off and "undo" is performed. **Exact steps for others to reproduce the error** 1) create cube(works with existing objects) 2) Select object in object mode 3) Turn on edit mode 4) Hide object with eye symbol (don’t turn off edit mode) 5) Hit Ctrl + z

Added subscriber: @PierreSchiller

Added subscriber: @PierreSchiller

#64008 was marked as duplicate of this issue

#64008 was marked as duplicate of this issue

#63314 was marked as duplicate of this issue

#63314 was marked as duplicate of this issue

#63190 was marked as duplicate of this issue

#63190 was marked as duplicate of this issue

#63188 was marked as duplicate of this issue

#63188 was marked as duplicate of this issue

#62762 was marked as duplicate of this issue

#62762 was marked as duplicate of this issue
Campbell Barton was assigned by Brecht Van Lommel 2019-03-11 16:20:02 +01:00
Brecht Van Lommel changed title from Blender 2.8 closes on visibility hidden + Undo to Undo crash after hiding object in edit mode 2019-03-11 16:20:20 +01:00

Added subscriber: @MarcinTwarowski

Added subscriber: @MarcinTwarowski

It also crashes when object is in edit mode and the collection it's in is set to hidden.

It also crashes when object is in edit mode and the collection it's in is set to hidden.

Added subscriber: @seaside98-4

Added subscriber: @seaside98-4

Added subscriber: @Lexx

Added subscriber: @Lexx

Added subscribers: @ahmadakil, @ideasman42, @antoniov

Added subscribers: @ahmadakil, @ideasman42, @antoniov

Added subscriber: @Fubax-1

Added subscriber: @Fubax-1

Added subscriber: @brecht

Added subscriber: @brecht

Call stack from #63314:

 	blender.exe!common_strnlen_c<0,unsigned char>(const unsigned char * const string, const unsigned __int64 maximum_count) Line 72	C++
 	blender.exe!common_strnlen_simd<0,1,unsigned char>(const unsigned char * const string, const unsigned __int64 maximum_count) Line 130	C++
 	blender.exe!common_strnlen<0,unsigned char>(const unsigned char * const string, const unsigned __int64 maximum_count) Line 185	C++
 	blender.exe!strnlen(const char * string, unsigned __int64 maximum_count) Line 202	C++
 	blender.exe!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char> > >::type_case_s_compute_narrow_string_length(const int maximum_length, char __formal) Line 2293	C++
 	blender.exe!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char> > >::type_case_s() Line 2279	C++
 	blender.exe!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char> > >::state_case_type() Line 2023	C++
 	blender.exe!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char> > >::process() Line 1668	C++
 	blender.exe!common_vsprintf<__crt_stdio_output::standard_base,char>(const unsigned __int64 options, char * const buffer, const unsigned __int64 buffer_count, const char * const format, __crt_locale_pointers * const locale, char * const arglist) Line 167	C++
 	blender.exe!__stdio_common_vsprintf(unsigned __int64 options, char * buffer, unsigned __int64 buffer_count, const char * format, __crt_locale_pointers * locale, char * arglist) Line 240	C++
 	[External Code]	
>	blender.exe!clg_str_vappendf(CLogStringBuf * cstr, const unsigned char * fmt, unsigned char * args) Line 190	C

 	blender.exe!CLG_logf(CLG_LogType * lg, CLG_Severity severity, const unsigned char * file_line, const unsigned char * fn, const unsigned char * fmt, ...) Line 497	C
 	blender.exe!ED_undo_object_set_active_or_warn(ViewLayer * view_layer, Object * ob, const unsigned char * info, CLG_LogRef * log) Line 665	C
 	blender.exe!mesh_undosys_step_decode(bContext * C, Main * UNUSED_bmain, UndoStep * us_p, int UNUSED_dir) Line 751	C
 	blender.exe!undosys_step_decode(bContext * C, Main * bmain, UndoStack * ustack, UndoStep * us, int dir) Line 198	C
 	blender.exe!BKE_undosys_step_undo_with_data_ex(UndoStack * ustack, bContext * C, UndoStep * us, bool use_skip) Line 665	C
 	blender.exe!BKE_undosys_step_undo_with_data(UndoStack * ustack, bContext * C, UndoStep * us) Line 686	C
 	blender.exe!ed_undo_step(bContext * C, int step, const unsigned char * undoname, ReportList * reports) Line 170	C
 	blender.exe!ED_undo_pop_op(bContext * C, wmOperator * op) Line 268	C
 	blender.exe!ED_undo_operator_repeat(bContext * C, wmOperator * op) Line 486	C
 	blender.exe!ED_undo_operator_repeat_cb_evt(bContext * C, void * arg_op, int UNUSED_arg_event) Line 540	C
 	blender.exe!ui_apply_but_funcs_after(bContext * C) Line 811	C
 	blender.exe!ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 10045	C
 	blender.exe!wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 585	C
 	blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2491	C
 	blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2720	C
 	blender.exe!wm_event_do_handlers(bContext * C) Line 3071	C
 	blender.exe!WM_main(bContext * C) Line 421	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 507	C
Call stack from #63314: ```lines=10 blender.exe!common_strnlen_c<0,unsigned char>(const unsigned char * const string, const unsigned __int64 maximum_count) Line 72 C++ blender.exe!common_strnlen_simd<0,1,unsigned char>(const unsigned char * const string, const unsigned __int64 maximum_count) Line 130 C++ blender.exe!common_strnlen<0,unsigned char>(const unsigned char * const string, const unsigned __int64 maximum_count) Line 185 C++ blender.exe!strnlen(const char * string, unsigned __int64 maximum_count) Line 202 C++ blender.exe!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char> > >::type_case_s_compute_narrow_string_length(const int maximum_length, char __formal) Line 2293 C++ blender.exe!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char> > >::type_case_s() Line 2279 C++ blender.exe!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char> > >::state_case_type() Line 2023 C++ blender.exe!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter<char> > >::process() Line 1668 C++ blender.exe!common_vsprintf<__crt_stdio_output::standard_base,char>(const unsigned __int64 options, char * const buffer, const unsigned __int64 buffer_count, const char * const format, __crt_locale_pointers * const locale, char * const arglist) Line 167 C++ blender.exe!__stdio_common_vsprintf(unsigned __int64 options, char * buffer, unsigned __int64 buffer_count, const char * format, __crt_locale_pointers * locale, char * arglist) Line 240 C++ [External Code] > blender.exe!clg_str_vappendf(CLogStringBuf * cstr, const unsigned char * fmt, unsigned char * args) Line 190 C blender.exe!CLG_logf(CLG_LogType * lg, CLG_Severity severity, const unsigned char * file_line, const unsigned char * fn, const unsigned char * fmt, ...) Line 497 C blender.exe!ED_undo_object_set_active_or_warn(ViewLayer * view_layer, Object * ob, const unsigned char * info, CLG_LogRef * log) Line 665 C blender.exe!mesh_undosys_step_decode(bContext * C, Main * UNUSED_bmain, UndoStep * us_p, int UNUSED_dir) Line 751 C blender.exe!undosys_step_decode(bContext * C, Main * bmain, UndoStack * ustack, UndoStep * us, int dir) Line 198 C blender.exe!BKE_undosys_step_undo_with_data_ex(UndoStack * ustack, bContext * C, UndoStep * us, bool use_skip) Line 665 C blender.exe!BKE_undosys_step_undo_with_data(UndoStack * ustack, bContext * C, UndoStep * us) Line 686 C blender.exe!ed_undo_step(bContext * C, int step, const unsigned char * undoname, ReportList * reports) Line 170 C blender.exe!ED_undo_pop_op(bContext * C, wmOperator * op) Line 268 C blender.exe!ED_undo_operator_repeat(bContext * C, wmOperator * op) Line 486 C blender.exe!ED_undo_operator_repeat_cb_evt(bContext * C, void * arg_op, int UNUSED_arg_event) Line 540 C blender.exe!ui_apply_but_funcs_after(bContext * C) Line 811 C blender.exe!ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 10045 C blender.exe!wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 585 C blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2491 C blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2720 C blender.exe!wm_event_do_handlers(bContext * C) Line 3071 C blender.exe!WM_main(bContext * C) Line 421 C blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 507 C ```

Added subscribers: @jakubo, @lichtwerk

Added subscribers: @jakubo, @lichtwerk

Some investigation on the cause of this crash in #64008#668488.

Some investigation on the cause of this crash in #64008#668488.

Added subscriber: @mano-wii

Added subscriber: @mano-wii

In Blender2.7 it was not possible to hide an object in edit mode. I don't see why change this behavior now.
For me a solution would be to simply restrict the property to not hiding an object in edit mode.

The crash happens because objects_len in mesh_undosys_step_encode becomes 0 when hiding the single object in edit mode.
And this function was not prepared to handle this case.

And even if this function handle this case, it is necessay to edit the polls that don't allow Global Undo to work in edit mode.

In Blender2.7 it was not possible to hide an object in edit mode. I don't see why change this behavior now. For me a solution would be to simply restrict the property to not hiding an object in edit mode. The crash happens because `objects_len` in `mesh_undosys_step_encode` becomes `0` when hiding the single object in edit mode. And this function was not prepared to handle this case. And even if this function handle this case, it is necessay to edit the polls that don't allow `Global Undo` to work in edit mode.

Added subscriber: @dfelinto

Added subscriber: @dfelinto

[update: it seems I was investigating this at the same time as @mano-wii so there is nothing here that he hasn't mentioned above]

mesh_undosys_step_encode uses only the visible objects in their iterator: BKE_view_layer_array_from_objects_in_edit_mode_unique_data() at some point calls base_is_in_mode which only returns visible bases.

I suspect it may be related with the issue.

[update: it seems I was investigating this at the same time as @mano-wii so there is nothing here that he hasn't mentioned above] `mesh_undosys_step_encode` uses only the visible objects in their iterator: BKE_view_layer_array_from_objects_in_edit_mode_unique_data() at some point calls `base_is_in_mode` which only returns visible bases. I suspect it may be related with the issue.

I don't think it's possible to reliably prevent an object from getting hidden in edit mode, there are many indirect ways this could happen and preventing them all in the UI or Python API is not practical. An object could also be hidden in one view layer but not another.

It could work to kick an object out of edit mode as soon as it gets hidden everywhere, or at least not consider it to be in edit mode while it's hidden.

I don't think it's possible to reliably prevent an object from getting hidden in edit mode, there are many indirect ways this could happen and preventing them all in the UI or Python API is not practical. An object could also be hidden in one view layer but not another. It could work to kick an object out of edit mode as soon as it gets hidden everywhere, or at least not consider it to be in edit mode while it's hidden.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

This is no longer crashing, closing.

This is no longer crashing, closing.
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
7 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#62450
No description provided.