Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV Error in MacOS when measuring SkParagraphs with emojis #984

Closed
marc2332 opened this issue Jun 1, 2024 · 3 comments
Closed

SIGSEGV Error in MacOS when measuring SkParagraphs with emojis #984

marc2332 opened this issue Jun 1, 2024 · 3 comments

Comments

@marc2332
Copy link
Contributor

marc2332 commented Jun 1, 2024

Hey! I was just adding some unit tests to marc2332/freya#622 and started getting some crashes only in MacOS (maybe Linux too), but definitely not in Windows. I narrowed it down to a skparagraph being measured (layout()) with emojies in the text, so:

Works:

#[test]
fn skia_not_crash_crash_macos() {
    let mut font_collection = FontCollection::new();
    font_collection.set_dynamic_font_manager(FontMgr::default());
    let mut p = ParagraphBuilder::new(&ParagraphStyle::new(), font_collection);
    p.add_text("test test");
    let mut paragraph = p.build();
    paragraph.layout(200.);
}

Doesn't work:

#[test]
fn skia_crash_macos() {
    let mut font_collection = FontCollection::new();
    font_collection.set_dynamic_font_manager(FontMgr::default());
    let mut p = ParagraphBuilder::new(&ParagraphStyle::new(), font_collection);
    p.add_text("👋test test 🦀");
    let mut paragraph = p.build();
    paragraph.layout(200.);
}

image

I don't know if it's related to being executed in the CI or not as I don't have a Mac device.

Any idea?

@tronical
Copy link
Contributor

tronical commented Jun 1, 2024

I think that this might be google/skia#162 (comment)

@marc2332
Copy link
Contributor Author

marc2332 commented Jun 1, 2024

I think that this might be google/skia#162 (comment)

Whoah! Nice find Simon, that's indeed the issue. Freya's headless testing runner was not specifying a default FontMgr, I just made it do so and it worked ✨

Should I close this or it's better to leave it open until your fix has been merged and rust-skia updated the bindings?

pragmatrix added a commit to pragmatrix/rust-skia that referenced this issue Jun 1, 2024
@pragmatrix
Copy link
Member

@marc2332 Leave it open, we are shortly before the Milestone 126 update release, I'll cherry-pick Simon's patch.

pragmatrix added a commit that referenced this issue Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants