Blender crashes when using "spline" or "segments" for bevel curve factor. #41085
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
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#41085
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
OS X 10.8.5
NVIDIA GeForce GT 650M 1024 MB
Blender Version
Broken: 2.71
2f03ccc
and offical 2.719337574
Worked: ???
When animating the bevel factor of a complicated bezier curve, Blender crashes when using "spline" or "segments" for the beginning and end bevel factor. When using "resolution" there is no problem. If the end bevel factor is 1, it's okay, but as soon as you make it smaller, Blender crashes. On simple curves it's no problem, but on complicated/heavy curves it is.
If it helps, the error message from the console:
Exact steps for others to reproduce the error
Open attached blend-file and change the end bevel factor.
curve_bevel_crash.blend
Changed status to: 'Open'
Added subscriber: @jasperge-2
Added subscriber: @kevindietrich
I'm getting:
Error in `/home/kevin/src/blender-git/build_linux_debug/bin/blender': free(): invalid next size (normal): 0x0000000007936860
0x00007ffff3203f79 in raise () from /lib/x86_64-linux-gnu/libc.so.6
Added subscriber: @EjnerFergo
OS: Arch Linux 64
GFX: Nvidia GeForce GTX 560 1024MB
Blender: git-master
dfe1b9b
Didn't get a crash immediately, but had to slide the value up and down a bit. Tried 3 times, and 2 of the crash-logs looked like this:
And the last one was this:
Added subscriber: @LukasTonne
Can confirm an assert failure here:
https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/displist.c;57a3403bc08d71d851cbded1c08913f0402d994c$1443
Tried simplifying the curve because debugging an object like this is almost impossible. However, there seems to be a secondary bug: Selecting all except one vertex and deleting them gives another assert failure in GHash duplicates:
https://developer.blender.org/diffusion/B/browse/master/source/blender/blenlib/intern/BLI_ghash.c;57a3403bc08d71d851cbded1c08913f0402d994c$207
Added subscriber: @cnd
Here's the simplified .blend
The thing here is: bevel list will remove points if they're appearing to be on the same position. So pointsu*resoution could be totally dirrerent from the actual number of bevel points. This fact is totally ignored in
calc_bevfac_mapping
. This function should really always usebl->nr
actually..@cnd, do you have time to look into this code?
spline_mapping_crash.blend1
Yes I will have a look at it.
EDIT: What about calculating the length of curves directly in BKE_curve_bevelList_make() in STEP 2 ? I don't see any other reliable possibility to find out whether some bevpoints where omitted for optimization reasons. Would you agree on this?
I've been working on a fix. Had some other work to do first. Struggling with Phabricator again, therefore only a diff: #41085.diff
EDIT: What does it do?: By calculating the bevels of a curve it also stores the offset between bevels in BevPoint->offset. BevList now also stores the length of segments and the amount of bevels per segment (aka resolution per segment), since this number can differ if two curve points are equal.
@cnd, here's an updated patch fr you.T41085_2.diff Changes:
if (nu->type == CU_BEZIER) {
you've used the wrong length, which lead to bad memory access on differentiation, it should belen = segcount * resolu + 1;
Without this blender crashed for me instantly on opening the file i've attached here.There's at least one renaming issue: with the file i've attached above tweak End Factor. It'll make first start segment to disappear.
Same i see when replacing
MEM_callocN
withMEM_mallocN
for the new arrays. And the thing is, it seems all the elements of new arrays are expected to be initialized and it shouldn't matter if you use calloc or malloc apart form using malloc wouldn't waste time on memsetting the allocated memory. I guess it's some non-initialized segment or length or so is happening?Thank you for the corrections. The issue with the first segment disappearing was an small mistake of mine: move "bevp++;" from line 1398 to line 1393 and it should work out fine.
When I replace MEM_callocN with MEMmallocN I get a strange flickering of the beveled curve when sliding the factor sliders. I propose to leave it with MEM_callocN. There must be a reason why "bl" is initialized with MEM_callocN.
Attaching T41085_3.diff
If calloc works and malloc gives flickering it might mean you're not initializing some values in the loops..
T41085_4.diff
malloc: I was adding with "+= value" to uninitialized values when using malloc. I init them now with *seglen = 0 (on line 2726 for instance).
in curve.c --> BKE_curve_bevelList_make --> STEP2 I took out the redundant calculation of bevp->offset. it is being calculated already in STEP 1.
Added subscriber: @ideasman42
re: T41085_4.diff
Possible to make it that
bl->seglen
andbl->segbevcount
are only allocated when needed? - so if you aren't setting curve bevel factors (which isnt especially common), it doesn't bother allocating?Another note
if (a != segcount) printf("a != segcount");
-- rather just keep asserts here.Added subscriber: @Sergey
Attaching patch which tries to avoid unneeded calculations T41085_5.diff. Seems to be rather fine for beziers now, but nurbs fails a lot. Basically all the part under
is just wrong. It writes far pas the
seglen
array. Also not really sure, do we need to handleseglen
andsegbevcount
in a different way for path/bezier/nurbs?Seems made it working now T41085_6.diff
@ideasman42, mind having your hands on tests? :)
Managed to crash, add splint, duplicate, set bev depth 0.1, Set start end fact to anything. Alt+Mousewheel over bevel factor.
You may want to change bevel factor a bit... but for me it crashes quite fast, untitled.blend
Attaching fix for this T41085_7.diff
Fixed issue reported by asan T41085_8.patch
Just applied T41085_8.patch and tried hard to crash Blender, luckily without success. :)
Checked #41085, also tried to break but couldn't - LGTM
This issue was referenced by
6c7467e0da
Changed status from 'Open' to: 'Resolved'
Closed by commit
6c7467e0da
.