Crash when using Mirror with Source set to Verts in particle edit mode #84142
Labels
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#84142
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 457.30
Blender Version
Broken: version:
b439a15544
0f45cab862
Short description of error
Blender should crash.
Added subscriber: @sebus_93
Added subscriber: @robbott
Open the following file and click in the viewport menu "Particle > Mirror" -> crash.
Confirmed on version: 2.92.0 Alpha, branch: master, commit date: 2020-12-25 22:13, hash:
8491e4ab86
#84142.blend
Added subscriber: @idomo-1
Here's what I think may be causing this crash
Suppose we are using the default cube, which has 8 vertices and 6 faces
The function
PE_mirror_x
inparticle_edit.c
gets this arrayThe function
mesh_get_x_mirror_faces
inmeshtools.c
returns an array which is populated up to 2 * total faces of the mesh + 1 = 2 * 6 + 1 = 13mirrormf.v1 = mirrorverts[mf->v3];
mirrormf.v2 = mirrorverts[mf->v2];
mirrormf.v3 = mirrorverts[mf->v1];
mirrormf.v4 = (mf->v4) ? mirrorverts[mf->v4] : 0;
/* make sure v4 is not 0 if a quad */
if (mf->v4 && mirrormf.v4 == 0) {
SWAP(uint, mirrormf.v1, mirrormf.v3);
SWAP(uint, mirrormf.v2, mirrormf.v4);
}
hashmf = BLI_ghash_lookup(fhash, &mirrormf);
if (hashmf) {
mirrorfaces[a * 2] = hashmf - mface;
mirrorfaces[a * 2 + 1] = mirror_facerotation(&mirrormf, hashmf);
}
else {
mirrorfaces[a * 2] = -1;
}
}
BLI_ghash_free(fhash, NULL, NULL);
MEM_freeN(mirrorverts);
return mirrorfaces;
Then this array gets indexed using
pa->num * 2
wherepa->num
is the vertex index I think?Since there are 8 vertices (i.e pa_num=7, 7*2 = 14), this accesses garbage
This garbage value ends up being passed to
psys_particle_dm_face_lookup
inparticle.c
, and causes a seg fault on this lineHere's the backtrace for more context
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can also confirm, even 2.79b crashed here.
Thx investigating @idomo-1 !
Crash when using Mirror with Sours set to Verts in particle edit modeto Crash when using Mirror with Source set to Verts in particle edit modeNot sure if this has still chances to get fixed [since old particles and old hair are EOL], but there are a couple of places that get face indices back when emission takes place from vertices.
Look for these comments:
Added subscriber: @JacquesLucke
The
mirrorfaces[pa->num * 2]
expression seems to suggest that thePE_mirror_x
has been designed to work only whenpa->num
is a face index. I think the short term fix is to change disable the operator in other cases.This issue was referenced by
c55b578c9e
Changed status from 'Confirmed' to: 'Resolved'