Crash when using curve deform #82988

Closed
opened 2020-11-25 05:55:55 +01:00 by Pasang Bomjan · 10 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce RTX 2060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 457.09

Blender Version
Broken: version: 2.91.0 Beta, branch: master, commit date: 2020-11-17 08:33, hash: 2e1498ff16
Worked: Likely never, problematic code existed since at least 2.61.

Short description of error
Crash when using the curve deform modifier.

Exact steps for others to reproduce the error
Curve Crash.blend
Open the given file and set the deform axis to either Z or -Z

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce RTX 2060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 457.09 **Blender Version** Broken: version: 2.91.0 Beta, branch: master, commit date: 2020-11-17 08:33, hash: `2e1498ff16` Worked: Likely never, problematic code existed since at least 2.61. **Short description of error** Crash when using the curve deform modifier. **Exact steps for others to reproduce the error** [Curve Crash.blend](https://archive.blender.org/developer/F9369856/Curve_Crash.blend) Open the given file and set the deform axis to either Z or -Z
Author

Added subscriber: @Pasang

Added subscriber: @Pasang

Added subscriber: @rjg

Added subscriber: @rjg

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

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

This only crashes in debug builds because it triggers the BLI_assert(cycl || ctime >= 0.0f); in where_on_path. The ctime doesn't appear to be a valid floating point number.

_BLI_assert_abort() Lines 51	C
where_on_path(const Object * ob, float ctime, float * r_vec, float * r_dir, float * r_quat, float * r_radius, float * r_weight) Lines 249	C
where_on_path_deform(const Object * ob_curve, float ctime, float * r_vec, float * r_dir, float * r_quat, float * r_radius) Lines 103	C
calc_curve_deform(const Object * ob_curve, float * co, const short axis, const CurveDeform * cd, float * r_quat) Lines 187	C
curve_deform_coords_impl(const Object * ob_curve, const Object * ob_target, float- [x] * vert_coords, const int vert_coords_len, const MDeformVert * dvert, const int defgrp_index, const short flag, const short defaxis, BMEditMesh * em_target) Lines 423	C
BKE_curve_deform_coords(const Object * ob_curve, const Object * ob_target, float- [x] * vert_coords, const int vert_coords_len, const MDeformVert * dvert, const int defgrp_index, const short flag, const short defaxis) Lines 440	C
deformVerts(ModifierData * md, const ModifierEvalContext * ctx, Mesh * mesh, float- [x] * vertexCos, int numVerts) Lines 148	C
BKE_modifier_deform_verts(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me, float- [x] * vertexCos, int numVerts) Lines 1038	C
mesh_calc_modifiers(Depsgraph * depsgraph, Scene * scene, Object * ob, int useDeform, const bool need_mapping, const CustomData_MeshMasks * dataMask, const int index, const bool use_cache, const bool allow_shared_mesh, Mesh * * r_deform, Mesh * * r_final) Lines 1102	C
mesh_build_data(Depsgraph * depsgraph, Scene * scene, Object * ob, const CustomData_MeshMasks * dataMask, const bool need_mapping) Lines 1806	C
makeDerivedMesh(Depsgraph * depsgraph, Scene * scene, Object * ob, BMEditMesh * em, const CustomData_MeshMasks * dataMask) Lines 1927	C
BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Lines 194	C
BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Lines 385	C
 	[External Code]	
blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) Lines 115	C++
blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata) Lines 127	C++
Task::()::__l2::<Lambdafunktion>() Lines 118	C++
tbb::interface7::internal::delegated_function<void <Lambdafunktion>(void) const ,void>::operator()() Lines 94	C++
 	[External Code]	
tbb::interface7::internal::isolate_impl<void,void <Lambdafunktion>(void) const>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Lines 161	C++
tbb::interface7::this_task_arena::isolate<void <Lambdafunktion>(void)>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Lines 396	C++
Task::operator()() Lines 122	C++
tbb::internal::function_task<Task>::execute() Lines 1049	C++
This only crashes in debug builds because it triggers the `BLI_assert(cycl || ctime >= 0.0f);` in `where_on_path`. The `ctime` doesn't appear to be a valid floating point number. ```lines _BLI_assert_abort() Lines 51 C where_on_path(const Object * ob, float ctime, float * r_vec, float * r_dir, float * r_quat, float * r_radius, float * r_weight) Lines 249 C where_on_path_deform(const Object * ob_curve, float ctime, float * r_vec, float * r_dir, float * r_quat, float * r_radius) Lines 103 C calc_curve_deform(const Object * ob_curve, float * co, const short axis, const CurveDeform * cd, float * r_quat) Lines 187 C curve_deform_coords_impl(const Object * ob_curve, const Object * ob_target, float- [x] * vert_coords, const int vert_coords_len, const MDeformVert * dvert, const int defgrp_index, const short flag, const short defaxis, BMEditMesh * em_target) Lines 423 C BKE_curve_deform_coords(const Object * ob_curve, const Object * ob_target, float- [x] * vert_coords, const int vert_coords_len, const MDeformVert * dvert, const int defgrp_index, const short flag, const short defaxis) Lines 440 C deformVerts(ModifierData * md, const ModifierEvalContext * ctx, Mesh * mesh, float- [x] * vertexCos, int numVerts) Lines 148 C BKE_modifier_deform_verts(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me, float- [x] * vertexCos, int numVerts) Lines 1038 C mesh_calc_modifiers(Depsgraph * depsgraph, Scene * scene, Object * ob, int useDeform, const bool need_mapping, const CustomData_MeshMasks * dataMask, const int index, const bool use_cache, const bool allow_shared_mesh, Mesh * * r_deform, Mesh * * r_final) Lines 1102 C mesh_build_data(Depsgraph * depsgraph, Scene * scene, Object * ob, const CustomData_MeshMasks * dataMask, const bool need_mapping) Lines 1806 C makeDerivedMesh(Depsgraph * depsgraph, Scene * scene, Object * ob, BMEditMesh * em, const CustomData_MeshMasks * dataMask) Lines 1927 C BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Lines 194 C BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Lines 385 C [External Code] blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) Lines 115 C++ blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata) Lines 127 C++ Task::()::__l2::<Lambdafunktion>() Lines 118 C++ tbb::interface7::internal::delegated_function<void <Lambdafunktion>(void) const ,void>::operator()() Lines 94 C++ [External Code] tbb::interface7::internal::isolate_impl<void,void <Lambdafunktion>(void) const>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Lines 161 C++ tbb::interface7::this_task_arena::isolate<void <Lambdafunktion>(void)>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Lines 396 C++ Task::operator()() Lines 122 C++ tbb::internal::function_task<Task>::execute() Lines 1049 C++ ```

I'll try to investigate this. I currently don't have a debug build from before 2.91, but earlier versions may also be affected.

I'll try to investigate this. I currently don't have a debug build from before 2.91, but earlier versions may also be affected.

It seems the factor calculation in calc_curve_deform doesn't handle edge cases for floating point division well/correctly and a division by zero can occur.

It seems the factor calculation in `calc_curve_deform` doesn't handle edge cases for floating point division well/correctly and a division by zero can occur.
Robert Guetzkow self-assigned this 2020-11-25 10:50:09 +01:00

This issue was referenced by c3c3807b05

This issue was referenced by c3c3807b059ddfc87a9fbc2575f4d821ddc0a248

This issue was referenced by 436fd5663e

This issue was referenced by 436fd5663e64979d59cacc12323053f860ce39b0

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'

Note: The patch didn't make it into 2.91 as today the release is being finalized.

Note: The patch didn't make it into 2.91 as today the release is being finalized.
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#82988
No description provided.