Image projection triggers assert #82545

Closed
opened 2020-11-09 19:12:02 +01:00 by Martijn Versteegh · 13 comments

System Information
Operating system: Linux-5.4.0-52-generic-x86_64-with-debian-bullseye-sid 64 Bits (Ubuntu 20.04)
Graphics card: GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 450.80.02

Blender Version
Broken: version: 2.92.0 Alpha, branch: master (modified), commit date: 2020-11-09 11:54, hash: 0c4d12986a

Short description of error
When projecting a camera image onto the mesh, I sometimes get an assert. I finally succeeded in creating a .blend which can reliably reproduce the issue.

Exact steps for others to reproduce the error
Open the attached .blend assert_during_projection_painting.blend

In the properties pane click on 'Apply Camera Image' and choose img_101.jpg

=> BLI_assert failed: source/blender/editors/sculpt_paint/paint_image_proj.c:1889, project_paint_uvpixel_init(), at 'ps->pixel_sizeof == project_paint_pixel_sizeof(ps->tool)'

backtrace:

- 0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
- 1   in __GI_abort () at abort.c:79
- 2   in _BLI_assert_abort () at blender/source/blender/blenlib/intern/BLI_assert.c:50
- 3   in project_paint_uvpixel_init (ps=0x7fffffffaf90, arena=0x7fffcb940908, tinf=0x7fffd0bb8db0, x_px=711, y_px=1022, mask=1, tri_index=3, pixelScreenCo=0x7fffd0bb8e10, world_spaceCo=0x7fffd0bb8e04, w=0x7fffd0bb8df8) at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:1889
- 4   in project_paint_face_init (ps=0x7fffffffaf90, thread_index=3, bucket_index=10442, tri_index=3, image_index=0, clip_rect=0x7fffd0bb9170, bucket_bounds=0x7fffd0bb9160, ibuf=0x7fffcbb73a08, tmpibuf=0x7fffd0bb9008) at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:3388
- 5   in project_bucket_init (ps=0x7fffffffaf90, thread_index=3, bucket_index=10442, clip_rect=0x7fffd0bb9170, bucket_bounds=0x7fffd0bb9160) at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:3495
- 6   in do_projectpaint_thread (UNUSED_pool=0x7fffccbb6908, ph_v=0x7ffffffeef80) at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:5208
- 7   in Task::operator()() const::{lambda()#1}::operator()() const (__closure=0x7fffd0bb92d0) at blender/source/blender/blenlib/intern/task_pool.cc:118
- 8   in tbb::interface7::internal::delegated_function<Task::operator()() const::{lambda()#1} const, void>::operator()() const (this=0x7fffd0bb9260) at lib/linux_centos7_x86_64/tbb/include/tbb/task_arena.h:93
- 9   in tbb::interface7::internal::isolate_within_arena(tbb::interface7::internal::delegate_base&, long) ()
- 10  in tbb::interface7::internal::isolate_impl<void, Task::operator()() const::{lambda()#1} const>(Task::operator()() const::{lambda()#1} const&) (f=...) at lib/linux_centos7_x86_64/tbb/include/tbb/task_arena.h:160
- 11  in tbb::interface7::this_task_arena::isolate<Task::operator()() const::{lambda()#1}>(tbb::interface7::internal::return_type_or_void const&) (f=...) at /home/martijn/progs/blender-git/lib/linux_centos7_x86_64/tbb/include/tbb/task_arena.h:395
- 12  in Task::operator()() const (this=0x7fffeff72f48) at blender/source/blender/blenlib/intern/task_pool.cc:118
- 13  in tbb::internal::function_task<Task>::execute() (this=0x7fffeff72f40) at lib/linux_centos7_x86_64/tbb/includetbb/task.h:1048
- 14  in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) ()
- 15  in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) ()
- 16  in tbb::internal::arena::process(tbb::internal::generic_scheduler&) ()
- 17  in tbb::internal::market::process(rml::job&) ()
- 18  in tbb::internal::rml::private_worker::run() ()
- 19  in tbb::internal::rml::private_worker::thread_routine(void*) ()
- 20  in start_thread (arg=<optimized out>) at pthread_create.c:477
- 21  in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
**System Information** Operating system: Linux-5.4.0-52-generic-x86_64-with-debian-bullseye-sid 64 Bits (Ubuntu 20.04) Graphics card: GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 450.80.02 **Blender Version** Broken: version: 2.92.0 Alpha, branch: master (modified), commit date: 2020-11-09 11:54, hash: `0c4d12986a` **Short description of error** When projecting a camera image onto the mesh, I sometimes get an assert. I finally succeeded in creating a .blend which can reliably reproduce the issue. **Exact steps for others to reproduce the error** Open the attached .blend [assert_during_projection_painting.blend](https://archive.blender.org/developer/F9247005/assert_during_projection_painting.blend) In the properties pane click on 'Apply Camera Image' and choose img_101.jpg ``` => BLI_assert failed: source/blender/editors/sculpt_paint/paint_image_proj.c:1889, project_paint_uvpixel_init(), at 'ps->pixel_sizeof == project_paint_pixel_sizeof(ps->tool)' ``` backtrace: ```lines - 0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 - 1 in __GI_abort () at abort.c:79 - 2 in _BLI_assert_abort () at blender/source/blender/blenlib/intern/BLI_assert.c:50 - 3 in project_paint_uvpixel_init (ps=0x7fffffffaf90, arena=0x7fffcb940908, tinf=0x7fffd0bb8db0, x_px=711, y_px=1022, mask=1, tri_index=3, pixelScreenCo=0x7fffd0bb8e10, world_spaceCo=0x7fffd0bb8e04, w=0x7fffd0bb8df8) at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:1889 - 4 in project_paint_face_init (ps=0x7fffffffaf90, thread_index=3, bucket_index=10442, tri_index=3, image_index=0, clip_rect=0x7fffd0bb9170, bucket_bounds=0x7fffd0bb9160, ibuf=0x7fffcbb73a08, tmpibuf=0x7fffd0bb9008) at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:3388 - 5 in project_bucket_init (ps=0x7fffffffaf90, thread_index=3, bucket_index=10442, clip_rect=0x7fffd0bb9170, bucket_bounds=0x7fffd0bb9160) at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:3495 - 6 in do_projectpaint_thread (UNUSED_pool=0x7fffccbb6908, ph_v=0x7ffffffeef80) at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:5208 - 7 in Task::operator()() const::{lambda()#1}::operator()() const (__closure=0x7fffd0bb92d0) at blender/source/blender/blenlib/intern/task_pool.cc:118 - 8 in tbb::interface7::internal::delegated_function<Task::operator()() const::{lambda()#1} const, void>::operator()() const (this=0x7fffd0bb9260) at lib/linux_centos7_x86_64/tbb/include/tbb/task_arena.h:93 - 9 in tbb::interface7::internal::isolate_within_arena(tbb::interface7::internal::delegate_base&, long) () - 10 in tbb::interface7::internal::isolate_impl<void, Task::operator()() const::{lambda()#1} const>(Task::operator()() const::{lambda()#1} const&) (f=...) at lib/linux_centos7_x86_64/tbb/include/tbb/task_arena.h:160 - 11 in tbb::interface7::this_task_arena::isolate<Task::operator()() const::{lambda()#1}>(tbb::interface7::internal::return_type_or_void const&) (f=...) at /home/martijn/progs/blender-git/lib/linux_centos7_x86_64/tbb/include/tbb/task_arena.h:395 - 12 in Task::operator()() const (this=0x7fffeff72f48) at blender/source/blender/blenlib/intern/task_pool.cc:118 - 13 in tbb::internal::function_task<Task>::execute() (this=0x7fffeff72f40) at lib/linux_centos7_x86_64/tbb/includetbb/task.h:1048 - 14 in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) () - 15 in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) () - 16 in tbb::internal::arena::process(tbb::internal::generic_scheduler&) () - 17 in tbb::internal::market::process(rml::job&) () - 18 in tbb::internal::rml::private_worker::run() () - 19 in tbb::internal::rml::private_worker::thread_routine(void*) () - 20 in start_thread (arg=<optimized out>) at pthread_create.c:477 - 21 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ```
Author
Member

Added subscriber: @Baardaap

Added subscriber: @Baardaap

Added subscriber: @rjg

Added subscriber: @rjg

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

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

I can confirm this assert on a Windows build. The BLI_assert(ps->pixel_sizeof == project_paint_pixel_sizeof(ps->tool)); is triggered in project_paint_uvpixel_init.

bli_load_symbols(...) Line 356	C
BLI_system_backtrace(_iobuf * fp) Line 380	C
_BLI_assert_print_backtrace() Line 39	C
project_paint_uvpixel_init(const ProjPaintState * ps, MemArena * arena, const TileInfo * tinf, int x_px, int y_px, const float mask, const int tri_index, const float * pixelScreenCo, const float * world_spaceCo, const float * w) Line 1889	C
project_paint_face_init(const ProjPaintState * ps, const int thread_index, const int bucket_index, const int tri_index, const int image_index, const rctf * clip_rect, const rctf * bucket_bounds, ImBuf * ibuf, ImBuf * * tmpibuf) Line 3386	C
project_bucket_init(const ProjPaintState * ps, const int thread_index, const int bucket_index, const rctf * clip_rect, const rctf * bucket_bounds) Line 3504	C
do_projectpaint_thread(TaskPool * UNUSED_pool, void * ph_v) Line 5211	C
Task::()::__l2::<Lambdafunktion>() Line 118	C++
tbb::interface7::internal::delegated_function<void <Lambdafunktion>(void) const ,void>::operator()() Line 94	C++
[External Code]	
tbb::interface7::internal::isolate_impl<void,void <Lambdafunktion>(void) const>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 161	C++
tbb::interface7::this_task_arena::isolate<void <Lambdafunktion>(void)>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 396	C++
Task::operator()() Line 122	C++
tbb::internal::function_task<Task>::execute() Line 1049	C++
[External Code]
I can confirm this assert on a Windows build. The `BLI_assert(ps->pixel_sizeof == project_paint_pixel_sizeof(ps->tool));` is triggered in `project_paint_uvpixel_init`. ``` bli_load_symbols(...) Line 356 C BLI_system_backtrace(_iobuf * fp) Line 380 C _BLI_assert_print_backtrace() Line 39 C project_paint_uvpixel_init(const ProjPaintState * ps, MemArena * arena, const TileInfo * tinf, int x_px, int y_px, const float mask, const int tri_index, const float * pixelScreenCo, const float * world_spaceCo, const float * w) Line 1889 C project_paint_face_init(const ProjPaintState * ps, const int thread_index, const int bucket_index, const int tri_index, const int image_index, const rctf * clip_rect, const rctf * bucket_bounds, ImBuf * ibuf, ImBuf * * tmpibuf) Line 3386 C project_bucket_init(const ProjPaintState * ps, const int thread_index, const int bucket_index, const rctf * clip_rect, const rctf * bucket_bounds) Line 3504 C do_projectpaint_thread(TaskPool * UNUSED_pool, void * ph_v) Line 5211 C Task::()::__l2::<Lambdafunktion>() Line 118 C++ tbb::interface7::internal::delegated_function<void <Lambdafunktion>(void) const ,void>::operator()() Line 94 C++ [External Code] tbb::interface7::internal::isolate_impl<void,void <Lambdafunktion>(void) const>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 161 C++ tbb::interface7::this_task_arena::isolate<void <Lambdafunktion>(void)>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 396 C++ Task::operator()() Line 122 C++ tbb::internal::function_task<Task>::execute() Line 1049 C++ [External Code] ```
Robert Guetzkow changed title from BLI_assert failed: source/blender/editors/sculpt_paint/paint_image_proj.c:1889, project_paint_uvpixel_init(), at 'ps->pixel_sizeof == project_paint_pixel_sizeof(ps->tool)' to Image projection triggers assert 2020-11-09 19:22:55 +01:00

I will try to bisect this tomorrow.

I will try to bisect this tomorrow.
Author
Member

I'll can do a bisect myself. At least I'll test if it already happened in 2.80. My guess is that is has always been there, because I've experienced the crash in 2.80 as well, though I'm of course not completely sure if it was the same, as that was a release build.

I'll can do a bisect myself. At least I'll test if it already happened in 2.80. My guess is that is has always been there, because I've experienced the crash in 2.80 as well, though I'm of course not completely sure if it was the same, as that was a release build.

@Baardaap Alright, thank you!

@Baardaap Alright, thank you!
Author
Member

I have a good bisecting setup ready to go, and 2.83 doesn't crash. I'll do the bisect now.

I have a good bisecting setup ready to go, and 2.83 doesn't crash. I'll do the bisect now.
Author
Member

Alas. v2.83 already had the assert. It doesn't trigger in release mode of course, so at first I though v2.83 was ok. But a debug build does assert in the same place.

I didn't succeed in building anything older than v2.83 anything older I try to build I get linker errors and I can't figure out how to solve them. (I do checkout the correct precompiled libs from svn, but still I get linker errors).

But my first theory still stands (that this is hard to bisect because it has always been there).

Alas. v2.83 already had the assert. It doesn't trigger in release mode of course, so at first I though v2.83 was ok. But a debug build does assert in the same place. I didn't succeed in building anything older than v2.83 anything older I try to build I get linker errors and I can't figure out how to solve them. (I do checkout the correct precompiled libs from svn, but still I get linker errors). But my first theory still stands (that this is hard to bisect because it has always been there).

I will take another look at it tomorrow, I'm currently bisecting another issue. Taking a look at the code it seems that project_paint_uvpixel_init expects that project_state_init is previously run, since that function sets ps->pixel_sizeof and it should be equal to project_paint_pixel_sizeof(ps->tool);.

I will take another look at it tomorrow, I'm currently bisecting another issue. Taking a look at the code it seems that `project_paint_uvpixel_init` expects that `project_state_init` is previously run, since that function sets `ps->pixel_sizeof` and it should be equal to `project_paint_pixel_sizeof(ps->tool);`.

The ps->tool is not the same during project_state_init and project_paint_uvpixel_init. Therefore, the size retrieved by project_paint_pixel_sizeof(ps->tool) is different. However, I'm not familiar enough with the code to be sure if the entire code really needs them to be equal. It might also be that it's fine as long as ps->pixel_sizeof >= sizeof(ProjPixel) as is checked in project_state_init.

The `ps->tool` is not the same during `project_state_init` and `project_paint_uvpixel_init`. Therefore, the size retrieved by `project_paint_pixel_sizeof(ps->tool)` is different. However, I'm not familiar enough with the code to be sure if the entire code really needs them to be equal. It might also be that it's fine as long as `ps->pixel_sizeof >= sizeof(ProjPixel)` as is checked in `project_state_init`.
Philipp Oeser removed the
Interest
Sculpt, Paint & Texture
label 2023-02-10 09:12:14 +01:00
Member

@Baardaap : cannot repro the assert anymore (at least not in current main)

Could you check if this is still an issue?

@Baardaap : cannot repro the assert anymore (at least not in current main) Could you check if this is still an issue?
Philipp Oeser added
Status
Needs Information from User
and removed
Status
Confirmed
labels 2024-03-07 10:15:35 +01:00
Author
Member

Is does seem to be fixed. Tried with a few other old projects (where I detected it first back then) and haven't seen the assert anymore.

Is does seem to be fixed. Tried with a few other old projects (where I detected it first back then) and haven't seen the assert anymore.
Blender Bot added
Status
Archived
and removed
Status
Needs Information from User
labels 2024-03-29 23:48:31 +01: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
3 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#82545
No description provided.