Font thumbnails crash to desktop #67117

Closed
opened 2019-07-17 12:42:19 +02:00 by Patrick Wilson · 22 comments

System Information
Operating system: WINDOWS 10
Graphics card: GTX 1070

Blender Version
Broken:
2.80 Beta 4a5e046c92 2019-07-16 23:38

Worked: (optional) N/A (Issue has been around a while I do believe)

Short description of error
Scrolling though a large collection of fonts (with a weighted free rolling scroll wheel / mx master mouse) suddenly causes complete crash to desktop.

Exact steps for others to reproduce the error
create text object, change font in context menu / font panel, navigate to font folder / enable thumbnails and rapidly scroll through font list / sudden crash to desktop.

**note I have over 467 font families installed which could total many 1000's of files. Also reproduced this error on a different machine with Dual RTX 2080ti's / Windows 10 but it appeared a little more resilient, however, it eventually crashed to desktop too.

**System Information** Operating system: WINDOWS 10 Graphics card: GTX 1070 **Blender Version** Broken: 2.80 Beta 4a5e046c923f 2019-07-16 23:38 Worked: (optional) N/A (Issue has been around a while I do believe) **Short description of error** Scrolling though a large collection of fonts (with a weighted free rolling scroll wheel / mx master mouse) suddenly causes complete crash to desktop. **Exact steps for others to reproduce the error** create text object, change font in context menu / font panel, navigate to font folder / enable thumbnails and rapidly scroll through font list / sudden crash to desktop. **note I have over 467 font families installed which could total many 1000's of files. Also reproduced this error on a different machine with Dual RTX 2080ti's / Windows 10 but it appeared a little more resilient, however, it eventually crashed to desktop too.
Author

Added subscriber: @WilsonP

Added subscriber: @WilsonP

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

Do you know a place where we can actually easily download that many fonts to try and reproduce this issue?

Do you know a place where we can actually easily download that many fonts to try and reproduce this issue?
Author

That is a tricky one, I could google around for a "free" font archive but I would hate to post here and link to any shadey archive of fonts, fonts require licensing unless they are blatantly CC open etc.. Other than that finding a free font site and downloading them manually would be the other solution, time consuming though..

That is a tricky one, I could google around for a "free" font archive but I would hate to post here and link to any shadey archive of fonts, fonts require licensing unless they are blatantly CC open etc.. Other than that finding a free font site and downloading them manually would be the other solution, time consuming though..

Added subscriber: @ZedDB

Added subscriber: @ZedDB

Does it happen with duplicate files? IE if you have a font file and just copy it a 1000 times?

Does it happen with duplicate files? IE if you have a font file and just copy it a 1000 times?
Author

Great idea, just tested it by pointing blender at a folder on my desktop with 900 duplications of the font Arial and Interestingly enough there is no failure condition this time which has me thinking could I have a rogue/corrupt font on both my systems and if so doe's this mean that there is some kind of problem with Blenders thumbnail generator or some kind of font handling error checking? (wild guesses obviously)

When I get more time I will try and narrow this down to any specific fonts.

Great idea, just tested it by pointing blender at a folder on my desktop with 900 duplications of the font Arial and Interestingly enough there is no failure condition this time which has me thinking could I have a rogue/corrupt font on both my systems and if so doe's this mean that there is some kind of problem with Blenders thumbnail generator or some kind of font handling error checking? (wild guesses obviously) When I get more time I will try and narrow this down to any specific fonts.

Probably related to #62887. So if you find which font crashes, let us know.

Probably related to #62887. So if you find which font crashes, let us know.
Author

Alright, I decided to copy my entire fonts folder in alphabetical order into a new fonts folder on the desktop, tested after copying each letters worth and at the end of that process nothing at all. My entire windows/fonts folder is duplicated on my desktop and it works flawlessly.

So, I decided to delete all the fonts I had installed and so we just have the stock Windows 10 fonts left installed, again the system crashes to desktop the second I enable thumbnails. However, if I copy the fonts to another folder this problem does not occur!

I thought I would delete any font cache's in windows and see if it was anything around caching that might be causing an issue but it appeared to have no effect, still crashes.

