Closed msievers closed 1 month ago
Hi @msievers, thank you for detailed reproducer, I could reproduce the segfault. I'll look into the bug shortly
I created a fix in https://github.com/oracle/graalpython/pull/398. Since the fix only changes the patch for cffi
library, you can manually apply it already if you want. To do that you can run:
source src/main/resources/vfs/venv/bin/activate
graalpy -m pip cache remove cffi
curl -L https://files.pythonhosted.org/packages/68/ce/95b0bae7968c65473e1298efb042e10cafc7bafc14d9e4f154008241c91d/cffi-1.16.0.tar.gz | tar xz
graalpy -m autopatch_capi cffi-1.16.0
sed -i 's/&PyTuple_GET_ITEM(fargs, 0)/PySequence_Fast_ITEMS(fargs)/' cffi-1.16.0/src/c/_cffi_backend.c
curl -L https://raw.githubusercontent.com/oracle/graalpython/0d4fb3ddad881f059bcd369f597d3b9aaf35f0eb/graalpython/lib-graalpython/patches/cffi/cffi-1.16.0.patch | patch -p1 -d cffi-1.16.0
graalpy -m pip install --force-reinstall --no-deps ./cffi-1.16.0
@msimacek I can confirm that it's now working as expected, even with more complex input data as in the reproducer.
I took the invoice sample from weasyprint (https://github.com/CourtBouillon/weasyprint-samples/tree/master/invoice) and even this works now without seg fault.
Thank you very much for the quick reaction and the immediate help :pray:
I think we can close this issue then, right?
I'm glad it helped. A bot will close the issue when the PR with fix gets merged.
When trying to embed the
weasyprint
html/css to pdf python library in a Java application the application crashes with a SIGSEV on non-trivial input data. It indeed works with very simple html/css inputs.The error is
I'm using GraalVM 21.0.3 (also tried with 22.0.1) and Truffle 24.0.1.
I created a reproducer at https://github.com/msievers/graalpy-weasyprint. The README contains the basic setup steps and the application itself should be as minimal as possible.
Information about the weasyprint library can be found here:
If I can provide any other additional information please let me know.
Thanks in advance :sunflower: