Crash during texture baking - Bad copy ctor for DynamicArray inside makesrna.c #77009

Closed
opened 2020-05-23 23:43:21 +02:00 by Jesse Yurkovich · 9 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: Quadro 600/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 369.09

Blender Version
Broken: version: 2.90 (sub 3), branch: master, commit date: 2020-05-22 20:59, hash: 86fa8dc7f7
Broken: version: 2.83 has the same code as well...
Worked: n/a

Short description of error
The copy ctor for DynamicArray has a bug which attempts to free uninitialized memory. This was caught when attempting to bake a simple normal map on 2 objects using a Debug build.

Exact steps for others to reproduce the error

  • Open attached .blend
  • Hit Bake

bake-bug.blend

data is 0xcccccccccccccccc

blender.exe!BL::DynamicArray<float>::copy_from(const BL::DynamicArray<float> & other) Line 228	C++
blender.exe!BL::DynamicArray<float>::DynamicArray<float>(const BL::DynamicArray<float> & other) Line 219	C++
blender.exe!BL::RenderPass::rect() Line 54362	C++
blender.exe!ccl::BlenderSession::do_write_update_render_tile(ccl::RenderTile & rtile, bool do_update_only, bool do_read_only, bool highlight) Line 355	C++
blender.exe!ccl::BlenderSession::read_render_tile(ccl::RenderTile & rtile) Line 383	C++
[External Code]	
blender.exe!ccl::Session::acquire_tile(ccl::RenderTile & rtile, ccl::Device * tile_device, unsigned int tile_types) Line 467	C++
[External Code]	
blender.exe!ccl::CPUDevice::thread_render(ccl::DeviceTask & task) Line 1026	C++
blender.exe!ccl::CPUDevice::thread_run(ccl::DeviceTask * task) Line 533	C++

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: Quadro 600/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 369.09 **Blender Version** Broken: version: 2.90 (sub 3), branch: master, commit date: 2020-05-22 20:59, hash: `86fa8dc7f7` Broken: version: 2.83 has the same code as well... Worked: n/a **Short description of error** The copy ctor for DynamicArray has a bug which attempts to free uninitialized memory. This was caught when attempting to bake a simple normal map on 2 objects using a Debug build. **Exact steps for others to reproduce the error** - Open attached .blend - Hit Bake [bake-bug.blend](https://archive.blender.org/developer/F8549871/bake-bug.blend) ``` data is 0xcccccccccccccccc blender.exe!BL::DynamicArray<float>::copy_from(const BL::DynamicArray<float> & other) Line 228 C++ blender.exe!BL::DynamicArray<float>::DynamicArray<float>(const BL::DynamicArray<float> & other) Line 219 C++ blender.exe!BL::RenderPass::rect() Line 54362 C++ blender.exe!ccl::BlenderSession::do_write_update_render_tile(ccl::RenderTile & rtile, bool do_update_only, bool do_read_only, bool highlight) Line 355 C++ blender.exe!ccl::BlenderSession::read_render_tile(ccl::RenderTile & rtile) Line 383 C++ [External Code] blender.exe!ccl::Session::acquire_tile(ccl::RenderTile & rtile, ccl::Device * tile_device, unsigned int tile_types) Line 467 C++ [External Code] blender.exe!ccl::CPUDevice::thread_render(ccl::DeviceTask & task) Line 1026 C++ blender.exe!ccl::CPUDevice::thread_run(ccl::DeviceTask * task) Line 533 C++ ```
Author
Member

Added subscriber: @deadpin

Added subscriber: @deadpin

Added subscriber: @iss

Added subscriber: @iss

Can not reproduce on version: 2.90 (sub 3), branch: master, commit date: 2020-05-24 19:14, hash: f13b687551

Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: Radeon RX550/550 Series ATI Technologies Inc. 4.5.13587 Core Profile Context 20.4.1 26.20.15029.20013

Can not reproduce on version: 2.90 (sub 3), branch: master, commit date: 2020-05-24 19:14, hash: `f13b687551` Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: Radeon RX550/550 Series ATI Technologies Inc. 4.5.13587 Core Profile Context 20.4.1 26.20.15029.20013
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

For uninitialized ram to be 0xcccccccccccccccc with MSVC you have to be using a debug build, otherwise it may just randomly have the lucky value of 0 and not trigger the bug.

i can repro with current master on windows, on linux asan ought to catch it.

For uninitialized ram to be 0xcccccccccccccccc with MSVC you have to be using a debug build, otherwise it may just randomly have the lucky value of 0 and not trigger the bug. i can repro with current master on windows, on linux asan ought to catch it.

This issue was referenced by 31cb4133b9

This issue was referenced by 31cb4133b9ca82f73b6fb52674c030ca56776d1f

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

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

In #77009#938330, @LazyDodo wrote:
For uninitialized ram to be 0xcccccccccccccccc with MSVC you have to be using a debug build, otherwise it may just randomly have the lucky value of 0 and not trigger the bug.

i can repro with current master on windows, on linux asan ought to catch it.

Thanks, I didn't know this though I guess I should, otherwise I am guessing...

Will confirm then.

> In #77009#938330, @LazyDodo wrote: > For uninitialized ram to be 0xcccccccccccccccc with MSVC you have to be using a debug build, otherwise it may just randomly have the lucky value of 0 and not trigger the bug. > > i can repro with current master on windows, on linux asan ought to catch it. Thanks, I didn't know this though I guess I should, otherwise I am guessing... Will confirm then.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Brecht Van Lommel self-assigned this 2020-05-25 18:18:03 +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#77009
No description provided.