Geometry Node: Memory leak -> EXCEPTION_ACCESS_VIOLATION -> EXCEPTION_INT_DIVIDE_BY_ZERO. #102238

Closed
opened 2022-11-02 19:39:01 +01:00 by Daniel Hickox · 12 comments

System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.15

Blender Version
Broken: version: 3.4.0 Alpha, branch: master, commit date: 2022-10-03 00:19, hash: d4d40f3b69

Short description of error

acf083a5bf and previous 0a85288462 0348bc88e4 and next
Error: Not freed memory blocks: 2, total unfreed memory 0.000015 MB Error : EXCEPTION_ACCESS_VIOLATION Error : EXCEPTION_INT_DIVIDE_BY_ZERO
2022-11-02 22-03-34.mp4 xgbntg.blend bug 133.blend
Error: Not freed memory blocks: 2, total unfreed memory 0.000015 MB Error: Not freed memory blocks: 4294967293, total unfreed memory 0.000000 MB Error : EXCEPTION_ACCESS_VIOLATION / EXCEPTION_INT_DIVIDE_BY_ZERO or Error: Not freed memory blocks: 4294967291, total unfreed memory 17592180772377.822266 MB

In recent versions, it all depends on whether the attempt to free memory will be in the available area (overflowed int megabytes freed?) or in the system area (deny access) or division by 0 (size of freed memory)

Message in the console after crashing

1:
Error: Not freed memory blocks: 2, total unfreed memory 0.000015 MB

2:
Error: Not freed memory blocks: 4294967293, total unfreed memory 0.000000 MB

3:
Error : EXCEPTION_ACCESS_VIOLATION

User message:
Error : EXCEPTION_INT_DIVIDE_BY_ZERO

Exact steps for others to reproduce the error
In the attached .blend

  • change the value in the value node a couple of times.
    bug.blend

On the default cube

  • Add a geometry node modifier and create a new group.
  • Add a delete geometry node between the input and output.
  • Connect the delete node's selection input to an input socket.
  • Add a value node and connect it to an output socket.
  • In the modifier panel, assign a name to the output attribute.
  • Change the value node's value a couple of times and it will crash.

crash_example.mkv

**System Information** Operating system: Windows-10-10.0.19043-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.15 **Blender Version** Broken: version: 3.4.0 Alpha, branch: master, commit date: 2022-10-03 00:19, hash: `d4d40f3b69` **Short description of error** | acf083a5bf and previous | 0a85288462 | 0348bc88e4 and next | | -- | -- | -- | | Error: Not freed memory blocks: 2, total unfreed memory 0.000015 MB | Error : EXCEPTION_ACCESS_VIOLATION | Error : EXCEPTION_INT_DIVIDE_BY_ZERO | | [2022-11-02 22-03-34.mp4](https://archive.blender.org/developer/F13843937/2022-11-02_22-03-34.mp4) | [xgbntg.blend](https://archive.blender.org/developer/F13843976/xgbntg.blend) | [bug 133.blend](https://archive.blender.org/developer/F13843979/bug_133.blend) | | Error: Not freed memory blocks: 2, total unfreed memory 0.000015 MB | Error: Not freed memory blocks: 4294967293, total unfreed memory 0.000000 MB | Error : EXCEPTION_ACCESS_VIOLATION / EXCEPTION_INT_DIVIDE_BY_ZERO or Error: Not freed memory blocks: 4294967291, total unfreed memory 17592180772377.822266 MB | In recent versions, it all depends on whether the attempt to free memory will be in the available area (overflowed int megabytes freed?) or in the system area (deny access) or division by 0 (size of freed memory) **Message in the console after crashing** 1: Error: Not freed memory blocks: 2, total unfreed memory 0.000015 MB 2: Error: Not freed memory blocks: 4294967293, total unfreed memory 0.000000 MB 3: Error : EXCEPTION_ACCESS_VIOLATION User message: Error : EXCEPTION_INT_DIVIDE_BY_ZERO **Exact steps for others to reproduce the error** **In the attached .blend** - change the value in the value node a couple of times. [bug.blend](https://archive.blender.org/developer/F13843621/bug.blend) **On the default cube** - Add a geometry node modifier and create a new group. - Add a delete geometry node between the input and output. - Connect the delete node's selection input to an input socket. - Add a value node and connect it to an output socket. - In the modifier panel, assign a name to the output attribute. - Change the value node's value a couple of times and it will crash. [crash_example.mkv](https://archive.blender.org/developer/F13843618/crash_example.mkv)
Author

Added subscriber: @DanielJH

Added subscriber: @DanielJH

Added subscriber: @mod_moder

Added subscriber: @mod_moder

Thanks for the report. I can confirm. But the problem is, based on my investigation, I need to edit your report a bit. This will be information about how this bug changed.

Thanks for the report. I can confirm. But the problem is, based on my investigation, I need to edit your report a bit. This will be information about how this bug changed.
Author

Thanks, feel free to edit in more info/corrections, that was just my best guess based on how I was able to reproduce it.

Thanks, feel free to edit in more info/corrections, that was just my best guess based on how I was able to reproduce it.
Iliya Katushenock changed title from Div by zero crash on geometry nodetrees that produce empty geometry with output attributes. to Geometry Node: Memory leak -> EXCEPTION_ACCESS_VIOLATION -> EXCEPTION_INT_DIVIDE_BY_ZERO. 2022-11-02 20:15:20 +01:00

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

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

Added subscribers: @HooglyBoogly, @JacquesLucke

Added subscribers: @HooglyBoogly, @JacquesLucke
Member

@HooglyBoogly Currently it is not very well defined whether customData_add_layer__internal takes ownership of the layerdata or not. Especially when totelem == 0 it's tricky, because the function just frees the pointer which is not possible to detect from the outside. Do you have an idea for how the situation could be improved? We could pass in void **layerdata, then the caller could check whether that has been set to null, indicating that the function took ownership.

@HooglyBoogly Currently it is not very well defined whether `customData_add_layer__internal` takes ownership of the `layerdata` or not. Especially when `totelem == 0` it's tricky, because the function just frees the pointer which is not possible to detect from the outside. Do you have an idea for how the situation could be improved? We could pass in `void **layerdata`, then the caller could check whether that has been set to null, indicating that the function took ownership.
Member

Currently it is not very well defined whether customData_add_layer__internal takes ownership of the layerdata or not

Hmm, I'm not sure I agree. With CD_ASSIGN, the function takes ownership of the array. For all other modes, no ownership is transferred.
I think that's relatively straightforward, but I didn't look into this bug specifically yet so I don't know the full problem.

>Currently it is not very well defined whether customData_add_layer__internal takes ownership of the layerdata or not Hmm, I'm not sure I agree. With `CD_ASSIGN`, the function takes ownership of the array. For all other modes, no ownership is transferred. I think that's relatively straightforward, but I didn't look into this bug specifically yet so I don't know the full problem.
Member

Not quite true, the function has an early return. If the function always takes ownership then the MEM_freeN in the MoveArray case in add_builtin_type_custom_data_layer_from_init does not make sense.

Not quite true, the function has an early return. If the function always takes ownership then the `MEM_freeN` in the `MoveArray` case in `add_builtin_type_custom_data_layer_from_init` does not make sense.
Member

Okay, I see. Anyway, that's the design we should move to I think.

Okay, I see. Anyway, that's the design we should move to I think.

This issue was referenced by e031a45d60

This issue was referenced by e031a45d6026d2fce23fca2b1001e783d2642031
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jacques Lucke self-assigned this 2022-11-07 11:42:43 +01: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#102238
No description provided.