Comments (8)
I think this will be an upstream issue - looks like a PartitionAlloc assertion failed (probably while attempting to load the library?). It reminds me of #154, which was a PartitionAlloc permission error with Docker.
Feel free to report this upstream.
In the meantime, you could try to build pdfium from source without PartitionAlloc and craft your own pypdfium2 wheel with the resulting binary. The syslibs build is PartitionAlloc-disabled, or you could patch "pdf_use_partition_alloc": False
into the default config.
Example:
sudo apt-get install -y libfreetype-dev liblcms2-dev libjpeg-dev libopenjp2-7-dev libpng-dev zlib1g-dev libicu-dev libtiff-dev
python3 ./setupsrc/pypdfium2_setup/build_pdfium.py --use-syslibs
PDFIUM_PLATFORM="sourcebuild" python3 -m build --wheel -nx
python3 -m pip install -v dist/pypdfium2-*-py3-none-linux_x86_64.whl
pypdfium2 -v # output should include the "sourcebuild" keyword
from pypdfium2.
I cannot reproduce the issue with latest pdfium on Fedora 37, so it seems to be specific to your setup.
from pypdfium2.
BTW, theoretically this was the wrong issue template - I'd have intended you to use "PyPA install" rather than "Generic issue". But the report included all I needed to see, so nevermind.
It's a common mistake. If you have an idea how to improve the templates wording, that might be helpful.
from pypdfium2.
FATAL:partition_address_space.cc(77)
I think this is the file/line in question:
https://chromium.googlesource.com/chromium/src/base/allocator/partition_allocator/+/fc98a25dea359f8d1f15e57d9278d81da73c7a09/src/partition_alloc/partition_address_space.cc#77
from pypdfium2.
@MarkCarbonell98 Does python-test.py
pass when called directly, i.e. not through PHP?
from pypdfium2.
Pdfium binaries are now built without partitionalloc, so I'll close this issue: bblanchon/pdfium-binaries#148
It'd be nice if you could test & report back with the next release, which is scheduled for approx 2 weeks from now.
from pypdfium2.
@mara004 when executing only python-test.py
the script works. But when I call it through PHP it creates this error
from pypdfium2.
Hmm. Are you aware of any memory/allocation-related restrictions in PHP?
I experimented with your samples (calling a python script from PHP), but nothing seemed to happen: when adding prints I didn't see any output, and sleeps didn't result in a delay.
The latest pdfium-binaries release should be PartitionAlloc-free, so you could try to install pypdfium2 from source (git main), which will implicitly download the latest binary, and see if it works now.
from pypdfium2.
Related Issues (20)
- Better instructions / support for offline building HOT 21
- sourcebuild broken (version detection)
- `image.get_pos()` returns wrong values for images nested in Form XObjects HOT 6
- conda_raw: handle rebuild of same version, prevent scheduled release if not updated
- Library not available: "Cannot close object, library is destroyed..." HOT 4
- conda: consider reading pdfium-binaries version from system?
- Installation failures within a Docker container, problem with ctypesgen? HOT 3
- Parsing special characters leading to inconsistency among different machines HOT 6
- musl binary size concerns
- Buffer size mismatch when calling `get_text_range` HOT 13
- page.set_rotation() Over Rotating Some Pages
- page.render function returns an unexpected image HOT 7
- PdfDocument.get_page is non-thread-safe HOT 1
- Got different result of "pdfium_page.render()" on MacOS and Linux HOT 1
- Extracting text with special characters HOT 7
- expose more details in PdfiumError HOT 3
- Weird "PDFium: Data format error" when using pypdfium2 in Celery task. HOT 6
- The render func does not render form fields. HOT 4
- pypdfium2 on S390x (ubuntu22.04) HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypdfium2.