Segfault with gdb debugger in PointsToVolume node #110052

Open
opened 2023-07-13 12:13:22 +02:00 by Lukas Tönne · 2 comments
Member

System Information
Operating system: Linux-6.4.3-gentoo-x86_64-AMD_Ryzen_9_7950X_16-Core_Processor-with-glibc2.37 64 Bits, WAYLAND UI
Graphics card: AMD Radeon RX 7900 XT (gfx1100, LLVM 15.0.7, DRM 3.52, 6.4.3-gentoo) AMD 4.6 (Core Profile) Mesa 23.1.3

Blender Version
Broken: version: 4.0.0 Alpha, branch: Unknown, commit date: Unknown Unknown, hash: Unknown
Worked: (newest version of Blender that worked as expected)

Short description of error
GCC builds with a gdb debugger attached crash in the Points-to-Volume node.
This does not happen if no debugger is attached, or when using msbuild.

Exact steps for others to reproduce the error
Use a GCC Debug build, run Blender with a GDB debugger attached.
Create a point cloud and convert it to a volume.
Screenshot_20230713_120620

OpenVDB will throw a lot of warnings about missing RTTI on the ParticlesToLevelSet::Raster class.

RTTI symbol not found for class 'tbb::interface9::internal::finish_reduce<openvdb::v10_0::tools::ParticlesToLevelSet<openvdb::v10_0::Grid<openvdb::v10_0::tree::Tree<openvdb::v10_0::tree::RootNode<openvdb::v10_0::tree::InternalNode<openvdb::v10_0::tree::InternalNode<openvdb::v10_0::tree::LeafNode<float, 3u>, 4u>, 5u> > > >, void, openvdb::v10_0::util::NullInterrupter>::Raster<blender::geometry::OpenVDBParticleList, openvdb::v10_0::Grid<openvdb::v10_0::tree::Tree<openvdb::v10_0::tree::RootNode<openvdb::v10_0::tree::InternalNode<openvdb::v10_0::tree::InternalNode<openvdb::v10_0::tree::LeafNode<float, 3u>, 4u>, 5u> > > > > >'

This appears to be a long-standing gcc bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81932
The nested Raster class is virtual due to its destructor, which seems to be the condition triggering this problem.

EDIT: The same problem occurs with the Volume Cube node, the gdb warning might be a red herring. Removing the virtual keyword from the Raster class also silences the warning, not sure if this class really must be virtual at all.

The effect is that debugging any file containing a Points-to-Volume node with gdb becomes impossible. I'm not sure if there is anything we can do on the Blender side to work around the problem.

