Blender crashes when beveling many vertices to a sharp point if Lineart is active #94390

Closed
opened 2021-12-26 15:54:42 +01:00 by Fen · 9 comments

System Information
Operating system: macOS-12.1-arm64-arm-64bit 64 Bits
Graphics card: Apple M1 Pro Apple 4.1 Metal - 76.3

Blender Version
Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: f1cca30557
Worked: LTS 2.93.7 hangs for a few seconds, but doesn't seem to crash.

Short description of error
Beveling an n-gon with lots of vertices to a sharp point causes a segfault if a Lineart modifier is using the mesh.

Exact steps for others to reproduce the error

  1. Add a cylinder with 128 sides and a Scene Lineart object
  2. Select the top face
  3. Bevel edges
  4. Drag until the sides meet at a point
  5. Segfault

The attached lineart-bevel-crash.blend file is set up; just bevel and drag and it should crash. I have not tested this on other platforms, however.

lineart-bevel-crash.blend

Full stacktrace: P2682

**System Information** Operating system: macOS-12.1-arm64-arm-64bit 64 Bits Graphics card: Apple `M1` Pro Apple 4.1 Metal - 76.3 **Blender Version** Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: `f1cca30557` Worked: LTS 2.93.7 hangs for a few seconds, but doesn't seem to crash. **Short description of error** Beveling an n-gon with lots of vertices to a sharp point causes a segfault if a Lineart modifier is using the mesh. **Exact steps for others to reproduce the error** 1. Add a cylinder with 128 sides and a Scene Lineart object 2. Select the top face 3. Bevel edges 4. Drag until the sides meet at a point 5. Segfault The attached lineart-bevel-crash.blend file is set up; just bevel and drag and it should crash. I have not tested this on other platforms, however. [lineart-bevel-crash.blend](https://archive.blender.org/developer/F12776592/lineart-bevel-crash.blend) Full stacktrace: [P2682](https://archive.blender.org/developer/P2682.txt)
Author

Added subscriber: @chemicalcrux

Added subscriber: @chemicalcrux
Author

I also get a segfault from the latest commit on master, 28a8d434d5

I also get a segfault from the latest commit on master, 28a8d434d5
Member

Added subscriber: @ChengduLittleA

Added subscriber: @ChengduLittleA
YimingWu self-assigned this 2021-12-26 17:20:29 +01:00
Member

I'll take a look

I'll take a look

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

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

It didn't really crash here on my machine but after I bevel it to a sharp point or go further it immediately becomes much more laggy. I need to take a look on what's causing it, maybe there's too much depth in subdividing image bound box (there are more than 256 triangles concentrating inside 1 point so it kinda confuses the algorithm). From the stack trace it could be a memory issue, however on my machine I didn't really see any memory spike, debug info shows only allocated 6 Standalone nodes, total 6291456 Bytes. hummm. This is quite interesting I shall investigate further.


Update: I found the cause of this specific crash, which is cause by a duplicated "edge-boundbox" linking, this added too many edge pointers into a tile that overflows the limit. This bug is probably caused by a merge which it automatically modified some code path that I'm unaware of. HOWEVER After I fix this it still crashes, :/

OK it is this problem indeed... And it's fixed now at least for the test file you provided. There's still a internal limit of line art of triangle density, I need to protect that array so it won't get overflowed.

It didn't really crash here on my machine but after I bevel it to a sharp point or go further it immediately becomes much more laggy. I need to take a look on what's causing it, maybe there's too much depth in subdividing image bound box (there are more than 256 triangles concentrating inside 1 point so it kinda confuses the algorithm). From the stack trace it could be a memory issue, however on my machine I didn't really see any memory spike, debug info shows only `allocated 6 Standalone nodes, total 6291456 Bytes.` hummm. This is quite interesting I shall investigate further. ----- Update: I found the cause of this specific crash, which is cause by a duplicated "edge-boundbox" linking, this added too many edge pointers into a tile that overflows the limit. This bug is probably caused by a merge which it automatically modified some code path that I'm unaware of. ~~HOWEVER After I fix this it still crashes, :/~~ OK it is this problem indeed... And it's fixed now at least for the test file you provided. There's still a internal limit of line art of triangle density, I need to protect that array so it won't get overflowed.
Member

Changed status from 'Confirmed' to: 'Resolved'

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

Added a protect condition to not add too many lines in one tiles in case that you got very dense concentration of geometry in one point like the "bevel to one point" situation.

I may also include a check in the loading stage to discard edges that has zero length and triangles that has zero area.

Added a protect condition to not add too many lines in one tiles in case that you got very dense concentration of geometry in one point like the "bevel to one point" situation. I may also include a check in the loading stage to discard edges that has zero length and triangles that has zero area.
Member

The same fix is now included into temp-lineart-contained branch as well to prevent crash. Also it's faster :)

The same fix is now included into `temp-lineart-contained` branch as well to prevent crash. Also it's faster :)
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
3 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#94390
No description provided.