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

Segmentation fault at page.to_display_list() #60

Closed
c4ys opened this issue Feb 16, 2023 · 4 comments
Closed

Segmentation fault at page.to_display_list() #60

c4ys opened this issue Feb 16, 2023 · 4 comments

Comments

@c4ys
Copy link

c4ys commented Feb 16, 2023

mupdf相对pdfium以及xpdf一个优势是对多核渲染的支持,
在实际使用mupdf-rs过程中发现部分文件 page.to_display_list()发生Segmentation fault且没有提示,
使用官方mupdf和C++编译的mutool则不会发生错误.

@messense
Copy link
Owner

Please provide a minimal reproduction code.

@c4ys
Copy link
Author

c4ys commented Feb 16, 2023

    let doc = PdfDocument::open(path.as_str()).unwrap();
    let num_pages = doc.page_count().unwrap();
    println!("Document has {} page(s)", num_pages);

    let display_list: Vec<(usize, DisplayList)> = doc
        .pages()
        .unwrap()
        .enumerate()
        .map(|(index, p)| {
            let display = p.unwrap().to_display_list(true).unwrap();
            (index, display)
        })
        .collect();

file: https://c4ys.com/wp-content/uploads/2023/02/p11.pdf

@c4ys
Copy link
Author

c4ys commented Feb 24, 2023

上次是用mutool,
今天试了下用官方多线程也成功了.

https://github.com/ArtifexSoftware/mupdf/blob/master/docs/examples/multi-threaded.c

接下来我有空将mupdf-rs改写下看是否能成功.

@messense
Copy link
Owner

Fixed in #61

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

2 participants