Project

Profile

Help

Bug #6672

closed

Memory Leak in Graalvm - findJavaTZ_md

Added by O'Neil Delpratt 2 days ago. Updated 1 day ago.

Status:
Resolved
Priority:
Normal
Category:
Saxon-C Internals
Start date:
2025-01-29
Due date:
% Done:

100%

Estimated time:
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Found in version:
Fixed in version:
SaxonC Languages:
All
SaxonC Platforms:
All
SaxonC Architecture:

Description

Moving this memory leak discussion to a bug issue reported by user in the forum post: https://saxonica.plan.io/boards/4/topics/9871

Valgrind reports 14 bytes lost by the Xslt30Processor during the compile phase:

xslt = xsltProcessor->compileFromString(styleSheet);

Valgrind shows:

==4403== 14 bytes in 1 blocks are definitely lost in loss record 1 of 6
==4403==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4403==    by 0xAB8D58E: strdup (strdup.c:42)
==4403==    by 0x6A7A057: ??? (in /home/ond1/work/repository/saxondev-12/build/releases/libsaxon-EEC-linux-amd64-v12.5.0/libs/nix/libsaxon-eec-12.5.0.so)
==4403==    by 0x6A7A0E5: findJavaTZ_md (in /home/ond1/work/repository/saxondev-12/build/releases/libsaxon-EEC-linux-amd64-v12.5.0/libs/nix/libsaxon-eec-12.5.0.so)
==4403==    by 0x4E217A4: ??? (LibCHelper.java:0)
==4403==    by 0x590C209: ??? (TimeZoneSubstitutions.java:96)
==4403==    by 0x590CAB1: ??? (TimeZone.java:671)
==4403==    by 0x590BCE2: ??? (TimeZone.java:653)
==4403==    by 0x590BC54: ??? (TimeZone.java:642)
==4403==    by 0x5815C94: ??? (ZoneId.java:272)
==4403==    by 0x58098F4: ??? (Clock.java:184)
==4403==    by 0x5819224: ??? (ZonedDateTime.java:199)
==4403==    by 0x64EAD54: ??? (DateTimeValue.java:156)
==4403==    by 0x62C36CF: ??? (UseWhenFilter.java:66)
==4403==    by 0x62B5CBD: ??? (StylesheetModule.java:206)
==4403==    by 0x626ED28: ??? (Compilation.java:115)
==4403==    by 0x61F5DD2: ??? (XsltCompiler.java:971)
==4403==    by 0x60E622D: ??? (Xslt30Processor.java:550)
==4403==    by 0x4E60FB3: j_compileFromString (IsolateEnterStub.java:1)
==4403==    by 0x11E661: Xslt30Processor::compileFromString(char const*, char const*) (Xslt30Processor.cpp:330)

This is a bug against Graalvm version 22.3.1. In the Saxon Java code we make the following call:

    public static ZonedDateTime now() {
        return now(Clock.systemDefaultZone());
    }

I found a bug issue against Graalvm in the same area which seems possibly relate: https://github.com/AdoptOpenJDK/openjdk-jdk11/commit/d6cf8d14aa823b9b5958ba000bc3ceaf988e026e

Actions #1

Updated by O'Neil Delpratt 2 days ago

  • Status changed from New to In Progress

This fix is to upgrade Graalvm. Running SaxonC 12.X against GraalVM for JDK 21 Community 21.0.2 (version 23.1.6) the memory leak has gone away.

Actions #2

Updated by O'Neil Delpratt 1 day ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100
  • Fix Committed on Branch 12, trunk added

Bug fix committed and available for the the next maintenance release.

Please register to edit this issue

Also available in: Atom PDF