Segmentation fault while texture painting #99015

Closed
opened 2022-06-20 15:04:05 +02:00 by Péter Friedrich · 20 comments

System Information
Operating system: Linux-5.15.0-37-lowlatency-x86_64-with-glibc2.35 64 Bits
Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.129.06

Blender Version
Broken: version: 3.2.0, branch: master, commit date: 2022-06-08 10:22, hash: e05e1e3691
Worked: -

Short description of error
Attempting to texture paint on certain models results in segementation fault.

Exact steps for others to reproduce the error
Open the attached blend file, start painting on forearm_drone_kit.L (texture to paint on: DroneController, 2K)
os_info.txt

blender_3_2_0_segfault_while_painting.blend
blender_3_2_0_segfault_while_painting.crash.txt

**System Information** Operating system: Linux-5.15.0-37-lowlatency-x86_64-with-glibc2.35 64 Bits Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.129.06 **Blender Version** Broken: version: 3.2.0, branch: master, commit date: 2022-06-08 10:22, hash: `e05e1e3691` Worked: - **Short description of error** Attempting to texture paint on certain models results in segementation fault. **Exact steps for others to reproduce the error** Open the attached blend file, start painting on forearm_drone_kit.L (texture to paint on: DroneController, 2K) [os_info.txt](https://archive.blender.org/developer/F13207266/os_info.txt) [blender_3_2_0_segfault_while_painting.blend](https://archive.blender.org/developer/F13207267/blender_3_2_0_segfault_while_painting.blend) [blender_3_2_0_segfault_while_painting.crash.txt](https://archive.blender.org/developer/F13207268/blender_3_2_0_segfault_while_painting.crash.txt)

Added subscriber: @peterf-2

Added subscriber: @peterf-2

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

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

Forget to mention in the original post: painting in the 3D view causes the crash, painting in the 2D image view still works.

Forget to mention in the original post: painting in the 3D view causes the crash, painting in the 2D image view still works.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'
Member

getting crashes in 3.1, 3.0.1, 2.93 as well

The mesh seems corrupt, the following returns True

C.active_object.data.validate_material_indices()

After that, painting succeeds.
@peterf-2 : got an idea how this thing got corrupted?

Thanks for the report. Unfortunately unless there are clear instructions on how to reproduce it from scratch we cannot debug this any further.
Things that may cause mesh corruption: Importers, development versions of Blender, modeling tools.

getting crashes in 3.1, 3.0.1, 2.93 as well The mesh seems corrupt, the following returns True ``` C.active_object.data.validate_material_indices() ``` After that, painting succeeds. @peterf-2 : got an idea how this thing got corrupted? > Thanks for the report. Unfortunately unless there are clear instructions on how to reproduce it from scratch we cannot debug this any further. > Things that may cause mesh corruption: Importers, development versions of Blender, modeling tools.

@lichtwerk: After C.active_object.data.validate_material_indices() it works on my side as well. Also can confirm that the error is present in older versions, while painting on the default cube works as expected.
No idea what went wrong, I did some fairly ugly booleans, though. If I read the help for validate_material_indices correctly, the issue was that individual polys got different material indices. What kind of operations could cause this? My workflow was this:

  1. Basic polly modelling
  2. Assign bevel weights to edges, add bevel modifier and weighted normals, enable autosmooth
  3. Do booleans
  4. Apply booleans, cleanup, adjust bevels
  5. Assign material with UV grid
  6. Unwrap, adjust
  7. Assign new material with target texture (all textures are packed to the blend file)
  8. Paint

Could any of these lead to this interesting error?
(I will continue working on the project to see if Ithe issue pops up again)
Thanks for the quick help!

@lichtwerk: After C.active_object.data.validate_material_indices() it works on my side as well. Also can confirm that the error is present in older versions, while painting on the default cube works as expected. No idea what went wrong, I did some fairly ugly booleans, though. If I read the help for validate_material_indices correctly, the issue was that individual polys got different material indices. What kind of operations could cause this? My workflow was this: 1) Basic polly modelling 2) Assign bevel weights to edges, add bevel modifier and weighted normals, enable autosmooth 3) Do booleans 4) Apply booleans, cleanup, adjust bevels 5) Assign material with UV grid 6) Unwrap, adjust 7) Assign new material with target texture (all textures are packed to the blend file) 8) Paint Could any of these lead to this interesting error? (I will continue working on the project to see if Ithe issue pops up again) Thanks for the quick help!
Member

