Geometry Nodes: Crashes when the curve resampling node length is 0 #111250

Open
opened 2023-08-18 05:01:45 +02:00 by SensArice · 13 comments

System Information
Operating system: macOS-13.4.1-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M2 Pro 1.2

Blender Version
Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash: c7fc78b81ecb
Worked: (newest version of Blender that worked as expected)

Short description of error
Blender crashes when the curve resampling node length is 0

blender::length_parameterize::sample_at_length(blender::Span<float>, float, int&, float&, blender::length_parameterize::SampleSegmentHint*)
blender::length_parameterize::sample_uniform(blender::Span<float>, bool, blender::MutableSpan<int>, blender::MutableSpan<float>)::$_0::operator()(blender::IndexRange) const
void blender::threading::parallel_for<blender::length_parameterize::sample_uniform(blender::Span<float>, bool, blender::MutableSpan<int>, blender::MutableSpan<float>)::$_0>(blender::IndexRange, long long, blender::length_parameterize::sample_uniform(blender::Span<float>, bool, blender::MutableSpan<int>, blender::MutableSpan<float>)::$_0 const&)
blender::length_parameterize::sample_uniform(blender::Span<float>, bool, blender::MutableSpan<int>, blender::MutableSpan<float>)
blender::geometry::resample_to_uniform(blender::bke::CurvesGeometry const&, blender::fn::Field<bool> const&, blender::fn::Field<int> const&, blender::geometry::ResampleCurvesOutputAttributeIDs const&)::$_3::operator()(blender::OffsetSpan<long long, short>) const

Exact steps for others to reproduce the error
Make sure you use a Release build.

  • Open attached .blend file
  • Set the Length value of the "Resample Curve" node to 0.0 (or connect the X output of the "Separate XYZ" node to the Length input of the "Resample Curve" node)

This is an irregular operation, but I hope it is not a crash but a warning.
There is also a possibility that if the length is close to zero, it will cause the computer to have 100% CPU.

curve_resample_.blend

**System Information** Operating system: macOS-13.4.1-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M2 Pro 1.2 **Blender Version** Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash: `c7fc78b81ecb` Worked: (newest version of Blender that worked as expected) **Short description of error** Blender crashes when the curve resampling node length is 0 ``` blender::length_parameterize::sample_at_length(blender::Span<float>, float, int&, float&, blender::length_parameterize::SampleSegmentHint*) blender::length_parameterize::sample_uniform(blender::Span<float>, bool, blender::MutableSpan<int>, blender::MutableSpan<float>)::$_0::operator()(blender::IndexRange) const void blender::threading::parallel_for<blender::length_parameterize::sample_uniform(blender::Span<float>, bool, blender::MutableSpan<int>, blender::MutableSpan<float>)::$_0>(blender::IndexRange, long long, blender::length_parameterize::sample_uniform(blender::Span<float>, bool, blender::MutableSpan<int>, blender::MutableSpan<float>)::$_0 const&) blender::length_parameterize::sample_uniform(blender::Span<float>, bool, blender::MutableSpan<int>, blender::MutableSpan<float>) blender::geometry::resample_to_uniform(blender::bke::CurvesGeometry const&, blender::fn::Field<bool> const&, blender::fn::Field<int> const&, blender::geometry::ResampleCurvesOutputAttributeIDs const&)::$_3::operator()(blender::OffsetSpan<long long, short>) const ``` <video src="/attachments/a5d43295-ddbb-4612-bb82-8932c3aa4a9f" controls></video> **Exact steps for others to reproduce the error** Make sure you use a Release build. - Open attached .blend file - Set the `Length` value of the "Resample Curve" node to `0.0` (or connect the `X` output of the "Separate XYZ" node to the `Length` input of the "Resample Curve" node) This is an irregular operation, but I hope it is not a crash but a warning. There is also a possibility that if the length is close to zero, it will cause the computer to have 100% CPU. ![curve_resample_.blend](attachments/6378e2a1-548b-4caa-926d-469299183989)
SensArice added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2023-08-18 05:01:45 +02:00
Member

Hi, thanks for the report. Unable to confirm the crash on Windows (4.0, 3.6 build)
Please share crash logs: https://docs.blender.org/manual/en/dev/troubleshooting/crash.html#macos
Also also verify the crash in recent 3.6.2/4.0 build: https://builder.blender.org/download/daily/

Hi, thanks for the report. Unable to confirm the crash on Windows (4.0, 3.6 build) Please share crash logs: https://docs.blender.org/manual/en/dev/troubleshooting/crash.html#macos Also also verify the crash in recent 3.6.2/4.0 build: https://builder.blender.org/download/daily/
Pratik Borhade added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2023-08-18 05:36:53 +02:00
Iliya Katushenock added the
Interest
Geometry Nodes
Interest
Nodes & Physics
labels 2023-08-18 12:10:00 +02:00

