Crash as soon as press material button in properties panel #55555

Closed
opened 2018-06-20 16:47:12 +02:00 by Antonio Vazquez · 29 comments

Windows 10 64 bits - Compiled source with last version at 20/06/2018 16:00 using MSVSC 2017 Debug mode

To reproduce:

  1. blender --factory-startup
  2. Select material icon in properties panel
  3. Crash

Log details: P733

Doing some debug, the function GPU_texture_bind() is failing because text field is NULL.

The line with error is this:

if (tex->bindcode != 0)
Windows 10 64 bits - Compiled source with last version at 20/06/2018 16:00 using MSVSC 2017 Debug mode To reproduce: 1) blender --factory-startup 2) Select material icon in properties panel 3) Crash Log details: [P733](https://archive.blender.org/developer/P733.txt) Doing some debug, the function GPU_texture_bind() is failing because text field is NULL. The line with error is this: ``` if (tex->bindcode != 0)
Author
Member

Added subscriber: @antoniov

Added subscriber: @antoniov

#55567 was marked as duplicate of this issue

#55567 was marked as duplicate of this issue
Member

Added subscribers: @ignatz, @lichtwerk

Added subscribers: @ignatz, @lichtwerk
Clément Foucault was assigned by Philipp Oeser 2018-06-21 12:13:51 +02:00
Member

Added subscriber: @fclem

Added subscriber: @fclem
Member

I cannot reproduce (linux 970m, 390.59 drivers)
This has been reported a couple of times btw., see #55541, #55553, #55523, #55567 (I've closed these before because of 2.8 policy)

But I assume this is MacOS/Windows issue?

Seeing @fclem already talking about it in IRC, assigning to him?

I cannot reproduce (linux 970m, 390.59 drivers) This has been reported a couple of times btw., see #55541, #55553, #55523, #55567 (I've closed these before because of 2.8 policy) But I assume this is MacOS/Windows issue? Seeing @fclem already talking about it in IRC, assigning to him?
Author
Member

The problem is only in Windows and Mac:

Tested:
Commit 30c383fd35 works

The commit that introduced the error is this: 8c77c36539

The problem is only in Windows and Mac: Tested: Commit 30c383fd35b5184037ba58ed2f7184af39a7b946 works The commit that introduced the error is this: 8c77c3653996516ba152eade2c27980ae20a1198
Author
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Author
Member

Only in Windows and maybe in Mac.

Only in Windows and maybe in Mac.

This issue was referenced by c45a3b80e2

This issue was referenced by c45a3b80e2356a952248eaafaeeec48b28bcb0fd
Author
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Member

@fclem I'm not sure if this is related, but now I get the same error when press F12 using Eevee. The error is not all the times (maybe 90% of times).

@fclem I'm not sure if this is related, but now I get the same error when press F12 using Eevee. The error is not all the times (maybe 90% of times).

Hmmm then it seems that 8c77c36539 is wrong in some way.

There must be some threading issue with the context creation process. Maybe we need some mutex in GHOST for the initialization of the context at least.

Hmmm then it seems that 8c77c3653996516ba152eade2c27980ae20a1198 is wrong in some way. There must be some threading issue with the context creation process. Maybe we need some mutex in GHOST for the initialization of the context at least.
Member

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'
Member

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Member

It's a classic race condition, here's what's up

sometimes:

  1. main thread: createOffscreenContext (offscreen context is now bound to main thread)
  2. main thread: Start background render.
  3. mainthread redraws ui and calls wglMakeCurrent on the gui context, detaching the offscreencontext from the main thread.
  4. Background Thread: wglMakeCurrent on offscreen context succeeds since it's not bound currently

Render success!

most of the time:

  1. main thread: createOffscreenContext (offscreen context is now bound to main thread)
  2. main thread: Start background render.
  3. Background Thread: wglMakeCurrent on offscreen context fails since it's still bound to the main thread.
  4. mainthread redraws ui and calls wglMakeCurrent on the gui context.
  5. background thread tries to make a texture without an active context, and crashes.

Something like P737 fixes it, but feels kinda hacky (I suppose this might also be an issue on other platforms which this patch doesn't address), @mano-wii any opinions here? maybe have make it a requirement that createOffscreenContext restores the context it was on when it was called?

It's a classic race condition, here's what's up sometimes: 1. main thread: createOffscreenContext (offscreen context is now bound to main thread) 2. main thread: Start background render. 3. mainthread redraws ui and calls wglMakeCurrent on the gui context, detaching the offscreencontext from the main thread. 4. Background Thread: wglMakeCurrent on offscreen context succeeds since it's not bound currently Render success! most of the time: 1. main thread: createOffscreenContext (offscreen context is now bound to main thread) 2. main thread: Start background render. 3. Background Thread: wglMakeCurrent on offscreen context fails since it's still bound to the main thread. 4. mainthread redraws ui and calls wglMakeCurrent on the gui context. 5. background thread tries to make a texture without an active context, and crashes. Something like [P737](https://archive.blender.org/developer/P737.txt) fixes it, but feels kinda hacky (I suppose this might also be an issue on other platforms which this patch doesn't address), @mano-wii any opinions here? maybe have make it a requirement that createOffscreenContext restores the context it was on when it was called?

Well my latest refactor in this area was to assure that a context is only made current on the thread that will use it (first time made active in GHOST_ContextWGL::initContext). So maybe I overlooked something.

Well my latest refactor in this area was to assure that a context is only made current on the thread that will use it (first time made active in GHOST_ContextWGL::initContext). So maybe I overlooked something.
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

I tried doing the same thing, and that blew up a tiny bit, to share resources the creating thread needs exclusive access to the main context currently bound to the main thread. WM_opengl_context_create has a comment about it, guess i'm not the first one to try and fail at this :)

Think best way forward is have createOffscreenContext create the context, but restore the calling context when it's done. Implemented this in D3499 and F12 , Background renders and the material tab all work now.

I tried doing the same thing, and that blew up a tiny bit, to share resources the creating thread needs exclusive access to the main context currently bound to the main thread. WM_opengl_context_create has a comment about it, guess i'm not the first one to try and fail at this :) Think best way forward is have createOffscreenContext create the context, but restore the calling context when it's done. Implemented this in [D3499](https://archive.blender.org/developer/D3499) and F12 , Background renders and the material tab all work now.
Author
Member

thanks @LazyDodo

thanks @LazyDodo

Added subscriber: @StephenHamacek

Added subscriber: @StephenHamacek

Thanks, mac build fixed for me too.

Thanks, mac build fixed for me too.

Added subscriber: @KristiCentinaro

Added subscriber: @KristiCentinaro

I wanted to report seeing this with the latest build as of 7/8/2018. I used both Windows x64 versions available and consistently saw the same result.

System: Windows 10 Home

Steps to reproduce:

  • Start blender default configuration
  • Select Cube
  • Navigate to the materials tab in properties panel

App would then crash.

I wanted to report seeing this with the latest build as of 7/8/2018. I used both Windows x64 versions available and consistently saw the same result. System: Windows 10 Home Steps to reproduce: - Start blender default configuration - Select Cube - Navigate to the materials tab in properties panel App would then crash.

Added subscriber: @lileo

Added subscriber: @lileo

macOS : Blender(7/8/2018)

blender --factory-startup
Select Light icon in properties panel
Crash

macOS : Blender(7/8/2018) blender --factory-startup Select Light icon in properties panel Crash

Added subscriber: @mezgino85

Added subscriber: @mezgino85

so , what i have to do to fix this Bug??
Crashed when pressing material icon
WIN 10 , 64 B

renderer: 'Quadro 2000M/PCIe/SSE2'
vendor: 'NVIDIA Corporation'
version: '4.5.0 NVIDIA 347.88'

so , what i have to do to fix this Bug?? Crashed when pressing material icon WIN 10 , 64 B renderer: 'Quadro 2000M/PCIe/SSE2' vendor: 'NVIDIA Corporation' version: '4.5.0 NVIDIA 347.88'

Added subscriber: @brecht

Added subscriber: @brecht

@mezgino85, see my reply in #68003 (Report Bug).

@mezgino85, see my reply in #68003 (Report Bug).
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
10 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#55555
No description provided.