google / google/oss-fuzz

pikepdf build failure - __sanitizer_annotate_double_ended_contiguous_container missing from dependent

Open
#12,839 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
12.6k
Forks
2.9k
Avg merge
2d 2h
Merged PRs (30d)
62

Description

It is not clear to me if this issue needs to be fixed in pikepdf or oss-fuzz, so I am cross-listing it.

pikepdf depends on the recent versions of libqpdf, so libqpdf is compiled in its fuzzing [build.sh](https://github.com/pikepdf/pikepdf/blob/main/fuzzing/build.sh).

The error messages appears to be saying `libqpdf.so.29` was compiled incorrectly due to an undefined symbol undefined symbol: `__sanitizer_annotate_double_ended_contiguous_container`, which seems to be injected by the sanitizer framework, so pikepdf's `_core.$platform.so` fails to import into Python. Or perhaps the library libqpdf needs to be built with `-lfuzzer`

```
BAD BUILD: /tmp/not-out/tmphzs6jfxi/pikepdf_fuzzer seems to have either startup crash or exit:
sysctl: setting key "vm.mmap_rnd_bits", ignoring: Read-only file system
/tmp/not-out/tmphzs6jfxi/pikepdf_fuzzer -rss_limit_mb=2560 -timeout=25 -seed=1337 -runs=4 < /dev/null
INFO: Instrumenting pikepdf
WARNING: It looks like this module is imported by a custom loader. Atheris has experimental support for this. However, it may be incompatible with certain libraries. If you experience unusual errors or poor coverage collection, try atheris.instrument_all() instead, add enable_loader_override=False to instrument_imports(), or file an issue on GitHub.
INFO: Instrumenting pikepdf._version
Traceback (most recent call last):
File "pikepdf/__init__.py", line 10, in
ImportError: /tmp/_MEISdchpn/libqpdf.so.29: undefined symbol: __sanitizer_annotate_double_ended_contiguous_container

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "pikepdf_fuzzer.py", line 12, in
File "PyInstaller/loader/pyimod02_importers.py", line 378, in exec_module
File "pikepdf/__init__.py", line 13, in
ImportError: pikepdf's extension library failed to import
[PYI-162:ERROR] Failed to execute script 'pikepdf_fuzzer' due to unhandled exception!

ERROR: 100.0% of fuzz targets seem to be broken. See the list above for a detailed information.
```

Contributor guide

Open the contributing guide

Research direction

Start with fuzzing/build.sh and the failing pikepdf_fuzzer startup output; reproduce the OSS-Fuzz build and inspect how libqpdf.so.29 is linked and loaded. Compare the pikepdf and oss-fuzz integration points to identify the responsible project. Done means the fuzz target starts without the undefined sanitizer symbol or import failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python, shell
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.