Annotation test uses a PDF without annotations, while appropriate test results in segfault
Hey there, I noticed that the `test_page_annotations()` test provided in `src/pdf/page.rs` uses `test/files/dummy.pdf`. But that file does not have annotations, so of course the test passes. I have attached a test PDF I set up that should be more appropriate, I think, which I'm happy to PR into the existing test. Here it is: [annotated_paper.pdf](https://github.com/user-attachments/files/25995482/annotated_paper.pdf)
On that note, I've been running into a `STATUS_ACCESS_ERROR` for a while when using PdfPage.annotations(), and, when I used the other test PDF in its place, I got the same segfault issue:
```
cargo test
```
```
[...]
test text_page::test::test_page_to_xml ... ok
test text_page::test::test_text_page_cb_search ... ok
test text_page::test::test_text_page_search ... ok
error: test failed, to rerun pass `--lib`
Caused by:
process didn't exit successfully: `C:\Users\[...]\mupdf-rs\target\debug\deps\mupdf-dce67659a56d4a9b.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
note: test exited abnormally; to see the full output pass --no-capture to the harness.
```
This could just be a problem with my build, but I suppose updating the test is one way to find out for sure.
**Environment info** ----------------------------------------------
```
rustc -vV
```
```
rustc 1.92.0 (ded5c06cf 2025-12-08)
binary: rustc
commit-hash: ded5c06cf21d2b93bffd5d884aa6e96934ee4234
commit-date: 2025-12-08
host: x86_64-pc-windows-msvc
release: 1.92.0
LLVM version: 21.1.3
```
```
rustup show
```
```
PS C:\Users\[...]\mupdf-rs> rustup show
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\[...]\scoop\persist\rustup\.rustup
installed toolchains
--------------------
stable-x86_64-pc-windows-msvc (active, default)
active toolchain
----------------
name: stable-x86_64-pc-windows-msvc
active because: it's the default toolchain
installed targets:
x86_64-pc-windows-msvc
```
1 条评论