I am currently at a loss as what I could try next, totally open to suggestions.

Alright, I decided to copy my entire fonts folder in alphabetical order into a new fonts folder on the desktop, tested after copying each letters worth and at the end of that process nothing at all. My entire windows/fonts folder is duplicated on my desktop and it works flawlessly. So, I decided to delete all the fonts I had installed and so we just have the stock Windows 10 fonts left installed, again the system crashes to desktop the second I enable thumbnails. However, if I copy the fonts to another folder this problem does not occur! I thought I would delete any font cache's in windows and see if it was anything around caching that might be causing an issue but it appeared to have no effect, still crashes. I am currently at a loss as what I could try next, totally open to suggestions.

Can you build blender yourself? In that case you should be able to run it with a debugger and get a somewhat useful crash report.

Can you build blender yourself? In that case you should be able to run it with a debugger and get a somewhat useful crash report.
Author

I shall get set up so I can build blender, I'll report back when I have some more details..

I shall get set up so I can build blender, I'll report back when I have some more details..
Author

Ok I don't want to take any ones time up unnecessarily so can somebody link or give brief instructions on what steps I need to do to some debugging? I have installed everything required to compile Blender, which I just tested and it's compiling fine from cmd line.

Ok I don't want to take any ones time up unnecessarily so can somebody link or give brief instructions on what steps I need to do to some debugging? I have installed everything required to compile Blender, which I just tested and it's compiling fine from cmd line.

I think you should just be able to run it in debug mode in visual studio. Then it should print a backtrace and show where in the code the crash triggered.

I think you should just be able to run it in debug mode in visual studio. Then it should print a backtrace and show where in the code the crash triggered.
Author

Yeah that's working fine. Ok now what info do you require there is a whole heap of stuff, I'll leave it in it's Exception Thrown state and await some instruction.

Exception thrown: read access violation.
g was nullptr. occurred

Yeah that's working fine. Ok now what info do you require there is a whole heap of stuff, I'll leave it in it's Exception Thrown state and await some instruction. Exception thrown: read access violation. **g** was nullptr. occurred
Can you post the stacktrace? https://stackoverflow.com/questions/945193/how-do-i-find-the-stack-trace-in-visual-studio
Author

Is this ok?

blender.exe!blf_kerning_cache_new(FontBLF * font) Line 99 C

