PDFNetJava Segfault

Product: PDFNet SDK

Product Version: Current

Attempting to construct a date

val doc = new PDFDoc()
doc.getDocInfo.setCreationDate(com.pdftron.pdf.Date.__Create(1L))

Causes a segfault and JVM crash

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000002c80428c4, pid=60727, tid=93699
#
# JRE version: OpenJDK Runtime Environment (17.0.1+12) (build 17.0.1+12-39)
# Java VM: OpenJDK 64-Bit Server VM (17.0.1+12-39, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# C  [libPDFNetC.dylib+0x12d28c4]  Java_com_pdftron_sdf_UndoManager_TakeSnapshot+0xdca434
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:Forums:

It looks like you are using an internal function that takes in a raw pointer from native unmanaged memory.

Please use this Date constructor.

Or if you just want the current time, use the following.

Date now = new Date();
now.setCurrentTime();

It looks like you are using an internal function that takes in a raw pointer from native unmanaged memory.

Nothing that takes in a raw pointer from native unmanaged memory should be Public to an SDK user.