Crash after any alembic import undo in an empty scene #77754

Closed
opened 2020-06-11 12:31:08 +02:00 by Yegor · 17 comments

System Information
Operating system: Linux-3.10.0-1062.9.1.el7.x86_64-x86_64-with-centos-7.7.1908-Core 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.44

Blender Version
Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: 211b6c29f7

Short description of error
The bug appears only on an empty scene after importing an alembic and undo.Crash after any alembic import, then immediately undo without any other steps

Exact steps for others to reproduce the error
#77754.abc

  • Open Blender and delete all the objects if there are any
  • import .abc
  • no other steps
  • undo --> crash
**System Information** Operating system: Linux-3.10.0-1062.9.1.el7.x86_64-x86_64-with-centos-7.7.1908-Core 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.44 **Blender Version** Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: `211b6c29f7` **Short description of error** The bug appears only on an empty scene after importing an alembic and undo.Crash after any alembic import, then immediately undo without any other steps **Exact steps for others to reproduce the error** [#77754.abc](https://archive.blender.org/developer/F8608021/T77754.abc) - Open Blender and delete all the objects if there are any - import .abc - no other steps - undo --> crash
Author

Added subscriber: @YegorSmirnov

Added subscriber: @YegorSmirnov
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.

Can confirm.
Philipp Oeser changed title from Crash after any alembic import undo in an empty scene to Crash after any alembic import undo 2020-06-11 12:43:11 +02:00

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sybren A. Stüvel self-assigned this 2020-06-15 12:58:32 +02:00

@lichtwerk reproduced this bug, but I can't reproduce it with the latest official release (2.83) or with the latest daily build (2.90 2797a63a66). so it appears the bug has been fixed already.

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

If the problem persists, please let us know so we can re-open the report. Don't forget to mention the specific version you tested again.

@lichtwerk reproduced this bug, but I can't reproduce it with the latest official release (2.83) or with the latest daily build (2.90 2797a63a66). so it appears the bug has been fixed already. Please try the latest daily build: https://builder.blender.org/download/ If the problem persists, please let us know so we can re-open the report. Don't forget to mention the specific version you tested again.
Member

Changed status from 'Resolved' to: 'Confirmed'

Changed status from 'Resolved' to: 'Confirmed'
Member

I can still repro with todays buildbot and 2.83 release.

God only knows why I was able to reproduce this in a non-empty scene (and why I have updated the report description and title), sorry for the confusion!
This only happens in an empty scene (will update the report again)

I can still repro with todays buildbot and 2.83 release. God only knows why I was able to reproduce this in a non-empty scene (and why I have updated the report description and title), sorry for the confusion! **This only happens in an empty scene** (will update the report again)
Philipp Oeser changed title from Crash after any alembic import undo to Crash after any alembic import undo in an empty scene 2020-06-15 13:36:32 +02:00
Sybren A. Stüvel removed their assignment 2020-06-16 19:03:13 +02:00

I still can't reproduce it, even on an empty scene.

@lichtwerk what platform are you testing on? I have Kubuntu Linux 19.10 (kernel 5.3.0), NVidia GTX 1080 (driver version 450.36.06).

Also, which version of Blender did still work properly?

I still can't reproduce it, even on an empty scene. @lichtwerk what platform are you testing on? I have Kubuntu Linux 19.10 (kernel 5.3.0), NVidia GTX 1080 (driver version 450.36.06). Also, which version of Blender did still work properly?
Author

Just tested 2.90 from the buildbot and it still crashes on Mint and CenOS

Just tested 2.90 from the buildbot and it still crashes on Mint and CenOS

Added subscriber: @mont29

Added subscriber: @mont29
Bastien Montagne self-assigned this 2020-06-22 12:19:08 +02:00

This is related to Undo I think. Alembic and Collada import operators are not flagged for undo (!!!), will fix this now, but this is not enough to fix the crash.

This is related to Undo I think. Alembic and Collada import operators are not flagged for undo (!!!), will fix this now, but this is not enough to fix the crash.
Bastien Montagne removed their assignment 2020-06-22 13:05:56 +02:00
Sybren A. Stüvel was assigned by Bastien Montagne 2020-06-22 13:05:56 +02:00

Well in fact issue is with alembic importer, which starts a background job for actual import, so undo step stored by the operator management system is done before data is actually changed, and importer had to do its own undo push when it is done.

This quick patch solves it, but not sure it's the best way to handle it (it add extra useless undo step e.g.), will let @dr.sybren handle it from there.

P1481: (An Untitled Masterwork)

diff --git a/source/blender/io/alembic/intern/alembic_capi.cc b/source/blender/io/alembic/intern/alembic_capi.cc
index 0b4b184359b..a406b63df06 100644
--- a/source/blender/io/alembic/intern/alembic_capi.cc
+++ b/source/blender/io/alembic/intern/alembic_capi.cc
@@ -51,6 +51,8 @@
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_build.h"
 
+#include "ED_undo.h"
+
 /* SpaceType struct has a member called 'new' which obviously conflicts with C++
  * so temporarily redefining the new keyword to make it compile. */
 #define new extern_new
@@ -429,6 +431,7 @@ enum {
 };
 
 struct ImportJobData {
+  bContext *C;
   Main *bmain;
   Scene *scene;
   ViewLayer *view_layer;
@@ -447,6 +450,7 @@ struct ImportJobData {
   char error_code;
   bool was_cancelled;
   bool import_ok;
+  bool is_background_job;
 };
 
 static void import_startjob(void *user_data, short *stop, short *do_update, float *progress)
@@ -630,6 +634,12 @@ static void import_endjob(void *user_data)
 
     DEG_id_tag_update(&data->scene->id, ID_RECALC_BASE_FLAGS);
     DEG_relations_tag_update(data->bmain);
+
+    if (data->is_background_job) {
+      /* We already returned from the import operator, so we need to store our own extra undo step.
+       */
+      ED_undo_push(data->C, "Alembic Import Finished");
+    }
   }
 
   for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
@@ -675,6 +685,7 @@ bool ABC_import(bContext *C,
 {
   /* Using new here since MEM_* functions do not call constructor to properly initialize data. */
   ImportJobData *job = new ImportJobData();
+  job->C = C;
   job->bmain = CTX_data_main(C);
   job->scene = CTX_data_scene(C);
   job->view_layer = CTX_data_view_layer(C);
@@ -691,6 +702,7 @@ bool ABC_import(bContext *C,
   job->error_code = ABC_NO_ERROR;
   job->was_cancelled = false;
   job->archive = NULL;
+  job->is_background_job = as_background_job;
 
   G.is_break = false;
 

Well in fact issue is with alembic importer, which starts a background job for actual import, so undo step stored by the operator management system is done before data is actually changed, and importer had to do its own undo push when it is done. This quick patch solves it, but not sure it's the best way to handle it (it add extra useless undo step e.g.), will let @dr.sybren handle it from there. [P1481: (An Untitled Masterwork)](https://archive.blender.org/developer/P1481.txt) ``` diff --git a/source/blender/io/alembic/intern/alembic_capi.cc b/source/blender/io/alembic/intern/alembic_capi.cc index 0b4b184359b..a406b63df06 100644 --- a/source/blender/io/alembic/intern/alembic_capi.cc +++ b/source/blender/io/alembic/intern/alembic_capi.cc @@ -51,6 +51,8 @@ #include "DEG_depsgraph.h" #include "DEG_depsgraph_build.h" +#include "ED_undo.h" + /* SpaceType struct has a member called 'new' which obviously conflicts with C++ * so temporarily redefining the new keyword to make it compile. */ #define new extern_new @@ -429,6 +431,7 @@ enum { }; struct ImportJobData { + bContext *C; Main *bmain; Scene *scene; ViewLayer *view_layer; @@ -447,6 +450,7 @@ struct ImportJobData { char error_code; bool was_cancelled; bool import_ok; + bool is_background_job; }; static void import_startjob(void *user_data, short *stop, short *do_update, float *progress) @@ -630,6 +634,12 @@ static void import_endjob(void *user_data) DEG_id_tag_update(&data->scene->id, ID_RECALC_BASE_FLAGS); DEG_relations_tag_update(data->bmain); + + if (data->is_background_job) { + /* We already returned from the import operator, so we need to store our own extra undo step. + */ + ED_undo_push(data->C, "Alembic Import Finished"); + } } for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) { @@ -675,6 +685,7 @@ bool ABC_import(bContext *C, { /* Using new here since MEM_* functions do not call constructor to properly initialize data. */ ImportJobData *job = new ImportJobData(); + job->C = C; job->bmain = CTX_data_main(C); job->scene = CTX_data_scene(C); job->view_layer = CTX_data_view_layer(C); @@ -691,6 +702,7 @@ bool ABC_import(bContext *C, job->error_code = ABC_NO_ERROR; job->was_cancelled = false; job->archive = NULL; + job->is_background_job = as_background_job; G.is_break = false; ```

This issue was referenced by a2c1f41d95

This issue was referenced by a2c1f41d95957a84e7a856a7b1dc889a0d98be5b

This issue was referenced by 25d2222c30

This issue was referenced by 25d2222c302acd7278b49f30a74adba6b9457012

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Thomas Dinges added this to the 2.90 milestone 2023-02-08 16:27:15 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#77754
No description provided.