I see that there are places in the code where division by zero could potentially occur. But it doesn't crash for me (Windows). And not sure what to do for this kind of curves, selection mask? Seems like a performance loss....

I see that there are places in the code where division by zero could potentially occur. But it doesn't crash for me (Windows). And not sure what to do for this kind of curves, selection mask? Seems like a performance loss....
Iliya Katushenock changed title from Crashes when the curve resampling node length is 0. to Geometry Nodes: Crashes when the curve resampling node length is 0 2023-08-18 12:59:42 +02:00

I tried it too. This happened to me with version 3.6.0 as well as 3.6.2 on macOS 13.5. I have copied the crash log, see below.

I tried it too. This happened to me with version 3.6.0 as well as 3.6.2 on macOS 13.5. I have copied the crash log, see below.

Okay, thanks! I tried to read this stack and look a little in the 3.6 code, but I just don’t see the reason for the crash, the Mac OS stack is not clear to me.

Okay, thanks! I tried to read this stack and look a little in the 3.6 code, but I just don’t see the reason for the crash, the Mac OS stack is not clear to me.

Can you also check if this error reproducible in last 4.0?

Can you also check if this error reproducible in last 4.0?

In 4.0 it doesn't happen. the curve just disappears, if you put it directly in the group output.

In 4.0 it doesn't happen. the curve just disappears, if you put it directly in the group output.
Author

This is the detailed step for me to trigger the crash.
Just connect the "X" in this file to "Length"
In 4.0, it is true that there will be no crash, but there will still be no response.
I know this is a non-standard operation, and if you add a "compare" and "switch" in Group of it and package it into a group, you can solve this problem directly.
In other words, should I submit a functional request so that the "curve resample" can enter a "min length"or"max Quantity" to limit the crash or unresponsive situation

This is the detailed step for me to trigger the crash. Just connect the "X" in this file to "Length" In 4.0, it is true that there will be no crash, but there will still be no response. I know this is a non-standard operation, and if you add a "compare" and "switch" in Group of it and package it into a group, you can solve this problem directly. In other words, should I submit a functional request so that the "curve resample" can enter a "min length"or"max Quantity" to limit the crash or unresponsive situation

We shouldn't create real min-max limits, we just shouldn't handle zero value curves. And the problem of reproduction for us is that the problem of 0-division depends only on the platform ...

We shouldn't create real min-max limits, we just shouldn't handle zero value curves. And the problem of reproduction for us is that the problem of 0-division depends only on the platform ...
Author

We shouldn't create real min-max limits, we just shouldn't handle zero value curves. And the problem of reproduction for us is that the problem of 0-division depends only on the platform ...

Have you ever considered that when there are too many "curve rush sampling" vertices, the CPU will keep running instead of judging a heavy load that the computer cannot bear and then stop?
I think it is necessary to add an optional "min-length" or "max-quantity".
And added this function, this crash problem will also be solved.

> We shouldn't create real min-max limits, we just shouldn't handle zero value curves. And the problem of reproduction for us is that the problem of 0-division depends only on the platform ... Have you ever considered that when there are too many "curve rush sampling" vertices, the CPU will keep running instead of judging a heavy load that the computer cannot bear and then stop? I think it is necessary to add an optional "min-length" or "max-quantity". And added this function, this crash problem will also be solved.
Author

After testing on the Windows system, both 3.6 and 4.0 did not crash or retreat, and there was no output curve.

But when I change the input value to 0.00000000001, it still crashes.

After testing on the Windows system, both 3.6 and 4.0 did not crash or retreat, and there was no output curve. But when I change the input value to 0.00000000001, it still crashes.
Author

I restarted macbook today and tried to recreate the crash again.

I found the necessary conditions to trigger the crash:
This crash can only be triggered if there is more than one Group nesting in the Group.
The following is the crash log:
4.0Alpha:

I restarted macbook today and tried to recreate the crash again. I found the necessary conditions to trigger the crash: This crash can only be triggered if there is more than one Group nesting in the Group. The following is the crash log: 4.0Alpha:
Member

@mano-wii , can you replicate on Mac M1 (refer file attached in last message)?

@mano-wii , can you replicate on Mac M1 (refer file attached in last message)?

I can confirm the crash with:
Operating system: macOS-13.5.1-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 1.2

Interestingly, it is only replicable with a Release build (or RelWithDebInfo).

I can confirm the crash with: Operating system: macOS-13.5.1-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M1 1.2 Interestingly, it is only replicable with a Release build (or RelWithDebInfo).
Iliya Katushenock added
Priority
Normal
and removed
Priority
High
labels 2023-09-22 16:37:35 +02:00
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
5 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#111250
No description provided.