blender.exe!blf_font_ensure_ascii_kerning(FontBLF * font, const unsigned int kern_mode) Line 293	C
blender.exe!blf_font_draw_buffer_ex(FontBLF * font, const unsigned char * str, unsigned __int64 len, ResultBLF * r_info, int pen_y) Line 519	C
blender.exe!blf_font_draw_buffer(FontBLF * font, const unsigned char * str, unsigned __int64 len, ResultBLF * r_info) Line 651	C
blender.exe!BLF_thumb_preview(const unsigned char * filename, const unsigned char * * draw_str, const unsigned char draw_str_lines, const float * font_color, const int font_size, unsigned char * buf, int w, int h, int channels) Line 122	C
blender.exe!IMB_thumb_load_font(const unsigned char * filename, unsigned int x, unsigned int y) Line 73	C
blender.exe!thumb_create_ex(const unsigned char * file_path, const unsigned char * uri, const unsigned char * thumb, const bool use_hash, const unsigned char * hash, const unsigned char * blen_group, const unsigned char * blen_id, ThumbSize size, ThumbSource source, ImBuf * img) Line 472	C
blender.exe!thumb_create_or_fail(const unsigned char * file_path, const unsigned char * uri, const unsigned char * thumb, const bool use_hash, const unsigned char * hash, const unsigned char * blen_group, const unsigned char * blen_id, ThumbSize size, ThumbSource source) Line 573	C
blender.exe!IMB_thumb_manage(const unsigned char * org_path, ThumbSize size, ThumbSource source) Line 734	C
blender.exe!filelist_cache_preview_runf(TaskPool * pool, void * taskdata, int UNUSED_threadid) Line 1198	C
blender.exe!task_scheduler_thread_run(void * thread_p) Line 451	C
[External Code]	
blender.exe!invoke_thread_procedure(unsigned int(*)(void *) procedure, void * const context) Line 92	C++
blender.exe!thread_start<unsigned int (__cdecl*)(void * __ptr64)>(void * const parameter) Line 115	C++
[External Code]	
Is this ok? > blender.exe!blf_kerning_cache_new(FontBLF * font) Line 99 C blender.exe!blf_font_ensure_ascii_kerning(FontBLF * font, const unsigned int kern_mode) Line 293 C blender.exe!blf_font_draw_buffer_ex(FontBLF * font, const unsigned char * str, unsigned __int64 len, ResultBLF * r_info, int pen_y) Line 519 C blender.exe!blf_font_draw_buffer(FontBLF * font, const unsigned char * str, unsigned __int64 len, ResultBLF * r_info) Line 651 C blender.exe!BLF_thumb_preview(const unsigned char * filename, const unsigned char * * draw_str, const unsigned char draw_str_lines, const float * font_color, const int font_size, unsigned char * buf, int w, int h, int channels) Line 122 C blender.exe!IMB_thumb_load_font(const unsigned char * filename, unsigned int x, unsigned int y) Line 73 C blender.exe!thumb_create_ex(const unsigned char * file_path, const unsigned char * uri, const unsigned char * thumb, const bool use_hash, const unsigned char * hash, const unsigned char * blen_group, const unsigned char * blen_id, ThumbSize size, ThumbSource source, ImBuf * img) Line 472 C blender.exe!thumb_create_or_fail(const unsigned char * file_path, const unsigned char * uri, const unsigned char * thumb, const bool use_hash, const unsigned char * hash, const unsigned char * blen_group, const unsigned char * blen_id, ThumbSize size, ThumbSource source) Line 573 C blender.exe!IMB_thumb_manage(const unsigned char * org_path, ThumbSize size, ThumbSource source) Line 734 C blender.exe!filelist_cache_preview_runf(TaskPool * pool, void * taskdata, int UNUSED_threadid) Line 1198 C blender.exe!task_scheduler_thread_run(void * thread_p) Line 451 C [External Code] blender.exe!invoke_thread_procedure(unsigned int(*)(void *) procedure, void * const context) Line 92 C++ blender.exe!thread_start<unsigned int (__cdecl*)(void * __ptr64)>(void * const parameter) Line 115 C++ [External Code]

Ok, so if you open the source/blender/blenfont/intern/blf_glyph.c file (line 99) add g && to the if statment:

      if (g && g_prev && FT_Get_Kerning(font->face, g_prev->idx, g->idx, kc->mode, &delta) == 0) {

Does it still crash when you recompile and run it again?

Ok, so if you open the `source/blender/blenfont/intern/blf_glyph.c` file (line 99) add `g &&` to the if statment: ``` if (g && g_prev && FT_Get_Kerning(font->face, g_prev->idx, g->idx, kc->mode, &delta) == 0) { ``` Does it still crash when you recompile and run it again?
Author

No crash! Working nicely now. Brill. Thanks Sebastian. So I take it your next step is to make an alteration to the code and submit that for inclusion? I have not coded for decades and that was ASM way back. This OO stuff and GIT is currently outside of my scope of understanding.

No crash! Working nicely now. Brill. Thanks Sebastian. So I take it your next step is to make an alteration to the code and submit that for inclusion? I have not coded for decades and that was ASM way back. This OO stuff and GIT is currently outside of my scope of understanding.
Sebastian Parborg self-assigned this 2019-07-24 11:22:46 +02:00

I can commit the change, no worries. Thanks for taking the time to debug this. You are now a blender developer, kinda. ;)

I can commit the change, no worries. Thanks for taking the time to debug this. You are now a blender developer, kinda. ;)

This issue was referenced by 52fb8b1e80

This issue was referenced by 52fb8b1e80ec1e76e0e3b82329042cd37be29d1e

Changed status from 'Open' to: 'Resolved'

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

Great. This was a really positive experience. Have a good one ?

Great. This was a really positive experience. Have a good one ?
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#67117
No description provided.