Grease Pencil crashes in 32-Bit version #61413
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#61413
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: win 7
Graphics card: Vega 64
Full System Information: Here
Blender Version
Broken: -69b2f5268114-windows32
Works: -69b2f5268114-windows64
Short description of error
32-Bit Blender crashes when drawing with grease pencil.
Exact steps for others to reproduce the error
At which point I get this:
This file was saved in the 32-bit version:
win32_Save.blend
Open and start drawing and erasing.
Here's the log from
--debug --factory-startup
Issues:
b8dc7e9cb8
d46aee2982
b82afb4b01
Added subscriber: @ChristopherAnderssarian
This issue was referenced by
b82afb4b01
Added subscriber: @JacquesLucke
I get an assert when I open this file. Bisecting...
@JacquesLucke I got to open it once...now get the assert. The problem is related to brushes. They have forgotten the gp_settings... I'm investigating.
This issue was referenced by
b8dc7e9cb8
The eraser brush is damaged and the same for the default draw brush.
I going to do some changes to avoid crashes if the brush is damaged, but we need to know how the brush was damaged.
@ChristopherAnderssarian Could you tell us the steps you did with the brushes to get this situation? did you have any other crash before?
Updated task!
Okay, new update, I had been running with
--debug
(I'm having the same problems as reported in #60089 and with debug is the only way to run Blender)For some spontaneous reason, Blender* launched (without the debug command)
Here's what I found:
Launching Blender's 32-Bit & 64-Bit build (-69b2f5268114-) both with
--debug --factory-startup
show different results:*(At least with Correction: -7f77961f1c38-windows32 it did, I haven't managed to get -69b2f5268114-windows32 running without
--debug
)69b2f5268114-windows32 has brush damaged... maybe it's the template.
Are you able to reproduce the issue in a new file still?
@JacquesLucke Yep
March 22, 00:28:10 - 1ae6aaad43ad 2.80 Beta Windows 32 bit
Thanks, I was able to reproduce it now.
I'm investigating this. Right now I'm trying to figure out how to make a 32 bit debug build on windows that does not crash when I remove any object...
@JacquesLucke did you get the error in 64 bits version?
No, 64 bit seems fine in my initial test.
Added subscriber: @brecht
Please try again with the very latest 2.80 32bit build:
https://builder.blender.org/download/
4f4cea727e
may have fixed some or all of these issues.Well, this task has sort of lost it's identity, with crash being fixed already.
But I still have the damaged brushes as seen in #61413#646242.
Also after File > Load Factory Settings while in the 2D Animation workspace?
If so, does it also happen when adding a new grease pencil object?
Yep
Checking...
Yes, I still get damaged brushes.
I actually get a crash.
Quick repo steps:
blender-2.80.0-git.d986b04bd302-windows32
I'm now getting a crash just by opening the 2D Animation template:
blender-2.80.0-git.75f551facaf0-windows32
After more investigation it looks like you can't open blend files (with GPencil data) on different architectures than what it was made on.
In opening the 64-bit .blend with 32-bit I get:
blender-2.80.0-git.009dbc2bc9fb-windows32
In opening the 32-bit .blend with 64-bit I get:
blender-2.80.0-git.009dbc2bc9fb-windows64
Added subscriber: @LazyDodo
up until last week, there was an issue in blenders DNA code for 32 bit, fields were not the size blender though they were, can you still reproduce the issue in files created in a recent build?
@brecht beat you to it :) #61413#653490
But yeah stupid of me not including the hash... updated comment!
yeah but you mentioned opening, files created with 'bad dna' are gonna have bad dna, but is the issue still there when you create a new file in a recent version?
Ahh... yes, the template files bundled with Blender would have the 'bad dna'.
checking...
Well I think that's it. I can't get it to crash anymore.
So are the template files going to have to get updated, as opening 2D Animation still crashes 32-bit?
Added subscriber: @matc
Actually I can crash x64 (
edc1b0167518-windows64
) with a file created inblender-2.80.0-git.e2102e991764-windows32
without...\Blender\2.80\config\startup.blend
and 2D animation template:blender-2.80.0-git.e2102e991764-windows32.blend
For me 32bit Blender crashes when opening the default "2D Animation". The problem seems to be that 32bit Blender somehow gets to use "Draw" where 64bit Blender is using "Draw Pencil". But "Draw" is not a grease pencil tool.
This fix allows to open "2D Animation".
When opening a 32bit .blend file in 64bit Blender one of the following errors is happening on first or second attempt to open the file.
@matc It's better a more general check:
It looks the old Draw brush has the Pinned enabled for some reason.
I'm ok with that. There is still something wrong with having the "Draw" there. Or is
ts->gp_paint
not limited to grease pencil tools? And it should be the same for 32bit and 64bit anyway.For me gpencil_settings is NULL in 32bit and 64bit.
Added subscriber: @ideasman42
@ideasman42 Could you verify if ts->gp_paint allows non Gpencil brushes?
I think I found where "Draw" is coming from.
wm_toolsystem.c:
For 64bit
brush
is "Draw Pencil" and for 32bit null.items- [x].name
is "Draw".BKE_paint_brush_set
will then setpaint->brush
to "Draw" withpaint
beingts->gp_paint
.items
isrna_enum_brush_gpencil_types_items
and only contains "Draw", "Erease" and "Fill". Maybe those need to be updated.The reason why brush is null for 32bit seems to be in
link_paint(FileData *fd, Scene *sce, Paint *p)
(readfile.c) wherep->tool_slots- [x].brush = newlibadr_us(fd, sce->id.lib, p->tool_slots- [x].brush);
fails to return a brush for 32bit.Thanks for investigating that.
This is possibly related to #63046 (Crashing loading .blend file with missing paint tool slots), if there's something broken in read/write of paint slots.
Before
newlibadr_us()
the lower 32bit ofp->tool_slots- [x].brush
are the same for 64bit and 32bit.This issue was referenced by
c0432c2385
The paint tool slots are written wrong, they should use
writestruct
instead ofwritedata
.I'll see how we can detect that case and discard paint slots then.
Changed status from 'Open' to: 'Resolved'
The startup.blend file will need to be updated as I can still crash 32-bit with invalid brushes in the 2D Animation template.
Quick repo steps:
blender-2.80.0-git.c0432c2385e6-windows32
Changed status from 'Resolved' to: 'Open'
That may be a different issue, not sure how the current code would make it crash.
It's probably the same as when @antoniov first fixed the crash: #61413#617884, just needs to be for the rest of the tools (Line, Arc, Curve ect..).
But, when loading the 2D template it still has invalid brushes.
I cannot compile now on 32bits, but I think this could fix the issue (code not tested)
This will create a new set of valid brushes and assign the first one (valid).
This fixes tool_slots with NULL brushes.
It's only looking for one slot of
scene->toolsettings->sculpt
, which should not be problem unless sculpt only recently started using tool_slots.Are there any updates?
@brecht I cannot test 32 bits version... can you confirm the diff from @matc fix the problem?
@antoniov There isn't a difference between the 32 & 64-bit's crashing (at the moment) only the invalid brushes appearing on 32-bit.
You can still crash x64 with the original given .blend:
win32_Save.blend
Once the crash is fixed, updating the "2D Animation" Application Template should make it so that it's not possible to have invalid brushes in the first place.
I tried opening all files mentioned in this thread with x86 and x64 blender (version
3f23299403
) on windows 10. Initially no file causes a crash for either version. Only the broken eraser tool can cause problems whengp_get_default_eraser
finds the broken eraser before the default eraser (gpencil_settings is NULL).Only one file showed differences between x86 and x64 (
blender-2.80.0-git.e2102e991764-windows32.blend
). Where the initially selected tools are broken for x64, but not for x86.win32_Save.blend
has for both versions the broken tools initially selected.The file
2D Animation Template x64 empty.blend
appears to have lost the grease pencil stroke object for both x86 and x64. Adding a new stroke caused no problems.The
current "2D Animation"
did not cause any problems for either version.Nice, so the template has been updated :
blender-2.80.0-git.cc600de6695a-windows32
(31 May 2019, 23:17:41)blender-2.80.0-git.8accb5a46f4a-windows32
(22 May 2019)I guess it's up to @antoniov whether to fix old .blend files, as you can't create this issue(s) from scratch anymore.
IMHO if an old file created during beta was damaged, it's not logic to waste time fixing it in code. We have too many things to do and the important point is the issue is not present, so we could close the task report.
If some very important damaged file need to be recovered, we could try to fix it manually, but not adding code in master for that.
@brecht what do you think?
The old startup.blend has the broken tools for x86, but is otherwise working. One thing I noticed is that
bmain->brushes
initially contains only valid Grease Pencil brushes with gpencil_settings. But once the broken tools are manually switched to working ones, then the brush of the broken tool (with gpencil_settings set to NULL) is added tobmain->brushes
. This does somehow only happen for Erase and Fill but not for Draw.This happens with the old startup.blend for x86 and with win32_Save.blend for x64 and x86.
If this can be avoided, then a broken .blend file could manually be fixed by opening, switching tools and saving. Otherwise the broken brushes can carry over to save files of newer versions, which would be hard to fix in versioning.
@antoniov Can you at least fix the crashing for Primitives like you did for the main Grease Pencil tools?
If there is a invalid brush, for whatever reason, I'd be more comfortable if Blender did nothing, rather then crash...
Opening up the original supplied .blend in your build should show the crash on using the Primitive tools...
I will take a look
This issue was referenced by
d46aee2982
My understanding is that with the latest code in master, the brush pointers would simply become
NULL
. If that still causes a crash, it means there is an issue in other code, because Blender code should assume that any datablock pointer can becomeNULL
on file read or after scene editsI think the problem originates in the use of
rna_Brush_gpencil_tool_items
. I guess it is using the names of annotation brushes. At leastBKE_libblock_find_name
returns a brush without gpencil_settings for "Erase". This is the brush that causes the crash I described further up. Otherwise I don't experience any crashes.wm_toolsystem.c line 254 in
toolsystem_ref_link(...)
:d46aee2982
did not solve this problemChanged status from 'Open' to: 'Resolved'
I am unable to cause a crash on the last 32-bit windows build (from builder.blender.org).
Thank you to all who helped fixing and investigating this.