Skip to content

Impossible to run the squeezing of the PDF documents from Java due to JRE fatal issue in the cPDF library #1

@nickImbirev

Description

@nickImbirev

I'm playing with the library right now with one of my test experiments, but I keep bumping my head into this issue:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f5349ca431a, pid=14, tid=121
#
# JRE version: OpenJDK Runtime Environment (17.0.2+8) (build 17.0.2+8-86)
# Java VM: OpenJDK 64-Bit Server VM (17.0.2+8-86, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C  [libcpdf.so+0x2f831a]  caml_alloc_minor_tables+0x7a

The code which I have integrated so far is very simple (following the examples from the project documentation):

        CompletableFuture.runAsync(
                        () -> {
                            Jcpdf pdfCompressor = new Jcpdf();
                            try {
                                pdfCompressor.startup();
                            } catch (Exception e) {
                                throw new RuntimeException(e);
                            }
                            try (var pdfContent = pdfCompressor.fromFile(file.toString(), emptyPassword)) {
                                pdfCompressor.squeezeInMemory(pdfContent);
                                pdfCompressor.toFile(pdfContent, file.toString(), false, false);
                            } catch (Exception e) {
                                throw new RuntimeException(e);
                            }
                        },
                        executorService)
                .join();

I would expect the library to work nicely in the concurrent environment, because unfortunately it is a blocker for me.

Please, let me know, if you need any further details

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions