Remesh-bug.crash #92355

Closed
opened 2021-10-19 22:18:24 +02:00 by Paolo Furani · 27 comments

System Information
Operating system: Linux-4.15.0-159-generic-x86_64-with-glibc2.27 64 Bits
Graphics card: Mesa DRI Intel(R) HD Graphics 5500 (BDW GT2) Intel Open Source Technology Center 4.6 (Core Profile) Mesa 20.0.8

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-10-18 21:38, hash: d7b231baa8
Worked: (newest version of Blender that worked as expected)

Short description of error
Hi when I try to use the remesh command on this object, Blender crashes

crash-report

# Blender 3.0.0, Commit date: 2021-10-18 21:38, Hash d7b231baa87e
bpy.context.space_data.context = 'DATA'  # Property
bpy.context.object.data.remesh_mode = 'QUAD'  # Property
bpy.data.window_managers["WinMan"].(null) = False  # Property
bpy.data.window_managers["WinMan"].(null) = True  # Property
bpy.data.window_managers["WinMan"].(null) = True  # Property
bpy.ops.object.quadriflow_remesh(use_mesh_symmetry=False, use_preserve_sharp=True, use_preserve_boundary=True)  # Operator
QuadriFlow: Remeshing completed  # Info
bpy.ops.object.editmode_toggle()  # Operator
bpy.ops.object.editmode_toggle()  # Operator
bpy.ops.object.delete(use_global=False, confirm=False)  # Operator
Deleted 1 object(s)  # Info
bpy.context.space_data.recent_folders_active = 0  # Property
bpy.ops.object.hide_view_set(unselected=False)  # Operator
bpy.ops.object.select_all(action='SELECT')  # Operator
bpy.data.window_managers["WinMan"].(null) = "bool-obj"  # Property
bpy.ops.object.move_to_collection(collection_index=0, is_new=True, new_collection_name="bool-obj")  # Operator
Objects moved to bool-obj  # Info
bpy.data.scenes["Scene"].(null) = True  # Property
bpy.data.scenes["Scene"].(null) = False  # Property
bpy.ops.object.convert(target='MESH')  # Operator
bpy.context.space_data.params.filename = "remesh-bug.blend"  # Property
Saved "remesh-bug.blend"  # Info
bpy.ops.outliner.item_activate(deselect_all=True)  # Operator
bpy.ops.outliner.delete(hierarchy=True)  # Operator
Saved "remesh-bug.blend"  # Info
bpy.context.object.data.remesh_mode = 'QUAD'  # Property
bpy.ops.object.quadriflow_remesh()  # Operator

# backtrace
/home/pafu/Software/blender-3.0.0/blender(BLI_system_backtrace+0x20) [0xaf71120]
/home/pafu/Software/blender-3.0.0/blender() [0x109e04b]
/lib/x86_64-linux-gnu/libc.so.6(+0x3f040) [0x7fb4c2537040]
/home/pafu/Software/blender-3.0.0/blender(AUD_Device_getRate+0x3d) [0x9ce251d]
/home/pafu/Software/blender-3.0.0/blender(BKE_sound_scene_playing+0x20) [0x118d760]
/home/pafu/Software/blender-3.0.0/blender(wm_event_do_handlers+0xa6) [0x149b416]
/home/pafu/Software/blender-3.0.0/blender(WM_main+0x20) [0x1491620]
/home/pafu/Software/blender-3.0.0/blender(main+0x31e) [0xf875ae]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7fb4c2519bf7]
/home/pafu/Software/blender-3.0.0/blender() [0x109a9ac]

# Python backtrace

Exact steps for others to reproduce the error

  • Open .blend file
  • {nav Object Data Properties > Remesh > Quad > QuadriFlow Remesh}
  • Refer image for the settings
    {F11295360}
    {F11295382}
