Grease Pencil + OpenGL crash in VSE #50051

Closed
opened 2016-11-16 15:48:55 +01:00 by Crepe · 19 comments

System Information
Geforce 1060
Ubuntu 16.04 64bits

Blender Version
Broken:
*2.78a

  • latest on buildbot: 8b29059 (Wed Nov 16 04:25:24 2016 )

Short description of error
Crash of Blender while doing an opengl render of grease pencil

System Information
Operating system and graphics card

Exact steps for others to reproduce the error
1- set the current frame to 1
2- render the animation in opengl "OpenGL render active viewport"
3- set the current from to 10
4-hit "refresh sequencer"
5-enjoy the crash...

It's not the same bug as:
https:*developer.blender.org/T49996 or https:*developer.blender.org/T49975
but that's at least the third bug i encounter in this area, maybe there is a bigger issue underneath

bug.blend

**System Information** Geforce 1060 Ubuntu 16.04 64bits **Blender Version** Broken: *2.78a * latest on buildbot: 8b29059 (Wed Nov 16 04:25:24 2016 ) **Short description of error** Crash of Blender while doing an opengl render of grease pencil **System Information** Operating system and graphics card **Exact steps for others to reproduce the error** 1- set the current frame to 1 2- render the animation in opengl "OpenGL render active viewport" 3- set the current from to 10 4-hit "refresh sequencer" 5-enjoy the crash... It's not the same bug as: https:*developer.blender.org/T49996 or https:*developer.blender.org/T49975 but that's at least the third bug i encounter in this area, maybe there is a bigger issue underneath [bug.blend](https://archive.blender.org/developer/F401737/bug.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @CrepeC

Added subscriber: @CrepeC
Author
[bug.blend](https://archive.blender.org/developer/F401739/bug.blend)

Added subscriber: @ParrotDenis

Added subscriber: @ParrotDenis

Same bug on windows 64 NVIDIA gtx780

Same bug on windows 64 NVIDIA gtx780

Added subscriber: @antoniov

Added subscriber: @antoniov

I can reproduce on Windows 10. Maybe this is related to one previous fix, we need to look in detail.

I can reproduce on Windows 10. Maybe this is related to one previous fix, we need to look in detail.

Added subscriber: @dfelinto

Added subscriber: @dfelinto

I have running some debugs running the operator and I got the error here:

sequencer_refresh_all_exec->
	BKE_sequencer_free_imbuf->
	BKE_sequencer_cache_cleanup->
		BKE_sequencer_preprocessed_cache_cleanup->
			IMB_freeImBuf->
				imb_freerectfloatImBuf (!Error)

I have seen you only need run opengl render with GP and then press refresh button to get the error. If you remove grease pencil or don't run the opengl render, works.

There is a problem when the function try to free the memory because ibuf->rect_float has an invalid value here:

void imb_freerectfloatImBuf(ImBuf *ibuf)
{
	if (ibuf == NULL) return;
	if (ibuf->rect_float && (ibuf->mall & IB_rectfloat)) {
	MEM_freeN(ibuf->rect_float);   // THIS VALUE IS NOT VALID !!!! ERROR!!!
	ibuf->rect_float = NULL;
	}.
..
..

@dfelinto I don't know this part of the code and how imbuffers works and it looks this bug can be related to #49975, could you please take a look?

I have running some debugs running the operator and I got the error here: ``` sequencer_refresh_all_exec-> BKE_sequencer_free_imbuf-> ``` BKE_sequencer_cache_cleanup-> BKE_sequencer_preprocessed_cache_cleanup-> IMB_freeImBuf-> imb_freerectfloatImBuf (!Error) I have seen you only need run opengl render with GP and then press refresh button to get the error. If you remove grease pencil or don't run the opengl render, works. There is a problem when the function try to free the memory because **ibuf->rect_float** has an invalid value here: ``` void imb_freerectfloatImBuf(ImBuf *ibuf) { if (ibuf == NULL) return; ``` ``` if (ibuf->rect_float && (ibuf->mall & IB_rectfloat)) { ``` MEM_freeN(ibuf->rect_float); // THIS VALUE IS NOT VALID !!!! ERROR!!! ibuf->rect_float = NULL; ``` }. .. .. ``` @dfelinto I don't know this part of the code and how imbuffers works and it looks this bug can be related to #49975, could you please take a look?

Hi @antoniov this bug is present even in Blender 2.78a. And even if we revert 0b9b8ab2 the problem is still there. But I will try to debug a bit to see if I have an idea of what can it be.

Hi @antoniov this bug is present even in Blender 2.78a. And even if we revert 0b9b8ab2 the problem is still there. But I will try to debug a bit to see if I have an idea of what can it be.

By the way I'm getting the crash by doing:

  • F12
  • Opengl render

F12

In Blender 2.78 doing (1) + (2) is enough to get a crash.

By the way I'm getting the crash by doing: - F12 - Opengl render # F12 In Blender 2.78 doing (1) + (2) is enough to get a crash.

The bug was actually introduced in eaea4ea5 (Grease Pencil v2 branch)

The bug was actually introduced in eaea4ea5 (Grease Pencil v2 branch)

Let me see if it is related to the GP render passes.

Let me see if it is related to the GP render passes.

@dfelinto I think the reason is the renderpasses must not be created in sequence mode. I have tested this change and I 'm unable to get the error again, could you test before commit?

diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 16842ef..e1e2314 100644
  - a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -553,7 +553,9 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
 		RE_SetActiveRenderView(oglrender->re, rv->name);
 		oglrender->view_id = view_id;
 		/* add grease pencil passes */
  • add_gpencil_renderpass(oglrender, rr, rv);
+		if (!oglrender->is_sequencer) {
+			add_gpencil_renderpass(oglrender, rr, rv);
+		}
 		/* render composite */
 		screen_opengl_render_doit(oglrender, rr);
 	}
@dfelinto I think the reason is the renderpasses must not be created in sequence mode. I have tested this change and I 'm unable to get the error again, could you test before commit? ``` diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 16842ef..e1e2314 100644 ``` - a/source/blender/editors/render/render_opengl.c ``` +++ b/source/blender/editors/render/render_opengl.c @@ -553,7 +553,9 @@ static void screen_opengl_render_apply(OGLRender *oglrender) RE_SetActiveRenderView(oglrender->re, rv->name); oglrender->view_id = view_id; /* add grease pencil passes */ ``` - add_gpencil_renderpass(oglrender, rr, rv); ``` + if (!oglrender->is_sequencer) { + add_gpencil_renderpass(oglrender, rr, rv); + } /* render composite */ screen_opengl_render_doit(oglrender, rr); }
Antonio Vazquez self-assigned this 2016-11-16 19:30:38 +01:00

That certainly stops the crashes. I really think the grease pencil and sequencer should be rethought. But the patch at least seems to prevent the crash. That said it would be nice to understand what's going on, and add it as a code comment before the if (!oglrender->is_sequencer) { line.

That certainly stops the crashes. I really think the grease pencil and sequencer should be rethought. But the patch at least seems to prevent the crash. That said it would be nice to understand what's going on, and add it as a code comment before the `if (!oglrender->is_sequencer) {` line.

Yes, we need to rethink not only opengl render of grease pencil in sequencer, but for all modes.

Now, make compositing with grease pencil is not easy and we need integrate better the render workflow. I think this must be a topic for the 2.8 version and it's one of the points we are working.

I'm going to commit the fix because what is sure is we don't need render passes in the sequencer.

Yes, we need to rethink not only opengl render of grease pencil in sequencer, but for all modes. Now, make compositing with grease pencil is not easy and we need integrate better the render workflow. I think this must be a topic for the 2.8 version and it's one of the points we are working. I'm going to commit the fix because what is sure is we don't need render passes in the sequencer.

This issue was referenced by e400f4a53e

This issue was referenced by e400f4a53ec435b8c93c309896e63393c5b70bf3

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

It works ! Thanks Antonio and Dalai :)

It works ! Thanks Antonio and Dalai :)
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#50051
No description provided.