ASAN: Trying to Undo a knife-project operation causes heap-use-after-free failure #90493

Closed
opened 2021-08-07 07:34:45 +02:00 by Jesse Yurkovich · 16 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1070 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 462.75

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-08-07 00:18, hash: b33b70ed07
Worked: (newest version of Blender that worked as expected)

Short description of error
Attempting to undo a knife-project operation between 2 different objects seems to run into a use-after-free error.

Exact steps for others to reproduce the error
knife-project-undo.blend

  • Load attached file
    • Contains a plane above the default cube. The plane is being projected onto the cube from the Top view
  • Run Mesh->Knife Project
  • Undo
BMEditMesh *em = (ob->mode & OB_MODE_EDIT) ? ((Mesh *)ob->data)->edit_mesh : NULL;

==4156==ERROR: AddressSanitizer: heap-use-after-free on address 0x1211013509d0 at pc 0x7ff7d4e7ba62 bp 0x0077c9a6bb10 sp 0x0077c9a6bb10
READ of size 8 at 0x1211013509d0 thread T31
    - 0 0x7ff7d4e7ba61 in BKE_object_handle_data_update C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\object_update.c:174
    - 1 0x7ff7d4e7a073 in BKE_object_eval_uber_data C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\object_update.c:395
...

0x1211013509d0 is located 336 bytes inside of 1816-byte region [0x121101350880,0x121101350f98)
freed by thread T0 here:
    - 0 0x7fff2b09d041  (C:\Users\jesse\source\blender-git\build_windows_Full_x64_vc16_Release\bin\Debug\clang_rt.asan_dbg_dynamic-x86_64.dll+0x18004d041)
    - 1 0x7ff7e33554b9 in MEM_lockfree_freeN C:\Users\jesse\source\blender-git\blender\intern\guardedalloc\intern\mallocn_lockfree_impl.c:130
    - 2 0x7ff7d49aa317 in BKE_id_free_ex C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\lib_id_delete.c:193
    - 3 0x7ff7d49aa35e in BKE_id_free C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\lib_id_delete.c:208
    #4 0x7ff7d4a828da in BKE_mesh_eval_geometry C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\mesh.c:2245


Full asan report:
asan-report.txt

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1070 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 462.75 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-08-07 00:18, hash: `b33b70ed07` Worked: (newest version of Blender that worked as expected) **Short description of error** Attempting to undo a knife-project operation between 2 different objects seems to run into a use-after-free error. **Exact steps for others to reproduce the error** [knife-project-undo.blend](https://archive.blender.org/developer/F10273121/knife-project-undo.blend) - Load attached file - Contains a plane above the default cube. The plane is being projected onto the cube from the Top view - Run Mesh->Knife Project - Undo ``` BMEditMesh *em = (ob->mode & OB_MODE_EDIT) ? ((Mesh *)ob->data)->edit_mesh : NULL; ==4156==ERROR: AddressSanitizer: heap-use-after-free on address 0x1211013509d0 at pc 0x7ff7d4e7ba62 bp 0x0077c9a6bb10 sp 0x0077c9a6bb10 READ of size 8 at 0x1211013509d0 thread T31 - 0 0x7ff7d4e7ba61 in BKE_object_handle_data_update C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\object_update.c:174 - 1 0x7ff7d4e7a073 in BKE_object_eval_uber_data C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\object_update.c:395 ... 0x1211013509d0 is located 336 bytes inside of 1816-byte region [0x121101350880,0x121101350f98) freed by thread T0 here: - 0 0x7fff2b09d041 (C:\Users\jesse\source\blender-git\build_windows_Full_x64_vc16_Release\bin\Debug\clang_rt.asan_dbg_dynamic-x86_64.dll+0x18004d041) - 1 0x7ff7e33554b9 in MEM_lockfree_freeN C:\Users\jesse\source\blender-git\blender\intern\guardedalloc\intern\mallocn_lockfree_impl.c:130 - 2 0x7ff7d49aa317 in BKE_id_free_ex C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\lib_id_delete.c:193 - 3 0x7ff7d49aa35e in BKE_id_free C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\lib_id_delete.c:208 #4 0x7ff7d4a828da in BKE_mesh_eval_geometry C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\mesh.c:2245 ``` Full asan report: [asan-report.txt](https://archive.blender.org/developer/F10273123/asan-report.txt)
Author
Member

Added subscriber: @deadpin

Added subscriber: @deadpin
willneel commented 2021-08-07 08:44:53 +02:00 (Migrated from localhost:3001)

Added subscriber: @willneel

Added subscriber: @willneel
willneel commented 2021-08-07 08:44:53 +02:00 (Migrated from localhost:3001)

This comment was removed by @willneel

*This comment was removed by @willneel*
willneel commented 2021-08-07 09:48:58 +02:00 (Migrated from localhost:3001)

This comment was removed by @willneel

*This comment was removed by @willneel*
willneel commented 2021-08-07 10:32:25 +02:00 (Migrated from localhost:3001)

This comment was removed by @willneel

*This comment was removed by @willneel*
willneel commented 2021-08-07 11:00:17 +02:00 (Migrated from localhost:3001)

This comment was removed by @willneel

*This comment was removed by @willneel*
willneel commented 2021-08-07 11:01:33 +02:00 (Migrated from localhost:3001)

This comment was removed by @willneel

*This comment was removed by @willneel*
willneel commented 2021-08-07 13:47:12 +02:00 (Migrated from localhost:3001)

This comment was removed by @willneel

*This comment was removed by @willneel*

Added subscriber: @ideasman42

Added subscriber: @ideasman42

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

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

Added subscriber: @mano-wii

Added subscriber: @mano-wii

This comment was removed by @mano-wii

*This comment was removed by @mano-wii*

This issue was referenced by 7b1e8e244c

This issue was referenced by 7b1e8e244c76400426e27dcc586683f81763955a

This issue was referenced by bbfb29c794

This issue was referenced by bbfb29c7941af8dbb5f3036752fc1f2f0d2b687b

This issue was referenced by 4ca19c7153

This issue was referenced by 4ca19c715314b4db12af8963750ab1a0e9fdbf1d

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Campbell Barton self-assigned this 2021-08-10 06:45:45 +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
4 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#90493
No description provided.