Regression: LineArt crash on file load #102612

Closed
opened 2022-11-18 21:00:09 +01:00 by Bloop Trangle · 26 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: AMD Radeon VII ATI Technologies Inc. 4.5.14800 Core Profile Context 22.5.1 30.0.15021.11005

Blender Version
Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: b292cfe5a9
Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-11-17 22:27, hash: 2c096f17a690
Worked: 3.2.2

Caused by 71ce47a71d

Short description of error
Saving and opening a file with a visible LineArt object and a heavy background scene crashes immediately.
Combining the two scenes into one without the background scene field doesn't cause a crash.

Exact steps for others to reproduce the error

  • open attached file and enable the "LineArt" object in the viewport or:
    • Create a Suzanne and a Collection LineArt object targeting the Suzanne collection, and a camera pointed at it.
    • Create a new scene with an 11x11x11 array of Suzannes.
    • (Optionally) Mark the Suzanne array collection LineArt Usage to Exclude.
    • Assign the Suzanne array scene as the background scene in the original scene.
  • save the file
  • try to reopen it

lineArt crash3.blend

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: AMD Radeon VII ATI Technologies Inc. 4.5.14800 Core Profile Context 22.5.1 30.0.15021.11005 **Blender Version** Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: `b292cfe5a9` Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-11-17 22:27, hash: `2c096f17a690` Worked: 3.2.2 Caused by 71ce47a71d **Short description of error** Saving and opening a file with a visible LineArt object and a heavy background scene crashes immediately. Combining the two scenes into one without the background scene field doesn't cause a crash. **Exact steps for others to reproduce the error** - open attached file and enable the "LineArt" object in the viewport or: - Create a Suzanne and a Collection LineArt object targeting the Suzanne collection, and a camera pointed at it. - Create a new scene with an 11x11x11 array of Suzannes. - (Optionally) Mark the Suzanne array collection LineArt Usage to Exclude. - Assign the Suzanne array scene as the background scene in the original scene. - save the file - try to reopen it [lineArt crash3.blend](https://archive.blender.org/developer/F13942461/lineArt_crash3.blend)
Author

Added subscriber: @Bloop

Added subscriber: @Bloop

Added subscriber: @mano-wii

Added subscriber: @mano-wii

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

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

I can confirm the crash.
BKE_object_get_evaluated_mesh(...) returned nullptr.

>	blender.exe!lineart_object_load_single_instance(LineartData * ld, Depsgraph * depsgraph, Scene * scene, Object * ob, Object * ref_ob, float[4] * use_mat, bool is_render, LineartObjectLoadTaskInfo * olti, int thread_count, int obindex) Line 2447	C++

 	blender.exe!lineart_main_load_geometries(Depsgraph * depsgraph, Scene * scene, Object * camera, LineartData * ld, bool allow_duplicates, bool do_shadow_casting, ListBase * shadow_elns) Line 2556	C++
 	blender.exe!MOD_lineart_compute_feature_lines(Depsgraph * depsgraph, LineartGpencilModifierData * lmd, LineartCache * * cached_result, bool enable_stroke_depth_offset) Line 4990	C++
 	blender.exe!generateStrokes(GpencilModifierData * md, Depsgraph * depsgraph, Object * ob) Line 149	C
 	blender.exe!BKE_gpencil_modifiers_calc(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 817	C
 	blender.exe!BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 189	C++
 	blender.exe!BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 331	C++
 	[Inline Frame] blender.exe!std::_Func_class<void,Depsgraph *>::operator()(Depsgraph * <_Args_0>) Line 878	C++
 	blender.exe!blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) Line 108	C++
 	blender.exe!blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata) Line 122	C++
 	blender.exe!tbb::internal::function_task<Task>::execute() Line 1060	C++
 	[External Code]	
I can confirm the crash. `BKE_object_get_evaluated_mesh(...) returned nullptr.` ``` > blender.exe!lineart_object_load_single_instance(LineartData * ld, Depsgraph * depsgraph, Scene * scene, Object * ob, Object * ref_ob, float[4] * use_mat, bool is_render, LineartObjectLoadTaskInfo * olti, int thread_count, int obindex) Line 2447 C++ blender.exe!lineart_main_load_geometries(Depsgraph * depsgraph, Scene * scene, Object * camera, LineartData * ld, bool allow_duplicates, bool do_shadow_casting, ListBase * shadow_elns) Line 2556 C++ blender.exe!MOD_lineart_compute_feature_lines(Depsgraph * depsgraph, LineartGpencilModifierData * lmd, LineartCache * * cached_result, bool enable_stroke_depth_offset) Line 4990 C++ blender.exe!generateStrokes(GpencilModifierData * md, Depsgraph * depsgraph, Object * ob) Line 149 C blender.exe!BKE_gpencil_modifiers_calc(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 817 C blender.exe!BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 189 C++ blender.exe!BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 331 C++ [Inline Frame] blender.exe!std::_Func_class<void,Depsgraph *>::operator()(Depsgraph * <_Args_0>) Line 878 C++ blender.exe!blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) Line 108 C++ blender.exe!blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata) Line 122 C++ blender.exe!tbb::internal::function_task<Task>::execute() Line 1060 C++ [External Code] ```
jhonesnow commented 2022-11-21 10:57:49 +01:00 (Migrated from localhost:3001)

