blueboxd / chromium-legacy

Latest Chromium (≒Chrome Canary/Stable) for Mac OS X 10.7+
BSD 3-Clause "New" or "Revised" License
302 stars 17 forks source link

Mavericks font rendering is still crashing on an extremely small number of pages. #11

Closed Wowfunhappy closed 3 years ago

Wowfunhappy commented 3 years ago

So damn close... after two days of using Chromium Legacy very heavily, I've come across exactly two websites which still cause it to crash on Mavericks. 😭

https://engineering.fb.com/ https://www.macrumors.com/

My old trick of interposing CTFontCreatePathForGlyph to always return NULL still makes the problem go away, seemingly without any side effects.

#import <Foundation/Foundation.h>

#define DYLD_INTERPOSE(_replacement,_replacee) \
__attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \
__attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee };

CGPathRef myCTFontCreatePathForGlyph(CTFontRef font, CGGlyph glyph, const CGAffineTransform *matrix) {
    return NULL;
}
DYLD_INTERPOSE(myCTFontCreatePathForGlyph, CTFontCreatePathForGlyph);
blueboxd commented 3 years ago

Oh:pensive: Both pages are not crashing on my environment again...:confounded: Do you have crash logs? SkScalerContext_Mac::generatePath should be the cause, but stack trace is also needed.

Wowfunhappy commented 3 years ago

Sorry, I should have included this in the first place.

Chromium Helper (Renderer)_2021-02-09-210957_Jonathans-Mac-Pro.crash.zip

blueboxd commented 3 years ago

Thank you! Fixed temporally (simply skipping call to CTFontCreatePathForGlyph on 10.9), so please confirm not crashing. I'll find the proper way to call CTFontCreatePathForGlyph with the latest Skia.

Wowfunhappy commented 3 years ago

Thanks, not crashing on those two sites anymore!

(Wasn't clear whether you wanted this to stay open, feel free to close.)