Code Monkey home page Code Monkey logo

Comments (8)

mara004 avatar mara004 commented on June 23, 2024

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.

mara004 avatar mara004 commented on June 23, 2024

I cannot reproduce the issue with latest pdfium on Fedora 37, so it seems to be specific to your setup.

from pypdfium2.

mara004 avatar mara004 commented on June 23, 2024

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.

mara004 avatar mara004 commented on June 23, 2024

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.

mara004 avatar mara004 commented on June 23, 2024

@MarkCarbonell98 Does python-test.py pass when called directly, i.e. not through PHP?

from pypdfium2.

mara004 avatar mara004 commented on June 23, 2024

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.

MarkCarbonell98 avatar MarkCarbonell98 commented on June 23, 2024

@mara004 when executing only python-test.py the script works. But when I call it through PHP it creates this error

from pypdfium2.

mara004 avatar mara004 commented on June 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.