I would suspect the booleans (of different objects with different materials) to somewhat leave invalid indices, not sure though.
Maybe you could run some tests if these lead to the buggy behavior?

I would suspect the booleans (of different objects with different materials) to somewhat leave invalid indices, not sure though. Maybe you could run some tests if these lead to the buggy behavior?

Any particular tests in mind? Or shall I just go nuts with the booleans?

Any particular tests in mind? Or shall I just go nuts with the booleans?

Added subscriber: @jack.herbert

Added subscriber: @jack.herbert

I got that bug with a model made using boolean operations, also on Linux with an Nvidia card, and running the validate_material_indices line returns True and fixed it.

I got that bug with a model made using boolean operations, also on Linux with an Nvidia card, and running the validate_material_indices line returns True and fixed it.
Member

Do you have an example file prior to applying the booleans that then crashes once the booleans are applied?

Do you have an example file prior to applying the booleans that then crashes once the booleans are applied?

Sadly no, I have a save from shortly after applying the modifier, don't know if that's any use but here it is:
texture-paint-crash.blend
Some observations:

  • When in edit mode, pressing Select in the material tab shows that a bunch of faces don't have any material assigned to them. They're in the "zone" of the boolean difference. Assigning them to the material also fixes the texture-paint crash.
  • I had a mirror modifier and it likely was in first position in the stack when I applied the boolean modifier.
  • The boolean cutting object (the cylinder) didn't have any material assigned to it.
  • When trying to do the same thing again (subtracting the cylinder from the main object), the new faces are correctly assigned to Material. So dunno how it happened the first time around.
Sadly no, I have a save from shortly after applying the modifier, don't know if that's any use but here it is: [texture-paint-crash.blend](https://archive.blender.org/developer/F13228945/texture-paint-crash.blend) Some observations: - When in edit mode, pressing Select in the material tab shows that a bunch of faces don't have any material assigned to them. They're in the "zone" of the boolean difference. Assigning them to the material also fixes the texture-paint crash. - I had a mirror modifier and it likely was in first position in the stack when I applied the boolean modifier. - The boolean cutting object (the cylinder) didn't have any material assigned to it. - When trying to do the same thing again (subtracting the cylinder from the main object), the new faces are correctly assigned to Material. So dunno how it happened the first time around.
Member

Added subscriber: @JosephEagar

Added subscriber: @JosephEagar
Member

I can add a check in the paint code for invalid material slots. That said, we really should track down the booleans bug; I think I ran into it a few weeks ago.

I can add a check in the paint code for invalid material slots. That said, we really should track down the booleans bug; I think I ran into it a few weeks ago.
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Since we do not have an example with the boolean modifier still active (not applied) and also since there have been related fixes (see a2d59b2dac & 1a6d0ec71c) I would assume the current situation has improved in 3.2.2 onwards (in that we hopefully dont run into this situation again).

That does not mean the original file is fixed, for that validate_material_indices is still necessary to fix the corruption.

I'll put this on hold for now, please use newer blender builds/versions and report back if you run into this situation again.

Since we do not have an example with the boolean modifier still active (not applied) and also since there have been related fixes (see a2d59b2dac & 1a6d0ec71c) I would assume the current situation has improved in 3.2.2 onwards (in that we hopefully dont run into this situation again). That does not mean the original file is fixed, for that `validate_material_indices` is still necessary to fix the corruption. I'll put this on hold for now, please use newer blender builds/versions and report back if you run into this situation again.
Member

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
Member

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.

Thanks again for the report. If the problem persists please open a new report with the required information.

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed. Thanks again for the report. If the problem persists please open a new report with the required information.
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#99015
No description provided.