freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debugging Freetype Exception in PDFium WASM Build


From: O H
Subject: Debugging Freetype Exception in PDFium WASM Build
Date: Fri, 13 Sep 2024 16:48:28 -0400

Hi,

I am building a debug standalone PDFium WASM build to work outside of
browers using https://github.com/paulocoutinhox/pdfium-lib.

I made the following changes:
1. Followed the build WASM instructions
2. Patched in changes from
https://github.com/paulocoutinhox/pdfium-lib/issues/137
3. Used a debug
<https://github.com/paulocoutinhox/pdfium-lib/blob/0a2328d07e35989d387c00961af4ee6ae20315c2/modules/config.py#L78>
config
instead of "release" for building the WASM binary

I'm able to render most text but I occasionally run into the following
stacktrace but I can't tell what could cause this to fail.

I have included 2 PDFs where this fails.

wasmtime._error.WasmtimeError: error while executing at wasm backtrace:
    0: 0x648965 - pdfium.wasm!tt_face_build_cmaps
    1: 0x646826 - pdfium.wasm!sfnt_load_face
    2: 0x65bad3 - pdfium.wasm!tt_face_init
    3: 0x5a7f3e - pdfium.wasm!open_face
    4: 0x5a710c - pdfium.wasm!ft_open_face_internal
    5: 0x5a8dc8 - pdfium.wasm!FT_New_Memory_Face
    6: 0x1139c3 - pdfium.wasm!CFX_Face::New(FT_LibraryRec_*,
fxcrt::RetainPtr<fxcrt::Retainable>, pdfium::span<unsigned char const,
4294967295ul, unsigned char const*>, long)
    7: 0x1286bf -
pdfium.wasm!CFX_FontMgr::NewFixedFace(fxcrt::RetainPtr<CFX_FontMgr::FontDesc>,
pdfium::span<unsigned char const, 4294967295ul, unsigned char const*>,
unsigned long)
    8: 0x95a65 - pdfium.wasm!CFX_Font::LoadEmbedded(pdfium::span<unsigned
char const, 4294967295ul, unsigned char const*>, bool, unsigned long long)
    9: 0x94ddc1 - pdfium.wasm!CPDF_Font::LoadFontDescriptor(CPDF_Dictionary
const*)
   10: 0x96df92 - pdfium.wasm!CPDF_SimpleFont::LoadCommon()
   11: 0x96f4d0 - pdfium.wasm!CPDF_TrueTypeFont::Load()
   12: 0x94faf2 - pdfium.wasm!CPDF_Font::Create(CPDF_Document*,
fxcrt::RetainPtr<CPDF_Dictionary>, CPDF_Font::FormFactoryIface*)
   13: 0x3b1a5d -
pdfium.wasm!CPDF_DocPageData::GetFont(fxcrt::RetainPtr<CPDF_Dictionary>)
   14: 0x2badc2 -
pdfium.wasm!CPDF_StreamContentParser::FindFont(fxcrt::ByteString const&)
   15: 0x2baac8 - pdfium.wasm!CPDF_StreamContentParser::Handle_SetFont()
   16: 0x2c2d44 -
pdfium.wasm!CPDF_StreamContentParser::OnOperator(fxcrt::StringViewTemplate<char>)
   17: 0x2c7ed2 -
pdfium.wasm!CPDF_StreamContentParser::Parse(pdfium::span<unsigned char
const, 4294967295ul, unsigned char const*>, unsigned int, unsigned int,
std::__2::vector<unsigned int, std::__2::allocator<unsigned int>> const&)
   18: 0x2e0967 - pdfium.wasm!CPDF_ContentParser::Parse()
   19: 0x2df85c -
pdfium.wasm!CPDF_ContentParser::Continue(PauseIndicatorIface*)
   20: 0x2e91e6 -
pdfium.wasm!CPDF_PageObjectHolder::ContinueParse(PauseIndicatorIface*)
   21: 0x301ea7 - pdfium.wasm!CPDF_Page::ParseContent()
   22: 0x553860 - pdfium.wasm!FPDF_LoadPage

Attachment: test_a_custom.pdf
Description: Adobe PDF document

Attachment: test_a_courier.pdf
Description: Adobe PDF document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]