**System Information** Operating system: Linux-4.15.0-159-generic-x86_64-with-glibc2.27 64 Bits Graphics card: Mesa DRI Intel(R) HD Graphics 5500 (BDW GT2) Intel Open Source Technology Center 4.6 (Core Profile) Mesa 20.0.8 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-10-18 21:38, hash: `d7b231baa8` Worked: (newest version of Blender that worked as expected) **Short description of error** Hi when I try to use the remesh command on this object, Blender crashes **crash-report** ```lines # Blender 3.0.0, Commit date: 2021-10-18 21:38, Hash d7b231baa87e bpy.context.space_data.context = 'DATA' # Property bpy.context.object.data.remesh_mode = 'QUAD' # Property bpy.data.window_managers["WinMan"].(null) = False # Property bpy.data.window_managers["WinMan"].(null) = True # Property bpy.data.window_managers["WinMan"].(null) = True # Property bpy.ops.object.quadriflow_remesh(use_mesh_symmetry=False, use_preserve_sharp=True, use_preserve_boundary=True) # Operator QuadriFlow: Remeshing completed # Info bpy.ops.object.editmode_toggle() # Operator bpy.ops.object.editmode_toggle() # Operator bpy.ops.object.delete(use_global=False, confirm=False) # Operator Deleted 1 object(s) # Info bpy.context.space_data.recent_folders_active = 0 # Property bpy.ops.object.hide_view_set(unselected=False) # Operator bpy.ops.object.select_all(action='SELECT') # Operator bpy.data.window_managers["WinMan"].(null) = "bool-obj" # Property bpy.ops.object.move_to_collection(collection_index=0, is_new=True, new_collection_name="bool-obj") # Operator Objects moved to bool-obj # Info bpy.data.scenes["Scene"].(null) = True # Property bpy.data.scenes["Scene"].(null) = False # Property bpy.ops.object.convert(target='MESH') # Operator bpy.context.space_data.params.filename = "remesh-bug.blend" # Property Saved "remesh-bug.blend" # Info bpy.ops.outliner.item_activate(deselect_all=True) # Operator bpy.ops.outliner.delete(hierarchy=True) # Operator Saved "remesh-bug.blend" # Info bpy.context.object.data.remesh_mode = 'QUAD' # Property bpy.ops.object.quadriflow_remesh() # Operator # backtrace /home/pafu/Software/blender-3.0.0/blender(BLI_system_backtrace+0x20) [0xaf71120] /home/pafu/Software/blender-3.0.0/blender() [0x109e04b] /lib/x86_64-linux-gnu/libc.so.6(+0x3f040) [0x7fb4c2537040] /home/pafu/Software/blender-3.0.0/blender(AUD_Device_getRate+0x3d) [0x9ce251d] /home/pafu/Software/blender-3.0.0/blender(BKE_sound_scene_playing+0x20) [0x118d760] /home/pafu/Software/blender-3.0.0/blender(wm_event_do_handlers+0xa6) [0x149b416] /home/pafu/Software/blender-3.0.0/blender(WM_main+0x20) [0x1491620] /home/pafu/Software/blender-3.0.0/blender(main+0x31e) [0xf875ae] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7fb4c2519bf7] /home/pafu/Software/blender-3.0.0/blender() [0x109a9ac] # Python backtrace ``` **Exact steps for others to reproduce the error** - Open .blend file - {nav Object Data Properties > Remesh > Quad > QuadriFlow Remesh} - Refer image for the settings {F11295360} {F11295382}
Author

Added subscriber: @pafurijaz-4

Added subscriber: @pafurijaz-4

#92484 was marked as duplicate of this issue

#92484 was marked as duplicate of this issue

#92391 was marked as duplicate of this issue

#92391 was marked as duplicate of this issue
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

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

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

Added subscribers: @ZedDB, @Sergey, @neXyon, @lichtwerk

Added subscribers: @ZedDB, @Sergey, @neXyon, @lichtwerk
Member

Apparently we are confronted with a NULL Audio device (this might be because remesh is fiddeling with a scene in a background job [I recall something with remesh and the scene being the job owner and not the mesh object] -- but I have not checked further), so security check in sound_verify_evaluated_id is not enough it seems.

CC @ZedDB
CC @neXyon
CC @Sergey

But this also might not be the "real" problem, when doing something like the following (to avoid the crash in Audio)
P2517: T92355_snippet



diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index f523c5e02bd..af61ec69535 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -994,6 +994,10 @@ int BKE_sound_scene_playing(Scene *scene)
     return -1;
   }
 