Added subscriber: @jhonesnow

Added subscriber: @jhonesnow
jhonesnow commented 2022-11-21 10:57:49 +01:00 (Migrated from localhost:3001)

This comment was removed by @jhonesnow

*This comment was removed by @jhonesnow*

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

will bisect

will bisect
Member

Added subscriber: @ChengduLittleA

Added subscriber: @ChengduLittleA
Member
Caused by 71ce47a71d CC @ChengduLittleA
Philipp Oeser changed title from LineArt crash on file load to Regression: LineArt crash on file load 2022-11-21 12:18:04 +01:00
YimingWu self-assigned this 2022-11-23 17:02:29 +01:00
Member

Thanks for the notice. I think this is where line art failed to handle nullptr on evaluated mesh. (May be related to how line art uses depsgraph because it's technically a hack.)

Thanks for the notice. I think this is where line art failed to handle nullptr on evaluated mesh. (May be related to how line art uses depsgraph because it's technically a hack.)

Added subscriber: @MumuMundo

Added subscriber: @MumuMundo

This comment was removed by @MumuMundo

*This comment was removed by @MumuMundo*
Member

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'
Member

Apparently I can't reproduce this report either. I'll dig further in the following days.

Is it always crashing? Or sometimes it works?

Apparently I can't reproduce this report either. I'll dig further in the following days. Is it always crashing? Or sometimes it works?
Author

This setup has crashed 100% of the time for me. Though, earlier I encountered a random LineArt crash in a long running working file, I think on render, and deleted the objects down to just just the GP LineArt object and a fresh Suzanne. Resetting each of the LineArt setting to default did not fix it. Deleting and recreating the LineArt object, including the custom settings, would fix it. That lead me to believe it was holding onto some corrupted data under the hood? I couldn't recreate that crash from scratch though, and it seemed to mostly happen if rendering soon after loading the file, but would occasionally still happen on render of the file that had been open for hours. So I didn't end up submitting a bug report. I deleted and recreated the LineArt mod in the problem file and haven't seen that crash again, it's been a few LTS updates since then. It has started occasionally crashing while editing a mesh used by a particle system. Is it something with my hardware maybe?

This setup has crashed 100% of the time for me. Though, earlier I encountered a random LineArt crash in a long running working file, I think on render, and deleted the objects down to just just the GP LineArt object and a fresh Suzanne. Resetting each of the LineArt setting to default did not fix it. Deleting and recreating the LineArt object, including the custom settings, would fix it. That lead me to believe it was holding onto some corrupted data under the hood? I couldn't recreate that crash from scratch though, and it seemed to mostly happen if rendering soon after loading the file, but would occasionally still happen on render of the file that had been open for hours. So I didn't end up submitting a bug report. I deleted and recreated the LineArt mod in the problem file and haven't seen that crash again, it's been a few LTS updates since then. It has started occasionally crashing while editing a mesh used by a particle system. Is it something with my hardware maybe?
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

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

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

I can still reproduce the bug.
For repro, make sure to:

  • open the file
  • unhide the "LineArt" object (in the outliner)
  • save the file
  • reopen the file
I can still reproduce the bug. For repro, make sure to: - open the file - unhide the "LineArt" object (in the outliner) - save the file - reopen the file
Member

@Bloop @mano-wii I finally got around. Seems this still haven't been fixed yet. I'll check asap

@Bloop @mano-wii I finally got around. Seems this still haven't been fixed yet. I'll check asap
Member

Confirmed the behaviour. I'm pretty much sure this is caused by evaluation order of line art being problematic... I'll probably use a hack to make it work during first load of the scene.

Confirmed the behaviour. I'm pretty much sure this is caused by evaluation order of line art being problematic... I'll probably use a hack to make it work during first load of the scene.

This issue was referenced by eca95d35ba

This issue was referenced by eca95d35bacc5858c01c2f3294b429577461c29a

This issue was referenced by 93fc352cfa

This issue was referenced by 93fc352cfaf0a38bd59d8bfb44c75bf5835ba3dd
Member

Ok I believe I fixed this since it's no longer crashing. But it's more or less a temporary solution.

The reason for the crash is Blender is evaluating two scenes at once when loading and this caused line art to be evaluated in parallel with the referenced "background scene" (because line art is designed to load everything visible). The dependency graph isn't set up to handle such usage of line art so we will eventually come up with some better ways for doing stuff.

This fix just ignores those "objects that aren't ready" when loading, so the first loading would be incorrect, but once you refresh the scene, like move the frame, it works as usual.

Ok I believe I fixed this since it's no longer crashing. But it's more or less a temporary solution. The reason for the crash is Blender is evaluating two scenes at once when loading and this caused line art to be evaluated in parallel with the referenced "background scene" (because line art is designed to load everything visible). The dependency graph isn't set up to handle such usage of line art so we will eventually come up with some better ways for doing stuff. This fix just ignores those "objects that aren't ready" when loading, so the first loading would be incorrect, but once you refresh the scene, like move the frame, it works as usual.
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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#102612
No description provided.