**System Information** Operating system: Linux-6.4.3-gentoo-x86_64-AMD_Ryzen_9_7950X_16-Core_Processor-with-glibc2.37 64 Bits, WAYLAND UI Graphics card: AMD Radeon RX 7900 XT (gfx1100, LLVM 15.0.7, DRM 3.52, 6.4.3-gentoo) AMD 4.6 (Core Profile) Mesa 23.1.3 **Blender Version** Broken: version: 4.0.0 Alpha, branch: Unknown, commit date: Unknown Unknown, hash: `Unknown` Worked: (newest version of Blender that worked as expected) **Short description of error** GCC builds with a gdb debugger attached crash in the Points-to-Volume node. This does not happen if no debugger is attached, or when using msbuild. **Exact steps for others to reproduce the error** Use a GCC Debug build, run Blender with a GDB debugger attached. Create a point cloud and convert it to a volume. ![Screenshot_20230713_120620](/attachments/7d506aed-a828-4785-b99a-409e7a43dbe7) OpenVDB will throw a lot of warnings about missing RTTI on the [`ParticlesToLevelSet::Raster`](https://github.com/AcademySoftwareFoundation/openvdb/blob/f81d1aa2843290feac438a7ec0feeccced952cec/openvdb/openvdb/tools/ParticlesToLevelSet.h#L468) class. ``` RTTI symbol not found for class 'tbb::interface9::internal::finish_reduce<openvdb::v10_0::tools::ParticlesToLevelSet<openvdb::v10_0::Grid<openvdb::v10_0::tree::Tree<openvdb::v10_0::tree::RootNode<openvdb::v10_0::tree::InternalNode<openvdb::v10_0::tree::InternalNode<openvdb::v10_0::tree::LeafNode<float, 3u>, 4u>, 5u> > > >, void, openvdb::v10_0::util::NullInterrupter>::Raster<blender::geometry::OpenVDBParticleList, openvdb::v10_0::Grid<openvdb::v10_0::tree::Tree<openvdb::v10_0::tree::RootNode<openvdb::v10_0::tree::InternalNode<openvdb::v10_0::tree::InternalNode<openvdb::v10_0::tree::LeafNode<float, 3u>, 4u>, 5u> > > > > >' ``` ~~This appears to be a long-standing gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81932 The nested `Raster` class is virtual due to its destructor, which seems to be the condition triggering this problem.~~ EDIT: The same problem occurs with the _Volume Cube_ node, the gdb warning might be a red herring. Removing the `virtual` keyword from the `Raster` class also silences the warning, not sure if this class really must be virtual at all. The effect is that debugging any file containing a Points-to-Volume node with gdb becomes impossible. I'm not sure if there is anything we can do on the Blender side to work around the problem.
Lukas Tönne added the
Type
Report
Status
Needs Triage
Priority
Normal
labels 2023-07-13 12:13:22 +02:00
Lukas Tönne added this to the Nodes & Physics project 2023-07-13 12:13:30 +02:00
Author
Member

LLDB (with a clang build) also crashes, so it may not be a compiler-specific issue. I'm using prebuilt libs here though, not sure how those are built and whether that has any effect.

LLDB (with a clang build) also crashes, so it may not be a compiler-specific issue. I'm using prebuilt libs here though, not sure how those are built and whether that has any effect.
Author
Member

A workaround for running OpenVDB under a GDB debugger is to preload the dynamic OpenVDB libraries and its dependencies (absolute paths for my system, adjust as needed):

LD_PRELOAD="/home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/boost/lib/libboost_regex.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/boost/lib/libboost_iostreams.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/tbb/lib/libtbb.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/openvdb/lib/libopenvdb.so" gdb bin/blender

suggested here: https://gitlab.kitware.com/vtk/vtk/-/issues/18413#note_1263187

EDIT: This also allows using OpenVDB builds with ASAN, by adding the libasan.so runtime library as the first argument:
LD_PRELOAD="/usr/lib/gcc/x86_64-pc-linux-gnu/12/libasan.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/boost/lib/libboost_regex.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/boost/lib/libboost_iostreams.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/tbb/lib/libtbb.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/openvdb/lib/libopenvdb.so" gdb bin/blender

⚠️ ASAN builds can become very large and gcc is known to have relocation overflow problems. Disabling parts like Cycles, USD, libmv can help reduce the build size to a point where Debug mode + OpenVDB + ASAN can be enabled.

This can also be added in QtCreator as an environment variable:
Screenshot_20230828_155045

A workaround for running OpenVDB under a GDB debugger is to preload the dynamic OpenVDB libraries and its dependencies (absolute paths for my system, adjust as needed): `LD_PRELOAD="/home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/boost/lib/libboost_regex.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/boost/lib/libboost_iostreams.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/tbb/lib/libtbb.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/openvdb/lib/libopenvdb.so" gdb bin/blender` suggested here: https://gitlab.kitware.com/vtk/vtk/-/issues/18413#note_1263187 EDIT: This also allows using OpenVDB builds with ASAN, by adding the `libasan.so` runtime library as the first argument: `LD_PRELOAD="/usr/lib/gcc/x86_64-pc-linux-gnu/12/libasan.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/boost/lib/libboost_regex.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/boost/lib/libboost_iostreams.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/tbb/lib/libtbb.so /home/lukas/src/blender-git/lib/linux_x86_64_glibc_228/openvdb/lib/libopenvdb.so" gdb bin/blender` ⚠️ ASAN builds can become very large and gcc is known to have _relocation overflow_ problems. Disabling parts like Cycles, USD, libmv can help reduce the build size to a point where Debug mode + OpenVDB + ASAN can be enabled. This can also be added in QtCreator as an environment variable: ![Screenshot_20230828_155045](/attachments/fbf7662d-84e3-4089-85c0-2f8d32440e21)
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 Assignees
1 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#110052
No description provided.