Crash/program shutdown - draw texture in fullscreen #54584

Closed
opened 2018-04-12 19:06:19 +02:00 by Irrelevant · 9 comments

System Information
Windows 10
(intel i5 quadcore, 16GB RAM, 4k display)
Nvidia Quadro k2200

Blender Version:
2.79.4 (?official?)
Hash: d2e1a14 (don't distinguish between 1 and l)

Description:
Blender crashes after paint stroke in UV editor when editor window full screen - in Cycles, other unconfirmed.

Lacking knowledge to attach .blend file, reachable at "http://pasteall.org/blend/index.php?id=49313"

File:
paintbug.blend

Exact steps for others to reproduce the error

Attached file:

  • exit fullscreen
  • enter fullscreen

stroke -> crash.

New file:
Engine = CYCLES

  • Unwrap mesh and assign material (method irrelevant)
  • separate window:
  • 3D View
  • UV editor
  • Node editor (optional)
  • set 3D view mode to Rendered or Textured
  • In UV/IMG Editor make New image (1024px, 32b, black/blank in my case)
  • Set UVeditor mode to texture paint
  • In Node Editor make image texture node, select new image and connect to arbitrary output shader
  • test painting on canvas (all views visible), stroke should work normal
  • set UV Editor to full screen (ctrl-uparrow in my case)
  • draw on canvas again, crash or program shutdown occurs.
**System Information** Windows 10 (intel i5 quadcore, 16GB RAM, 4k display) Nvidia Quadro k2200 **Blender Version:** 2.79.4 (?official?) Hash: d2e1a14 (don't distinguish between 1 and l) **Description:** Blender crashes after paint stroke in UV editor when editor window full screen - in Cycles, other unconfirmed. Lacking knowledge to attach .blend file, reachable at "http://pasteall.org/blend/index.php?id=49313" **File:** [paintbug.blend](https://archive.blender.org/developer/F2670705/paintbug.blend) **Exact steps for others to reproduce the error** **Attached file:** - exit fullscreen - enter fullscreen # stroke -> crash. **New file:** Engine = **CYCLES** - Unwrap mesh and assign material (method irrelevant) - separate window: - 3D View - UV editor - Node editor (optional) - set 3D view mode to **Rendered** or **Textured** - In UV/IMG Editor make New image (1024px, 32b, black/blank in my case) - Set UVeditor mode to **texture paint** - In Node Editor make **image texture** node, select new image and connect to arbitrary output shader - test painting on canvas (all views visible), stroke should work normal - set UV Editor to **full screen** (ctrl-uparrow in my case) - draw on canvas again, crash or program shutdown occurs.
Author

Added subscriber: @VenomirOK

Added subscriber: @VenomirOK

#54743 was marked as duplicate of this issue

#54743 was marked as duplicate of this issue

#54546 was marked as duplicate of this issue

#54546 was marked as duplicate of this issue
Member

Added subscribers: @ideasman42, @lichtwerk

Added subscribers: @ideasman42, @lichtwerk
Campbell Barton was assigned by Philipp Oeser 2018-04-17 15:47:32 +02:00
Member

Can confirm this, this is an issue in undo.
When bmain->is_memfile_undo_written is false (happens when going into fullscreen) then a new "MemFile Internal" UndoStep is pushed to the stack as well as step_init on the stack gets null.
If thats the case -- plus the name thats passed to BKE_undosys_step_push_with_type() is null (which can happen, but thats not always harmful) the crash happens in BLI_strncpy.

Had a quick look and something like P659: #54584 snippet



diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c
index 5a0081bff16..ad9ac56620d 100644
--- a/source/blender/blenkernel/intern/undo_system.c
+++ b/source/blender/blenkernel/intern/undo_system.c
@@ -420,7 +420,7 @@ bool BKE_undosys_step_push_with_type(UndoStack *ustack, bContext *C, const char
 	UndoStep *us = ustack->step_init ? ustack->step_init : MEM_callocN(ut->step_size, __func__);
 	ustack->step_init = NULL;
 	if (us->name- [x] == '\0') {
-		BLI_strncpy(us->name, name, sizeof(us->name));
+		BLI_strncpy(us->name, name ? name : ustack->step_active->name, sizeof(us->name));
 	}
 	us->type = ut;
 	/* initialized, not added yet. */

will fix, but I am unsure if this has undesired consequences.

As @ideasman42 was rewriting undo, assigning to him.

Can confirm this, this is an issue in undo. When `bmain->is_memfile_undo_written` is false (happens when going into fullscreen) then a new "MemFile Internal" UndoStep is pushed to the stack as well as step_init on the stack gets null. If thats the case -- plus the `name` thats passed to BKE_undosys_step_push_with_type() is null (which can happen, but thats not always harmful) the crash happens in `BLI_strncpy`. Had a quick look and something like [P659: #54584 snippet](https://archive.blender.org/developer/P659.txt) ``` diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c index 5a0081bff16..ad9ac56620d 100644 --- a/source/blender/blenkernel/intern/undo_system.c +++ b/source/blender/blenkernel/intern/undo_system.c @@ -420,7 +420,7 @@ bool BKE_undosys_step_push_with_type(UndoStack *ustack, bContext *C, const char UndoStep *us = ustack->step_init ? ustack->step_init : MEM_callocN(ut->step_size, __func__); ustack->step_init = NULL; if (us->name- [x] == '\0') { - BLI_strncpy(us->name, name, sizeof(us->name)); + BLI_strncpy(us->name, name ? name : ustack->step_active->name, sizeof(us->name)); } us->type = ut; /* initialized, not added yet. */ ``` will fix, but I am unsure if this has undesired consequences. As @ideasman42 was rewriting undo, assigning to him.
Member

I was going over related reports to see whether these can be merged and just for completeness: here is the backtrace

1  BLI_strnlen                     string.c           757  0x2a487e2 
2  BLI_strncpy                     string.c           116  0x2a47512 
3  BKE_undosys_step_push_with_type undo_system.c      423  0x276e204 
4  BKE_undosys_step_push           undo_system.c      448  0x276e343 
5  ED_image_undo_push_end          paint_image_undo.c 358  0x1e02c9e 
6  paint_stroke_done               paint_image.c      576  0x1de542f 
7  stroke_done                     paint_stroke.c     754  0x1e0bc7f 
8  paint_stroke_modal              paint_stroke.c     1176 0x1e0cfa8 
I was going over related reports to see whether these can be merged and just for completeness: here is the backtrace ``` 1 BLI_strnlen string.c 757 0x2a487e2 2 BLI_strncpy string.c 116 0x2a47512 3 BKE_undosys_step_push_with_type undo_system.c 423 0x276e204 4 BKE_undosys_step_push undo_system.c 448 0x276e343 5 ED_image_undo_push_end paint_image_undo.c 358 0x1e02c9e 6 paint_stroke_done paint_image.c 576 0x1de542f 7 stroke_done paint_stroke.c 754 0x1e0bc7f 8 paint_stroke_modal paint_stroke.c 1176 0x1e0cfa8 ```
Member

Added subscribers: @RevDr, @JulienKaspar

Added subscribers: @RevDr, @JulienKaspar

This issue was referenced by b496bf022b

This issue was referenced by b496bf022bc48fd759e4848edf93d181985e31ad

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
4 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#54584
No description provided.