Blender crashes in texture paint window when trying to paint after going back from edit mode #56850
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#56850
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Windows 10 64 bit
Intel Core i5-7600
Nvidia GeForce GTX 1060 6GB
Blender Version
Broken: 2.8
69aac13524
Worked: N/A
Short description of error
In texture paint window when going into edit mode and back to paint mode it crashes when trying to paint onto the object
Exact steps for others to reproduce the error
Added subscriber: @shadercode
Blender crashes in texture paint window when trying to paint after zooming in and out in edit modeto Blender crashes in texture paint window when trying to paint after going back from edit modeAdded subscriber: @mont29
Please follow our submission template and guidelines, also read these tips about bug reports, and make a complete, valid bug report, with required info, precise description of the issue (only ONE issue per report!), precise steps to reproduce it, small and simple .blend and/or other files to do so if needed, etc.
Added subscriber: @CodeSlinger19
I was about to log this crash myself. How is it incomplete? It has everything the guidelines ask for especially very straight forward repro steps. If you're wanting a .blend file, there's no point, as you can reproduce simply from the startup scene with only the few steps described, you don't event need to remove the objects from the starting scene, and you can just use the default cube.
Here's the blender.crash.txt:
Blender 2.80 (sub 24), Commit date: 2018-09-27 11:19, Hash
250a377592
Tool 'Cursor' not found. # Warning
Tool 'Cursor' not found. # Warning
bpy.ops.paint.texture_paint_toggle() # Operator
bpy.ops.paint.texture_paint_toggle() # Operator
bpy.ops.object.editmode_toggle() # Operator
bpy.ops.object.editmode_toggle() # Operator
bpy.ops.paint.texture_paint_toggle() # Operator
bpy.ops.paint.texture_paint_toggle() # Operator
bpy.ops.object.editmode_toggle() # Operator
bpy.ops.object.editmode_toggle() # Operator
bpy.ops.paint.texture_paint_toggle() # Operator
backtrace
/isodevice/software/blender-git/build_linux/bin/blender(BLI_system_backtrace+0x3e) [0x557eec5e3efe]
/isodevice/software/blender-git/build_linux/bin/blender(+0xac4889) [0x557eebb39889]
/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f6de4fa9f20]
/isodevice/software/blender-git/build_linux/bin/blender(+0xe21877) [0x557eebe96877]
/isodevice/software/blender-git/build_linux/bin/blender(paint_proj_new_stroke+0x283) [0x557eebe9fdf3]
/isodevice/software/blender-git/build_linux/bin/blender(+0xe16b1c) [0x557eebe8bb1c]
/isodevice/software/blender-git/build_linux/bin/blender(paint_stroke_modal+0x1de) [0x557eebea935e]
/isodevice/software/blender-git/build_linux/bin/blender(+0xe16c89) [0x557eebe8bc89]
/isodevice/software/blender-git/build_linux/bin/blender(+0xac9e96) [0x557eebb3ee96]
/isodevice/software/blender-git/build_linux/bin/blender(+0xaccc15) [0x557eebb41c15]
/isodevice/software/blender-git/build_linux/bin/blender(+0xacd1f5) [0x557eebb421f5]
/isodevice/software/blender-git/build_linux/bin/blender(+0xacdb45) [0x557eebb42b45]
/isodevice/software/blender-git/build_linux/bin/blender(wm_event_do_handlers+0x50c) [0x557eebb433ec]
/isodevice/software/blender-git/build_linux/bin/blender(WM_main+0x30) [0x557eebb3a3d0]
/isodevice/software/blender-git/build_linux/bin/blender(main+0x345) [0x557eebb1f4f5]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f6de4f8cb97]
/isodevice/software/blender-git/build_linux/bin/blender(_start+0x2a) [0x557eebb35dfa]
I tried to do some debugging and this is as far as I've managed to get tonight:
After flipping to edit mode and back to paint mode and then trying to paint a new stroke, it runs the line above and the result is that
ps->me_eval->mpoly->mat_nr
seems to incorrectly contains a negative number (-2080), and possibly the other attributes under mpoly are wrong too. This seems to lead to an index out of bounds problem which causes the crash later on inproject_paint_face_paint_slot
I've been trying to debug this and have a workaround patch to prove I'm on the right track.
I'm hoping with this information one of the developers who understands these structures and the associated memory management will be able to track down how to fix the disjoint between the
runtime->mesh_eval
and preservation of the memory use by it's various properties.This is what happens in
DerivedMesh.c: mesh_get_eval_final
:ob->runtime.mesh_eval
is0x0
, so the condition inmesh_get_eval_final
causes it to runmesh_build_data
which populatesob->runtime.mesh_eval
and all is good in the world.mesh_eval
itself contains pointers to other objects/structures, one of which ismpoly
and after switching to edit mode and back to paint mode, it seems that the memory pointed to bympoly
has been freed and used for something else. It looks like it's freed byEDBM_mesh_load
which already has a comment stating that it can invalidate the cache of other objects.ob->runtime.mesh_eval
is still a valid pointer, so when you paint the next stroke after this, the condition inmesh_get_eval_final
sees thatmesh_eval
is notNULL
, so it does not runmesh_build_data
, which means thempoly
attribute doesn't get repopulated with a valid pointer, and it's still pointing to invalid memory. It's probably the same for other attributes undermesh_eval
, butmpoly
was the one I saw causing the crash.The patch below comments out the condition and just runs
mesh_build_data
every time, which is obviously inefficient and a workaround rather than a solution, but it prevents the crash.The issue is that other functions assume that if
ob->runtime.mesh_eval
is not 0, then it contains valid data, but it currently contains properties that are pointers which can be freed by other parts of code rendering them invalid.Hi Bastien, can you please let us know what we need to do to get this bug out of "Incomplete" status? I tried posting to bf-committers, but was denied by the moderator because I'm not a member. They said to follow up here.
I'd be happy to do more debugging if someone could give me some suggestions on where to go from here as I've reached as far as I can go with my lack of understanding of the fundamental design of the eval structures and deps graph.
Thanks.
Added subscriber: @brecht
I think this patch indeed is not the right solution. The proper solution may be to tag the dependency graph to re-evaluate the mesh, but @mont29 or someone else familiar with this code needs to look at it in more detail.
I just tested this again and it seems to be fixed. I checked probably a week or so ago (after the beta) and it was still crashing, so something done recently must have fixed it. Perhaps this commit?: Depsgraph: Make data allocation dependency more robust
Changed status from 'Open' to: 'Resolved'
Thanks for testing, closing then.