+  if (sound_device == NULL) {
+    return -1;
+  }
+
   /* In case of a "None" audio device, we have no playback information. */
   if (AUD_Device_getRate(sound_device) == AUD_RATE_INVALID) {
     return -1;

we are then getting here (which also does not sound pleasing): https://developer.blender.org/diffusion/B/browse/master/extern/quadriflow/src/subdivide.cpp$503

Apparently we are confronted with a NULL Audio device (this might be because remesh is fiddeling with a scene in a background job [I recall something with remesh and the scene being the job owner and not the mesh object] -- but I have not checked further), so security check in `sound_verify_evaluated_id` is not enough it seems. CC @ZedDB CC @neXyon CC @Sergey But this also might not be the "real" problem, when doing something like the following (to avoid the crash in Audio) [P2517: T92355_snippet](https://archive.blender.org/developer/P2517.txt) ``` diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index f523c5e02bd..af61ec69535 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -994,6 +994,10 @@ int BKE_sound_scene_playing(Scene *scene) return -1; } + if (sound_device == NULL) { + return -1; + } + /* In case of a "None" audio device, we have no playback information. */ if (AUD_Device_getRate(sound_device) == AUD_RATE_INVALID) { return -1; ``` we are then getting here (which also does not sound pleasing): https://developer.blender.org/diffusion/B/browse/master/extern/quadriflow/src/subdivide.cpp$503

remesh is fiddeling with a scene in a background job

Such tools are expected to localize data in the job's init function (which is run on the main thread) and do not fiddle around with data which is accessed by the main thread. If the remesh is indeed fiddeling with non-localized data it is to be addressed at a much higher priority than adding nullptr checks.

> remesh is fiddeling with a scene in a background job Such tools are expected to localize data in the job's init function (which is run on the main thread) and do not fiddle around with data which is accessed by the main thread. If the remesh is indeed fiddeling with non-localized data it is to be addressed at a much higher priority than adding nullptr checks.
Member

In #92355#1238493, @Sergey wrote:

remesh is fiddeling with a scene in a background job

Such tools are expected to localize data in the job's init function (which is run on the main thread) and do not fiddle around with data which is accessed by the main thread. If the remesh is indeed fiddeling with non-localized data it is to be addressed at a much higher priority than adding nullptr checks.

Sorry, this might have come across wrong, not sure quadriflow is actually altering anything scene related in the job (it was just my foggy memory of the job being owned by the scene [and not by to object -- but I also recall this had its reasons: progressbar etc]

> In #92355#1238493, @Sergey wrote: >> remesh is fiddeling with a scene in a background job > > Such tools are expected to localize data in the job's init function (which is run on the main thread) and do not fiddle around with data which is accessed by the main thread. If the remesh is indeed fiddeling with non-localized data it is to be addressed at a much higher priority than adding nullptr checks. Sorry, this might have come across wrong, not sure quadriflow is actually `altering` anything scene related in the job (it was just my foggy memory of the job being owned by the scene [and not by to object -- but I also recall this had its reasons: progressbar etc]
Member

Looks like a depsgraph/memory related bug where I cannot do much!?

Looks like a depsgraph/memory related bug where I cannot do much!?

The model has several zero length edges which quadriflow can't handle.
(Use "merge by distance" to remove these and it will not crash anymore)

I will have to update the mesh manifold check to check for these.

The reason why we get the backtrace to the sound system is because of race condition were instead of crashing, quadriflow calls exit() and blender frees all scene data while an other thread tries to access it.

The model has several zero length edges which quadriflow can't handle. (Use "merge by distance" to remove these and it will not crash anymore) I will have to update the mesh manifold check to check for these. The reason why we get the backtrace to the sound system is because of race condition were instead of crashing, quadriflow calls `exit()` and blender frees all scene data while an other thread tries to access it.
Author

Hi the original model is this but with no boolean modifiers applied.
retopology-experiments.blend

Hi the original model is this but with no boolean modifiers applied. [retopology-experiments.blend](https://archive.blender.org/developer/F11361251/retopology-experiments.blend)
Author

On Blender 2.83LST it works fine, the problem is in 293.lts and in Blender version 3.0

Below the attached file with two objects to do the tests and it works as seen from the video screen.
Remesh-2.8LTS-OK.png
remesh-B2.83lts.blend

On Blender 2.83LST it works fine, the problem is in 293.lts and in Blender version 3.0

Below the attached file with two objects to do the tests and it works as seen from the video screen. ![Remesh-2.8LTS-OK.png](https://archive.blender.org/developer/F11361547/Remesh-2.8LTS-OK.png) [remesh-B2.83lts.blend](https://archive.blender.org/developer/F11361545/remesh-B2.83lts.blend)

The latest file you attached works in master as well (because it doesn't have zero length edges).

I'm unsure what you are trying to say.

The latest file you attached works in master as well (because it doesn't have zero length edges). I'm unsure what you are trying to say.
Author

In the first I applied the modifiers with Blender 3.0 and in the second I imported the scene in Blender 2.83, and I applied the modifiers and I ran the command remesh, this means that in Blender 3.0 and in Blender 2.93 when you apply the modifiers both generate a corrupted mesh is .
You can try because I attached the original file from which I imported the scene from 3.0 to test with Blender 2.83LST, I don't know what the problem is but it is not that one has to remodel or redo the objects it is evident that there is a problem.

In the first I applied the modifiers with Blender 3.0 and in the second I imported the scene in Blender 2.83, and I applied the modifiers and I ran the command remesh, this means that in Blender 3.0 and in Blender 2.93 when you apply the modifiers both generate a corrupted mesh is . You can try because I attached the original file from which I imported the scene from 3.0 to test with Blender 2.83LST, I don't know what the problem is but it is not that one has to remodel or redo the objects it is evident that there is a problem.

Did you try the latest 3.0 version?

For me applying the modifiers doesn't not create zero length edges in master.

Did you try the latest 3.0 version? For me applying the modifiers doesn't not create zero length edges in master.

This issue was referenced by 77104bf318

This issue was referenced by 77104bf31891229e7d18ab56506ce6f456491eb0

This issue was referenced by 10fb5cc58d

This issue was referenced by 10fb5cc58d210592ef0ae410e305be906ad5ce51

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sebastian Parborg self-assigned this 2021-10-21 15:17:15 +02:00

In either case, the issue with generating invalid meshes is an other issue. So the reported crash has been "fixed", so I'll close this.

In either case, the issue with generating invalid meshes is an other issue. So the reported crash has been "fixed", so I'll close this.
Author

But what do you say this is a crash problem which originated from a file where I applied the modifiers and then tried to use the remesh command, it's not another problem it's a problem with Blender 3.0

But what do you say this is a crash problem which originated from a file where I applied the modifiers and then tried to use the remesh command, it's not another problem it's a problem with Blender 3.0
Author

In #92355#1239161, @ZedDB wrote:
Did you try the latest 3.0 version?

For me applying the modifiers doesn't not create zero length edges in master.

I've tested now and it's crash this is the file made with Blender 3.0 the other for 2.83lts has a different boolean object when the one for the 3.0 has an object made by boolean union

The original model is this but with no modifiers applied.
retopology-experiments.blend

> In #92355#1239161, @ZedDB wrote: > Did you try the latest 3.0 version? > > For me applying the modifiers doesn't not create zero length edges in master. I've tested now and it's crash this is the file made with Blender 3.0 the other for 2.83lts has a different boolean object when the one for the 3.0 has an object made by boolean union The original model is this but with no modifiers applied. [retopology-experiments.blend](https://archive.blender.org/developer/F11361251/retopology-experiments.blend)

I'm saying that the invalid geometry generated by the boolean modifier is an other issue.
You reported that blender crashed when quadriflow was used on bad meshes with zero length edges.

I've added a check so the operator does not run on meshes with zero edge length edges now.
So the issue for this ticket is fixed and now closed.

I'm saying that the invalid geometry generated by the boolean modifier is an other issue. You reported that blender crashed when quadriflow was used on bad meshes with zero length edges. I've added a check so the operator does not run on meshes with zero edge length edges now. So the issue for this ticket is fixed and now closed.
Author

In #92355#1239242, @ZedDB wrote:
I'm saying that the invalid geometry generated by the boolean modifier is an other issue.
You reported that blender crashed when quadriflow was used on bad meshes with zero length edges.

I've added a check so the operator does not run on meshes with zero edge length edges now.
So the issue for this ticket is fixed and now closed.

Ok so now I've to create an other report for this issue?

> In #92355#1239242, @ZedDB wrote: > I'm saying that the invalid geometry generated by the boolean modifier is an other issue. > You reported that blender crashed when quadriflow was used on bad meshes with zero length edges. > > I've added a check so the operator does not run on meshes with zero edge length edges now. > So the issue for this ticket is fixed and now closed. Ok so now I've to create an other report for this issue?

If someone else hasn't already reported this issue, then you should report it as an other issue, yes.

If someone else hasn't already reported this issue, then you should report it as an other issue, yes.

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Added subscriber: @iss

Added subscriber: @iss
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#92355
No description provided.