Crash when trying to bake a texture from one model to another. #80395
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#80395
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
Operating system: Linux-5.4.0-45-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: GeForce GTX 760/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.100
Blender Version
Broken: version: 2.90.0, branch: master, commit date: 2020-08-31 11:26, hash:
0330d1af29
version 2.83 is broken as well
{F8833732}
crash-small.crash.txt
crash-small.blend
Short description of error
When trying to bake a texture from one object to another, blender crashes.
Exact steps for others to reproduce the error
Open the attached .blend, select 'lier-scan' in the outliner, then ctrl-select 'remeshed'. Click bake. => crash.
Added subscriber: @Baardaap
I compiled a debug version of v2.90.0 and created a backtrace:
I did some more digging with valgrind and found the following:
Valgrind output:
The offending line is in /source/blender/render/intern/source/external_engine.c :
192├> if (bake_pixel->object_id != engine->bake.object_id) {
If valgrind is to be believed, only the first 4 bytes of the memory bake_pixel points to are defined ( those would be bake_pixel->primitive_id, which is set to -1) and bake_pixel->object_id is undefined .
I'll see if I can find out where the undefined memory comes from, but as I'm very unfamiliar with the blender source code I'm not really sure what this means. I might even be completely harmless.
If I continue from this error I immediately end up in the crash from the above stacktrace. With index consistently set to 3974, but width seems to be filled with random data, because it is different on each run and I've even seen negative values for it.
I hope this extra info will help. If more testing/debugging needs to be done I can do more valgrind runs if somebody can tell me what to look for...
Added subscriber: @ankitm
Changed status from 'Needs Triage' to: 'Confirmed'
Thank you so much for debugging this out!
note to self to try to redo it.
A note that there's a circular dependency "Circular dependency for image "lier-model" from object "remeshed"" . It should be removed.
The circular dependency is (imho) a false positive. The image lier-model is attached to the remeshed base color image texture. But the color data is coming from lier-scan, which has a different material. Remeshed is the target object and it's texture is only written to. My guess is that the dependency checker ignores the 'selected to active' setting.
I always ignore this warning in this specific situation and it has never lead to problems. Furthermore, if I detach the image from the 'base color' slot, the warning goes away, but the crash stays (with exactly the same symptoms and tracebacks).
I found out that if I export 'lier-scan' and 'remeshed' to .obj files and I import them both in a clean .blend the problem goes away. So somehow something got messed up in this specific .blend and it's not the geometry/topology that's causing the crash.
After a rather long debugging session last night I found out that the mesh was not synced to cycles because in the viewlayer filter surfaces were turned off (this scene was extracted from another big scene where I had turned them off temporarily).
But the baking info does reference the mesh, so cycles tries to render a nonexistent mesh.
Rather a corner case, this. I'd say it needs an early return (maybe with a warning for the user that surfaces are off) when view_layer->use_surfaces is false when hitting the bake button.
Thank you for working on it!
Please install Arcanist, create a branch, commit the changes and run
arc diff
.https://wiki.blender.org/wiki/Process/Contributing_Code
I didn't create any changes (yet?) and I'm not sure I'm familiar enough with the code to know where to put it. I just did a lot of stepping in a debugger.
I'll look into the arcanist stuff for when I do want to contribute something.
I think I know where to put it.
This issue was referenced by
f117966c4e
Changed status from 'Confirmed' to: 'Resolved'