Crash: Vertex snapping with Target: "Active" based on Pivot Point: "3D Cursor" when Active is at 3D Cursor location #57923

Closed
opened 2018-11-18 23:49:38 +01:00 by Malte S · 12 comments

System Information
Windows 10
Nvidia GTX 980

Blender Version
Broken: (2.80 Alpha 2 Hash:2c348ebbba9 Date: 2018-11-16)

Short description of error
Blender Crashes when a mesh is scaled with Vertex snapping with the setting Target to Active if the Pivot Point is set to 3D Cursor and the Active vertex is at the same position as the 3D cursor. This happen only if the scaled mesh has more than 15~ verts.

Exact steps for others to reproduce the error
Open Blender
leave the Cube as it is and add a Plane
Move the plane up 2m (Just to see it)
enter the Editmode for the Plane
subdivide it twice (This is important otherwise Blender wil not crash)
select one of the Corner verts
snap 3D cursor to selected
set Pivot point to 3D Cursor
enable Snapping to Vertex with Target to Active
Select the Entire Plane the Active vert is still at the 3D Cursor position
Scale the Plane and snap it to one of the Verts of the default Cube. (or anything else)
CRASH

**System Information** Windows 10 Nvidia GTX 980 **Blender Version** Broken: (2.80 Alpha 2 Hash:2c348ebbba9 Date: 2018-11-16) **Short description of error** Blender Crashes when a mesh is scaled with Vertex snapping with the setting Target to Active if the Pivot Point is set to 3D Cursor and the Active vertex is at the same position as the 3D cursor. This happen only if the scaled mesh has more than 15~ verts. **Exact steps for others to reproduce the error** Open Blender leave the Cube as it is and add a Plane Move the plane up 2m (Just to see it) enter the Editmode for the Plane subdivide it twice (This is important otherwise Blender wil not crash) select one of the Corner verts snap 3D cursor to selected set Pivot point to 3D Cursor enable Snapping to Vertex with Target to Active Select the Entire Plane the Active vert is still at the 3D Cursor position Scale the Plane and snap it to one of the Verts of the default Cube. (or anything else) CRASH
Author

Added subscriber: @pandrodor

Added subscriber: @pandrodor
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Confirmed, having a look...

Confirmed, having a look...
Bastien Montagne was assigned by Philipp Oeser 2018-11-20 13:58:15 +01:00
Member

Added subscriber: @mont29

Added subscriber: @mont29
Member

For me, blender is freezing here.
Was not the case in 2.79b, but happens in 2.79 master and 2.8. For 2.8 I have checked Debug and Release builds.
Guess this has to do with OMP removal (and its substitution in 43ddf0e9a7, 3c1f3c02c6)

Freeze because it never breaks out of this here .

@mont29: have an idea (I certainly dont...)?

For me, blender is freezing here. Was not the case in 2.79b, but happens in 2.79 master and 2.8. For 2.8 I have checked Debug and Release builds. Guess this has to do with OMP removal (and its substitution in 43ddf0e9a7, 3c1f3c02c6) Freeze because it never breaks out of [this here ](https://developer.blender.org/diffusion/B/browse/blender2.8/source/blender/bmesh/intern/bmesh_mesh.c;129b8833c6619ad0b4389d28eed6c8dc015ad23c$410). @mont29: have an idea (I certainly dont...)?

Please ALWAYS add minimal file to reproduce the issue, saves us some time, and ensures we have the correct setup to reproduce the issue!

t57923_vertex_snapping_crash.blend

Using the one above, cannot reproduce on linux. @pandrodor @lichtwerk can you confirm it happens for you with that file?

@lichtwerk are you on windows, if yes, latest win10? If so, could be a different behavior in atomic_cas :/

Please **ALWAYS** add minimal file to reproduce the issue, saves us some time, and ensures we have the correct setup to reproduce the issue! [t57923_vertex_snapping_crash.blend](https://archive.blender.org/developer/F5651516/t57923_vertex_snapping_crash.blend) Using the one above, cannot reproduce on linux. @pandrodor @lichtwerk can you confirm it happens for you with that file? @lichtwerk are you on windows, if yes, latest win10? If so, could be a different behavior in atomic_cas :/
Member

@mont29: try

#57923.blend

(think the difference is that in my file there is an explicit active vert [white], if I shift-click the corner vert twice [to get it active] in your file, I get the freeze there, too...)

I'm on linux, gcc version 8.2.1 20181105 (Red Hat 8.2.1-5) (GCC) if that makes a difference

@mont29: try [#57923.blend](https://archive.blender.org/developer/F5651678/T57923.blend) (think the difference is that in my file there is an explicit active vert [white], if I shift-click the corner vert twice [to get it active] in your file, I get the freeze there, too...) I'm on linux, `gcc version 8.2.1 20181105 (Red Hat 8.2.1-5) (GCC)` if that makes a difference

Thanks, can confirm I can reproduce with the active vert.

Thanks, can confirm I can reproduce with the active vert.

Eeeh… that’s a rather hairy issue, which originates very far away from where it errors! To summarize:

  • pointed code (multi-threaded virtually locked section using CAS instead of slow mutex) has one flaw: not all float values work in comparison, NAN never equals to anything, even itself!
    Easy fix: use memcmp instead of equality operator (but this can be much, much slower...). More 'smart' fix: pointer-cast to uint32_t, and compare those. This should be at least as efficient as float comparison, and bypass the NAN exception.
  • Actual source of the error is somewhere in transform code (presumably snapping part of it), that generates pure insane values leading to totally degenerated mesh.
    Will fix the normal accumulator code so that it just skips degenerated geometry. What would be actual correct handling here am not sure at all. Afaikt, official 2.79 already exhibits broken behavior. So will consider this another, unrelated issue. ;)
Eeeh… that’s a rather hairy issue, which originates very far away from where it errors! To summarize: * pointed code (multi-threaded virtually locked section using CAS instead of slow mutex) has one flaw: not **all** float values work in comparison, NAN never equals to anything, even itself! **Easy fix: use memcmp instead of equality operator (but this can be much, much slower...).** More 'smart' fix: pointer-cast to uint32_t, and compare those. This should be at least as efficient as float comparison, and bypass the NAN exception. * Actual source of the error is somewhere in transform code (presumably snapping part of it), that generates pure insane values leading to totally degenerated mesh. **Will fix the normal accumulator code so that it just skips degenerated geometry.** What would be actual correct handling here am not sure at all. Afaikt, official 2.79 already exhibits broken behavior. So will consider this another, unrelated issue. ;)

This issue was referenced by c9c6433a59

This issue was referenced by c9c6433a59549dbdf56298ae81a0b890639a6e0b

This issue was referenced by ec851efda9

This issue was referenced by ec851efda93ed19c9f7063c6167ae9437ed6803c

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
4 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blender/blender#57923
No description provided.