Project

Profile

Help

Bug #6304

closed

Multithreaded XSLT transformations runs through with SaxonC 12.4.1 HE but then on Windows gives lengthy error "Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. "

Added by Martin Honnen 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
Python API
Start date:
2023-12-22
Due date:
% Done:

100%

Estimated time:
Found in version:
12.4.1
Fixed in version:
12.4.2
Platforms:

Description

I have tried to write a Python 3 program using SaxonC HE 12.4.1, making use of a ThreadPoolExecutor.

The programs tries to run the same transformation on all files of an input directory and writes the result to some output directory.

On both Windows and Linux the XSLT transformations seems to succeed but while the Python 3 program under Linux seems to terminate fine under Windows it then gives a length error "Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available.", see below.

I need some advice whether the Python code needs to be fixed (throw in some detach_current_thread perhaps somewhere) or whether this is an issue with SaxonC and/or GraalVM under Windows.

I have put the source code (Python, XSLT, input XMLs) in a public Github repro: https://github.com/martin-honnen/SaxonC12ThreadPoolExecutorXSLTTransformation.

I will also show the Python code inline:

import concurrent
import os
from concurrent.futures import ThreadPoolExecutor

from saxonche import PySaxonProcessor
from saxonche import PySaxonApiError

def transform(saxon_processor, xslt30_executable, file_name):
    try:
        xdm_node = saxon_processor.parse_xml(xml_file_name=f'input/{file_name}')
        xslt30_executable.set_global_context_item(xdm_item=xdm_node)
        xslt30_executable.apply_templates_returning_file(xdm_value=xdm_node, output_file=f'output/{file_name}')
        return True
    except PySaxonApiError as e:
        return e.message
    finally:
        saxon_processor.detach_current_thread
def thread_pool_test():
    with PySaxonProcessor() as saxon_processor:
        xslt30_compiler = saxon_processor.new_xslt30_processor()

        try:
            xslt30_executable = xslt30_compiler.compile_stylesheet(stylesheet_file='identity.xsl')
            with ThreadPoolExecutor(max_workers=4) as executor:
                futures = {executor.submit(transform, saxon_processor, xslt30_executable, file): file for file in os.listdir('input')}
                for future in concurrent.futures.as_completed(futures):
                    file = futures[future]
                    result = future.result()
                    if (result == True):
                        print(f'File {file} transformed successfully!')
                    else:
                        print(f'File {file} transformation failed with {result}')

        except PySaxonApiError as e:
            print(f'XSLT compilation failed: {e}')



# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    thread_pool_test()

What I have tried in Python code is

def transform(saxon_processor, xslt30_executable, file_name):
    try:
        xdm_node = saxon_processor.parse_xml(xml_file_name=f'input/{file_name}')
        xslt30_executable.set_global_context_item(xdm_item=xdm_node)
        xslt30_executable.apply_templates_returning_file(xdm_value=xdm_node, output_file=f'output/{file_name}')
        return True
    except PySaxonApiError as e:
        return e.message
    finally:
        saxon_processor.detach_current_thread

but this doesn't improve or change things, under Windows I still get the lengthy error.

Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A call from native code to Java code provid
ed the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.

Current timestamp: 1703249807822

Printing Instructions (ip=0x00007ff9a2fc23a0):
  0x00007ff9a2fc2380: 0x00 0x41 0xc7 0x87 0xfc 0x00 0x00 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x54 0x24
  0x00007ff9a2fc2390: 0x20 0x4c 0x8b 0x44 0x24 0x10 0x4c 0x8b 0x4c 0x24 0x18 0xe8 0x80 0xfc 0xff 0xff
  0x00007ff9a2fc23a0: 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc
  0x00007ff9a2fc23b0: 0x48 0x83 0xec 0x28 0x48 0x89 0x54 0x24 0x20 0x49 0x3b 0x67 0x08 0x0f 0x86 0x66

Top of stack (sp=0x000000ae421ef0c0):
  0x000000ae421ef0c0: 0x0000000000000000 0x00007ffb6852be70
  0x000000ae421ef0d0: 0x00000203b1509538 0x00000203b1000000
  0x000000ae421ef0e0: 0x00007ff9a2fb07ee 0x00007ff9a3018e64
  0x000000ae421ef0f0: 0x0000000000000000 0x00007ff9a2fb07ee
  0x000000ae421ef100: 0x00000203b05ac9cf 0x00000203b080e722
  0x000000ae421ef110: 0x00030000ffffffff 0x00007ff9a2fb0b22
  0x000000ae421ef120: 0x00000203b05aba80 0x00000203b0dc4b40
  0x000000ae421ef130: 0x00000203b0c63fa0 0x0000000000000000
  0x000000ae421ef140: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef150: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef160: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef170: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef180: 0x0000000000000000 0x41e0000000000000
  0x000000ae421ef190: 0x0000000000000000 0x8000000000000000
  0x000000ae421ef1a0: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef1b0: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef1c0: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef1d0: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef1e0: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef1f0: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef200: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef210: 0x0000000000000000 0x0000000000000000
  0x000000ae421ef220: 0x0000000000000000 0x00000203b055f3c0
  0x000000ae421ef230: 0x00000203b04f4680 0x00000203b04c0020
  0x000000ae421ef240: 0x00000203b0b768ca 0x0000000000000000
  0x000000ae421ef250: 0x0000000000000009 0x00000203b0b768ca
  0x000000ae421ef260: 0x0000000000000002 0x00000203b0be44d0
  0x000000ae421ef270: 0x0000000000000000 0x00000203b0dc2ca0
  0x000000ae421ef280: 0x00000203b0b7a3c0 0x00000203b0b7a3c0
  0x000000ae421ef290: 0x0000000000000002 0x00007ff9a3e29cad
  0x000000ae421ef2a0: 0x0000000000000000 0x0000fab650f82655
  0x000000ae421ef2b0: 0x00007ffa777bbfb0 0x00007ffb65b3401b

Top frame info:
  TotalFrameSize in CodeInfoTable 48

Threads:
  0x00000203b05c4a40 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "System-1" - 0x00000203b2c01028, daemon, stack(0x000000ae42ba0000,0x000000ae42d90000)
  0x00000203b0b7a3c0 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "System-0" - 0x00000203b2b01028, daemon, stack(0x000000ae429b0000,0x000000ae42ba0000)
  0x00000203b0bb11c0 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x00000203b1bbe6d0, daemon, stack(0x000000ae427c0000,0x000000ae429b0000)
  0x00000203b0bfa840 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "main" - 0x00000203b1bbe620, stack(0x000000ae42000000,0x000000ae421f0000)

VM thread locals for the failing thread 0x00000203b0b7a3c0:
  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)
    0x00000203b0b7a3c0: 0x00000203b1757010
  8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
  16 (4 bytes): Safepoint.safepointRequested = (int) 2147325056 (0x7ffd9480)
  20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
  24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)
    0x00000203b0b7a3d8: 0x00000203b2d00000 0x00000203b2e00000
    0x00000203b0b7a3e8: 0x00000203b2dbe288 0x0000000000000000
  56 (8 bytes): PlatformThreads.currentThread = (Object) java.lang.Thread (0x00000203b2b01028)
  64 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)
  72 (8 bytes): AccessControlContextStack = (Object) java.util.ArrayDeque (0x00000203b2b03a70)
  80 (8 bytes): ExceptionUnwind.currentException = (Object) null
  88 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom (0x00000203b2b5ebf0)
  96 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
  104 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
  112 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x00000203b2b214e8)
  120 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
  128 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  136 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  144 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
  152 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
  160 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)
    0x00000203b0b7a460: 0x0000000000000000
  168 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 1044408 (0x00000000000fefb8)
  176 (8 bytes): VMThreads.IsolateTL = (Word) 2214877724672 (0x00000203b1000000)
  184 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 496 (0x00000000000001f0)
  192 (8 bytes): VMThreads.OSThreadIdTL = (Word) 194356 (0x000000000002f734)
  200 (8 bytes): VMThreads.StackBase = (Word) 748443795456 (0x000000ae42ba0000)
  208 (8 bytes): VMThreads.StackEnd = (Word) 748441763840 (0x000000ae429b0000)
  216 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)
    0x00000203b0b7a498: 0x0000000000000000
  224 (8 bytes): VMThreads.nextTL = (Word) 2214873207232 (0x00000203b0bb11c0)
  232 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 2214872982448 (0x00000203b0b7a3b0)
  240 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
  244 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
  248 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
  252 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
  256 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
  260 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 1 (0x00000001)

No VMOperation in progress

The 15 most recent VM operation status changes (oldest first):

Counters:

Java frame anchors for the failing thread 0x00000203b0b7a3c0:
  No anchors

Stacktrace for the failing thread 0x00000203b0b7a3c0:
  SP 0x000000ae421ef0c0 IP 0x00007ff9a2fc23a0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:116)
  SP 0x000000ae421ef0c0 IP 0x00007ff9a2fc23a0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shouldNotReachHere(VMErrorSubstitutions.java:109)
  SP 0x000000ae421ef0f0 IP 0x00007ff9a3018e64  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:65)
  SP 0x000000ae421ef100 IP 0x00007ff9a2fb07ee  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.onYellowZoneMadeAvailable(StackOverflowCheckImpl.java:197)        
  SP 0x000000ae421ef120 IP 0x00007ff9a2fb0b22  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.makeYellowZoneAvailable(StackOverflowCheckImpl.java:172)
  SP 0x000000ae421ef120 IP 0x00007ff9a2fb0b22  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.throwNewStackOverflowError(StackOverflowCheckImpl.java:308)       
  SP 0x000000ae421ef2a0 IP 0x00007ff9a3e29cad  [image code] net.sf.saxon.option.cpp.SaxonCAPI.destroy(SaxonCAPI.java:354)
  SP 0x000000ae421ef2e0 IP 0x00007ff9a2f55509  [image code] com.oracle.svm.core.code.IsolateEnterStub.SaxonCAPI_destroy_af4003d90d189ca5b0d8f9b7f6f7fbc3c3e762de(IsolateEnterStub.java:0)

VM mutexes:
  mutex "mainVMOperationControlWorkQueue" is unlocked.
  mutex "referencePendingList" is unlocked.
  mutex "thread" is unlocked.

AOT compiled code is mapped at 0x00007ff9a2f01000 - 0x00007ff9a483885f

Heap settings and statistics:
  Supports isolates: true
  Heap base: 0x00000203b1000000
  Object reference size: 8
  Aligned chunk size: 1048576
  Incremental collections: 0
  Complete collections: 0

Native image heap boundaries:
  ReadOnly Primitives: 0x00000203b1101028 - 0x00000203b147a108
  ReadOnly References: 0x00000203b147a108 - 0x00000203b1756068
  ReadOnly Relocatables: 0x00000203b1757000 - 0x00000203b199aca8
  Writable Primitives: 0x00000203b199b000 - 0x00000203b1ac99d0
  Writable References: 0x00000203b1ac99d0 - 0x00000203b1f83310
  Writable Huge: 0x00000203b2000030 - 0x00000203b2072040
  ReadOnly Huge: 0x00000203b2073030 - 0x00000203b267c1d0

Heap:
  Young generation:
    Eden:
      edenSpace:
        aligned: 0/0 unaligned: 0/0
    Survivors:
      Survivor-1 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-1 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 To:
        aligned: 0/0 unaligned: 0/0
  Old generation:
    oldFromSpace:
      aligned: 0/0 unaligned: 0/0
    oldToSpace:
      aligned: 0/0 unaligned: 0/0

  Unused:
    aligned: 0/0

Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A call from native code to Java code provid
ed the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.
Actions #1

Updated by O'Neil Delpratt 4 months ago

I can confirm on my Mac the program runs without throwing the error. I will try to reproduce the problem on my Windows machine hopefully over the holiday period. It is possible Graalvm implements the threading differently on Windows.

Actions #2

Updated by Martin Honnen 4 months ago

Thanks, O'Neil.

I have the same result on two Windows machines.

Actions #3

Updated by O'Neil Delpratt 4 months ago

  • Status changed from New to In Progress

Sorry for the delay in looking into this bug issue. I can confirm on my windows 11 machine I reproduce the issue with Saxonche 12.4.1. See part of the output I get:

>python example1.py

c:\work\repositories\hg\test>python main.py
Illegal format in tzmappings file: illegal null character found at line 1, offset 47.
File sample3.xml transformed successfully!
File sample2.xml transformed successfully!
File sample4.xml transformed successfully!
File sample1.xml transformed successfully!
File sample5.xml transformed successfully!
File sample6.xml transformed successfully!
File sample7.xml transformed successfully!
Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A call from native code to Java code provided the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.

Current timestamp: 1704758723001

Printing Instructions (ip=0x00007fff3e6e2280):
  0x00007fff3e6e2260: 0x00 0x41 0xc7 0x87 0xfc 0x00 0x00 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x54 0x24
  0x00007fff3e6e2270: 0x20 0x4c 0x8b 0x44 0x24 0x10 0x4c 0x8b 0x4c 0x24 0x18 0xe8 0x80 0xfc 0xff 0xff
  0x00007fff3e6e2280: 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc
  0x00007fff3e6e2290: 0x48 0x83 0xec 0x28 0x48 0x89 0x54 0x24 0x20 0x49 0x3b 0x67 0x08 0x0f 0x86 0x66

Something must be going wrong in the multithreading of the of the JNI and Graalvm. Investigating this further.

Actions #4

Updated by O'Neil Delpratt 4 months ago

  • Tracker changed from Support to Bug
  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100
  • Found in version set to 12.4.1

Bug fixed. The detach_graalvm_thread function was removed as I wrongly thought that it was no longer needed by Graalvm. I have refactored the method back into the SaxonCGlue.c code. The patch will be available in the next maintenance release.

Actions #5

Updated by O'Neil Delpratt 3 months ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 12.4.2

Fix applied in SaxonC 12.4.2 maintenance release

Actions #6

Updated by Martin Honnen 3 months ago

The first and only Windows system I have tried SaxonCHE 12.4.2 continues to give some very lengthy error after running the threads:

PS C:\Users\marti\PycharmProjects\SaxonC12ThreadPoolExecutorXSLTTransformation> C:\Users\marti\AppData\Local\Programs\Python\Python312\python.exe .\main.py
SaxonC-HE 12.4.2 from Saxonica
File sample2.xml transformed successfully!
File sample6.xml transformed successfully!
File sample5.xml transformed successfully!
File sample4.xml transformed successfully!
File sample3.xml transformed successfully!
File sample1.xml transformed successfully!
File sample7.xml transformed successfully!
Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A call from native code to Java code provided the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.

Current timestamp: 1706216821573

Printing Instructions (ip=0x00007fff2bc022d0):
  0x00007fff2bc022b0: 0x00 0x41 0xc7 0x87 0xfc 0x00 0x00 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x54 0x24
  0x00007fff2bc022c0: 0x20 0x4c 0x8b 0x44 0x24 0x10 0x4c 0x8b 0x4c 0x24 0x18 0xe8 0x80 0xfc 0xff 0xff
  0x00007fff2bc022d0: 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc
  0x00007fff2bc022e0: 0x48 0x83 0xec 0x28 0x48 0x89 0x54 0x24 0x20 0x49 0x3b 0x67 0x08 0x0f 0x86 0x66

Top of stack (sp=0x000000d4dfbef2d0):
  0x000000d4dfbef2d0: 0x0000000000000000 0x000002792eb5f3c0
  0x000000d4dfbef2e0: 0x000002792f2f1058 0x000002792ee00000
  0x000000d4dfbef2f0: 0x00007fff2bbf073e 0x00007fff2bc58e64
  0x000000d4dfbef300: 0x0000000000000000 0x00007fff2bbf073e
  0x000000d4dfbef310: 0x000002792e9f719f 0x000002792e5be722
  0x000000d4dfbef320: 0x00030000ffffffff 0x00007fff2bbf0a72
  0x000000d4dfbef330: 0x000002792e9f6ed0 0x000002792e9e5e60
  0x000000d4dfbef340: 0x000002792e1b3480 0x0000000000000000
  0x000000d4dfbef350: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef360: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef370: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef380: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef390: 0x0000000000000000 0x41e0000000000000
  0x000000d4dfbef3a0: 0x0000000000000000 0x8000000000000000
  0x000000d4dfbef3b0: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef3c0: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef3d0: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef3e0: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef3f0: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef400: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef410: 0x0000000000000000 0x0000000000000000
  0x000000d4dfbef420: 0x0000000000000000 0xffffffffffffff00
  0x000000d4dfbef430: 0x0000000000000000 0x000002792e9ab6d0
  0x000000d4dfbef440: 0x000002792e344450 0x000002792e4b0020
  0x000000d4dfbef450: 0x000002792e93a6f4 0x0000000000000000
  0x000000d4dfbef460: 0x0000000000000009 0x000002792e93a6f4
  0x000000d4dfbef470: 0x0000000000000002 0x000002792e966450
  0x000000d4dfbef480: 0x0000000000000000 0x000002792e3b4420
  0x000000d4dfbef490: 0x000002792e413fc0 0x000002792e413fc0
  0x000000d4dfbef4a0: 0x0000000000000002 0x00007fff2ca6d5ad
  0x000000d4dfbef4b0: 0x0000000000000000 0x000040a3061bb259
  0x000000d4dfbef4c0: 0x00007fff2f13bfb0 0x00007ffffcef372b

Top frame info:
  TotalFrameSize in CodeInfoTable 48

Threads:
  0x000002792e413fc0 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "System-0" - 0x0000027930901028, daemon, stack(0x000000d4e03b0000,0x000000d4e05a0000)        
  0x000002792e937dc0 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x000002792f9a7738, daemon, stack(0x000000d4e01c0000,0x000000d4e03b0000)
  0x000002792e996180 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "main" - 0x000002792f9a7688, stack(0x000000d4dfa00000,0x000000d4dfbf0000)

VM thread locals for the failing thread 0x000002792e413fc0:
  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)
    0x000002792e413fc0: 0x000002792f53f010
  8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
  16 (4 bytes): Safepoint.safepointRequested = (int) 2147376485 (0x7ffe5d65)
  20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
  24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)
    0x000002792e413fd8: 0x0000027930a00000 0x0000027930b00000
    0x000002792e413fe8: 0x0000027930a901d8 0x0000000000000000
  56 (8 bytes): PlatformThreads.currentThread = (Object) java.lang.Thread (0x0000027930901028)
  64 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)
  72 (8 bytes): AccessControlContextStack = (Object) java.util.ArrayDeque (0x0000027930910d48)
  80 (8 bytes): ExceptionUnwind.currentException = (Object) null
  88 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom (0x0000027930947e90)
  96 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
  104 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
  112 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x0000027930901a18)
  120 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
  128 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  136 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  144 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
  152 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
  160 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)
    0x000002792e414060: 0x0000000000000000
  168 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 1042800 (0x00000000000fe970)
  176 (8 bytes): VMThreads.IsolateTL = (Word) 2719500730368 (0x000002792ee00000)
  184 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 484 (0x00000000000001e4)
  192 (8 bytes): VMThreads.OSThreadIdTL = (Word) 26756 (0x0000000000006884)
  200 (8 bytes): VMThreads.StackBase = (Word) 914297061376 (0x000000d4e05a0000)
  208 (8 bytes): VMThreads.StackEnd = (Word) 914295029760 (0x000000d4e03b0000)
  216 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)
    0x000002792e414098: 0x0000000000000000
  224 (8 bytes): VMThreads.nextTL = (Word) 2719495716288 (0x000002792e937dc0)
  232 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 2719490326448 (0x000002792e413fb0)
  240 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
  244 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
  248 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
  252 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
  256 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
  260 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 1 (0x00000001)

No VMOperation in progress

The 15 most recent VM operation status changes (oldest first):

Counters:

Java frame anchors for the failing thread 0x000002792e413fc0:
  No anchors

Stacktrace for the failing thread 0x000002792e413fc0:
  SP 0x000000d4dfbef2d0 IP 0x00007fff2bc022d0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:116)
  SP 0x000000d4dfbef2d0 IP 0x00007fff2bc022d0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shouldNotReachHere(VMErrorSubstitutions.java:109)
  SP 0x000000d4dfbef300 IP 0x00007fff2bc58e64  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:65)
  SP 0x000000d4dfbef310 IP 0x00007fff2bbf073e  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.onYellowZoneMadeAvailable(StackOverflowCheckImpl.java:197)
  SP 0x000000d4dfbef330 IP 0x00007fff2bbf0a72  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.makeYellowZoneAvailable(StackOverflowCheckImpl.java:172)
  SP 0x000000d4dfbef330 IP 0x00007fff2bbf0a72  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.throwNewStackOverflowError(StackOverflowCheckImpl.java:308)
  SP 0x000000d4dfbef4b0 IP 0x00007fff2ca6d5ad  [image code] net.sf.saxon.option.cpp.SaxonCAPI.destroy(SaxonCAPI.java:359)
  SP 0x000000d4dfbef4f0 IP 0x00007fff2bb95509  [image code] com.oracle.svm.core.code.IsolateEnterStub.SaxonCAPI_destroy_af4003d90d189ca5b0d8f9b7f6f7fbc3c3e762de(IsolateEnterStub.java:0)

VM mutexes:
  mutex "referencePendingList" is unlocked.
  mutex "mainVMOperationControlWorkQueue" is unlocked.
  mutex "thread" is unlocked.

AOT compiled code is mapped at 0x00007fff2bb41000 - 0x00007fff2d47984f

Heap settings and statistics:
  Supports isolates: true
  Heap base: 0x000002792ee00000
  Object reference size: 8
  Aligned chunk size: 1048576
  Incremental collections: 0
  Complete collections: 0

Native image heap boundaries:
  ReadOnly Primitives: 0x000002792ef01028 - 0x000002792f262b50
  ReadOnly References: 0x000002792f262b50 - 0x000002792f53ed28
  ReadOnly Relocatables: 0x000002792f53f000 - 0x000002792f783c38
  Writable Primitives: 0x000002792f784000 - 0x000002792f8b2a00
  Writable References: 0x000002792f8b2a00 - 0x000002792fd6c960
  Writable Huge: 0x000002792fe00030 - 0x000002792fe72210
  ReadOnly Huge: 0x000002792fe73030 - 0x000002793047cb60

Heap:
  Young generation:
    Eden:
      edenSpace:
        aligned: 0/0 unaligned: 0/0
    Survivors:
      Survivor-1 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-1 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 To:
        aligned: 0/0 unaligned: 0/0
  Old generation:
    oldFromSpace:
      aligned: 0/0 unaligned: 0/0
    oldToSpace:
      aligned: 0/0 unaligned: 0/0

  Unused:
    aligned: 0/0

Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A call from native code t
o Java code provided the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.

Based on this it doesn't seem to be fixed.

Will probably need until tomorrow to test on a different Windows PC.

Actions #7

Updated by Martin Honnen 3 months ago

Tried a different Windows system, this time with Python and SaxonCHE 12.4.2 in a venv environment; unfortunately similar lengthy output:

(venv) PS C:\Users\marti\PycharmProjects\SaxonC12ThreadPoolExecutorXSLTTransformation> python .\main.py
SaxonC-HE 12.4.2 from Saxonica
File sample5.xml transformed successfully!
File sample2.xml transformed successfully!
File sample4.xml transformed successfully!
File sample3.xml transformed successfully!
File sample1.xml transformed successfully!
File sample6.xml transformed successfully!
File sample7.xml transformed successfully!
Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A c
all from native code to Java code provided the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.

Current timestamp: 1706217776451

Printing Instructions (ip=0x00007ffe957822d0):
  0x00007ffe957822b0: 0x00 0x41 0xc7 0x87 0xfc 0x00 0x00 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x54 0x24
  0x00007ffe957822c0: 0x20 0x4c 0x8b 0x44 0x24 0x10 0x4c 0x8b 0x4c 0x24 0x18 0xe8 0x80 0xfc 0xff 0xff
  0x00007ffe957822d0: 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc
  0x00007ffe957822e0: 0x48 0x83 0xec 0x28 0x48 0x89 0x54 0x24 0x20 0x49 0x3b 0x67 0x08 0x0f 0x86 0x66

Top of stack (sp=0x0000008c6b5eec90):
  0x0000008c6b5eec90: 0x000001ed56592660 0x000001ed561e0078
  0x0000008c6b5eeca0: 0x000001ed572f1058 0x000001ed56e00000
  0x0000008c6b5eecb0: 0x00007ffe9577073e 0x00007ffe957d8e64
  0x0000008c6b5eecc0: 0x0000000000000000 0x00007ffe9577073e
  0x0000008c6b5eecd0: 0x00030000ffffffff 0x00007ffebe201b50
  0x0000008c6b5eece0: 0x000001ed56b6ea4f 0x00007ffe95770a72
  0x0000008c6b5eecf0: 0x000001ed56b680d0 0x000001ed56b64250
  0x0000008c6b5eed00: 0x00000a81ff46f52d 0x0000000000000000
  0x0000008c6b5eed10: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eed20: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eed30: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eed40: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eed50: 0x0000000000000000 0x41e0000000000000
  0x0000008c6b5eed60: 0x0000000000000000 0x8000000000000000
  0x0000008c6b5eed70: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eed80: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eed90: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eeda0: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eedb0: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eedc0: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eedd0: 0x0000000000000000 0x0000000000000000
  0x0000008c6b5eede0: 0x0000000000000000 0xffffffffffffff00
  0x0000008c6b5eedf0: 0x0000000000000000 0x000001ed5686b3a0
  0x0000008c6b5eee00: 0x000001ed56222a70 0x000001ed561e0020
  0x0000008c6b5eee10: 0x000001ed5686b314 0x0000000000000000
  0x0000008c6b5eee20: 0x0000000000000009 0x000001ed5686b314
  0x0000008c6b5eee30: 0x0000000000000002 0x000001ed5688c950
  0x0000008c6b5eee40: 0x0000000000000000 0x000001ed56b64bd0
  0x0000008c6b5eee50: 0x000001ed56b29ac0 0x000001ed56b29ac0
  0x0000008c6b5eee60: 0x0000000000000002 0x00007ffe965ed5ad
  0x0000008c6b5eee70: 0x00007ffebe332fe8 0x000001ed569950d0
  0x0000008c6b5eee80: 0x0000000000000008 0x00007fffac06372b

Top frame info:
  TotalFrameSize in CodeInfoTable 48

Threads:
  0x000001ed56b29ac0 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "System-0" - 0x000001ed58901028, daemon, stack(0x0000008c6bdb0000,0x0000008c6bfa0000)
  0x000001ed5683d3c0 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x000001ed579a7738, daemon, stack(0x0000008c6bbc0000,0x0000008c6bdb0000)
  0x000001ed56902f40 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "main" - 0x000001ed579a7688, stack(0x0000008c6b400000,0x0000008c6b5f0000)

VM thread locals for the failing thread 0x000001ed56b29ac0:
  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)
    0x000001ed56b29ac0: 0x000001ed5753f010
  8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
  16 (4 bytes): Safepoint.safepointRequested = (int) 2147376518 (0x7ffe5d86)
  20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
  24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)
    0x000001ed56b29ad8: 0x000001ed58a00000 0x000001ed58b00000
    0x000001ed56b29ae8: 0x000001ed58a902f8 0x0000000000000000
  56 (8 bytes): PlatformThreads.currentThread = (Object) java.lang.Thread (0x000001ed58901028)
  64 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)
  72 (8 bytes): AccessControlContextStack = (Object) java.util.ArrayDeque (0x000001ed58910d48)
  80 (8 bytes): ExceptionUnwind.currentException = (Object) null
  88 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom (0x000001ed58947e90)
  96 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
  104 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
  112 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x000001ed58901a18)
  120 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
  128 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  136 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  144 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
  152 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
  160 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)
    0x000001ed56b29b60: 0x0000000000000000
  168 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 1042800 (0x00000000000fe970)
  176 (8 bytes): VMThreads.IsolateTL = (Word) 2118876397568 (0x000001ed56e00000)
  184 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 480 (0x00000000000001e0)
  192 (8 bytes): VMThreads.OSThreadIdTL = (Word) 9828 (0x0000000000002664)
  200 (8 bytes): VMThreads.StackBase = (Word) 603106967552 (0x0000008c6bfa0000)
  208 (8 bytes): VMThreads.StackEnd = (Word) 603104935936 (0x0000008c6bdb0000)
  216 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)
    0x000001ed56b29b98: 0x0000000000000000
  224 (8 bytes): VMThreads.nextTL = (Word) 2118870356928 (0x000001ed5683d3c0)
  232 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 2118873422528 (0x000001ed56b29ac0)
  240 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
  244 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
  248 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
  252 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
  256 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
  260 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 1 (0x00000001)

No VMOperation in progress

The 15 most recent VM operation status changes (oldest first):

Counters:

Java frame anchors for the failing thread 0x000001ed56b29ac0:
  No anchors

Stacktrace for the failing thread 0x000001ed56b29ac0:
  SP 0x0000008c6b5eec90 IP 0x00007ffe957822d0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:116)
  SP 0x0000008c6b5eec90 IP 0x00007ffe957822d0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shouldNotReachHere(VMErrorSubstitutions.java:109)
  SP 0x0000008c6b5eecc0 IP 0x00007ffe957d8e64  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:65)
  SP 0x0000008c6b5eecd0 IP 0x00007ffe9577073e  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.onYellowZoneMadeAvailable(StackOverflowCheckImpl.java:197)
  SP 0x0000008c6b5eecf0 IP 0x00007ffe95770a72  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.makeYellowZoneAvailable(StackOverflowCheckImpl.java:172)
  SP 0x0000008c6b5eecf0 IP 0x00007ffe95770a72  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.throwNewStackOverflowError(StackOverflowCheckImpl.java:308)
  SP 0x0000008c6b5eee70 IP 0x00007ffe965ed5ad  [image code] net.sf.saxon.option.cpp.SaxonCAPI.destroy(SaxonCAPI.java:359)
  SP 0x0000008c6b5eeeb0 IP 0x00007ffe95715509  [image code] com.oracle.svm.core.code.IsolateEnterStub.SaxonCAPI_destroy_af4003d90d189ca5b0d8f9b7f6f7fbc3c3e762de(IsolateEnterStub.java:0)

VM mutexes:
  mutex "referencePendingList" is unlocked.
  mutex "mainVMOperationControlWorkQueue" is unlocked.
  mutex "thread" is unlocked.

AOT compiled code is mapped at 0x00007ffe956c1000 - 0x00007ffe96ff984f

Heap settings and statistics:
  Supports isolates: true
  Heap base: 0x000001ed56e00000
  Object reference size: 8
  Aligned chunk size: 1048576
  Incremental collections: 0
  Complete collections: 0

Native image heap boundaries:
  ReadOnly Primitives: 0x000001ed56f01028 - 0x000001ed57262b50
  ReadOnly References: 0x000001ed57262b50 - 0x000001ed5753ed28
  ReadOnly Relocatables: 0x000001ed5753f000 - 0x000001ed57783c38
  Writable Primitives: 0x000001ed57784000 - 0x000001ed578b2a00
  Writable References: 0x000001ed578b2a00 - 0x000001ed57d6c960
  Writable Huge: 0x000001ed57e00030 - 0x000001ed57e72210
  ReadOnly Huge: 0x000001ed57e73030 - 0x000001ed5847cb60

Heap:
  Young generation:
    Eden:
      edenSpace:
        aligned: 0/0 unaligned: 0/0
    Survivors:
      Survivor-1 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-1 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 To:
        aligned: 0/0 unaligned: 0/0
  Old generation:
    oldFromSpace:
      aligned: 0/0 unaligned: 0/0
    oldToSpace:
      aligned: 0/0 unaligned: 0/0

  Unused:
    aligned: 0/0

Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A c
all from native code to Java code provided the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.
Actions #8

Updated by Martin Honnen 3 months ago

I have tried the SaxonCHE 12.4.2 release from PyPi on a third Windows machine and it also gives that lengthy error message.

But: somewhere before the official release I also pulled a Windows build from Norm's (not so) secret Github build actions repo and interestingly enough this doesn't seem to have the bug, it simply runs the threads and terminates without those errors about yellow zone/stack space.

So, what happened between that intermediary build from a few days ago and the final release? Any chance some patch for this bug got unintentionally pulled or omitted?

Actions #9

Updated by O'Neil Delpratt 3 months ago

  • Status changed from Closed to In Progress

Hi Martin, Is it possible for you can try SaxonCEE please as a data point?

I tried your sample with SaxonCEE and it runs fine, but with SaxonCHE 12.4.2 it fails for me.

Actions #10

Updated by Martin Honnen 3 months ago

I kind of get the same lengthy yellow zone/thread problem output with SaxonCEE 12.4.2 under Windows as well:

(.venv) PS C:\Users\marti\PycharmProjects\SaxonCEE1224ThreadPoolExecutorXSLTTransformation> python .\main.py
SaxonC-EE 12.4.2 from Saxonica
File sample4.xml transformed successfully!
File sample1.xml transformed successfully!
File sample2.xml transformed successfully!
File sample3.xml transformed successfully!
File sample5.xml transformed successfully!
File sample6.xml transformed successfully!
File sample7.xml transformed successfully!
Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A call from native code t
o Java code provided the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.

Current timestamp: 1706264332956

Printing Instructions (ip=0x00007ff8ae57d300):
  0x00007ff8ae57d2e0: 0x00 0x41 0xc7 0x87 0xfc 0x00 0x00 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x54 0x24
  0x00007ff8ae57d2f0: 0x20 0x4c 0x8b 0x44 0x24 0x10 0x4c 0x8b 0x4c 0x24 0x18 0xe8 0x80 0xfc 0xff 0xff
  0x00007ff8ae57d300: 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc
  0x00007ff8ae57d310: 0x48 0x83 0xec 0x28 0x48 0x89 0x54 0x24 0x20 0x49 0x3b 0x67 0x08 0x0f 0x86 0x66

Top of stack (sp=0x0000007f8b7eee10):
  0x0000007f8b7eee10: 0x0000000000000000 0x00007ff9ab80be70
  0x0000007f8b7eee20: 0x000002770b679b40 0x0000027709f00000
  0x0000007f8b7eee30: 0x00007ff8ae56afde 0x00007ff8ae5d44e4
  0x0000007f8b7eee40: 0x0000000000000000 0x00007ff8ae56afde
  0x0000007f8b7eee50: 0x00000277094cf36f 0x000002770972e722
  0x0000007f8b7eee60: 0x00030000ffffffff 0x00007ff8ae56b312
  0x0000007f8b7eee70: 0x00000277094ceb00 0x00000277094cd700
  0x0000007f8b7eee80: 0x00000277094d2280 0x0000000000000000
  0x0000007f8b7eee90: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eeea0: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eeeb0: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eeec0: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eeed0: 0x0000000000000000 0x41e0000000000000
  0x0000007f8b7eeee0: 0x0000000000000000 0x8000000000000000
  0x0000007f8b7eeef0: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eef00: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eef10: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eef20: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eef30: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eef40: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eef50: 0x0000000000000000 0x0000000000000000
  0x0000007f8b7eef60: 0x0000000000000000 0xffffffffffffff00
  0x0000007f8b7eef70: 0x0000000000000000 0x0000027709b32730
  0x0000007f8b7eef80: 0x0000027709424630 0x0000027709600020
  0x0000007f8b7eef90: 0x0000027709aabb08 0x0000000000000000
  0x0000007f8b7eefa0: 0x0000000000000009 0x0000027709aabb08
  0x0000007f8b7eefb0: 0x0000000000000002 0x0000027709aee730
  0x0000007f8b7eefc0: 0x0000000000000000 0x0000027709cd3020
  0x0000007f8b7eefd0: 0x0000027709427880 0x0000027709427880
  0x0000007f8b7eefe0: 0x0000000000000002 0x00007ff8af92312d
  0x0000007f8b7eeff0: 0x0000000000000000 0x0000fc1754b9625d
  0x0000007f8b7ef000: 0x00007ff8e596bfb0 0x00007ff9a907372b

Top frame info:
  TotalFrameSize in CodeInfoTable 48

Threads:
  0x0000027709b6e000 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "System-1" - 0x000002770d801028, daemon, stack(0x0000007f8c1a0000,0x0000007f8c390000)
  0x0000027709427880 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "System-0" - 0x000002770d701028, daemon, stack(0x0000007f8bfb0000,0x0000007f8c1a0000)        
  0x00000277094f9600 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x000002770bf277f8, daemon, stack(0x0000007f8bdc0000,0x0000007f8bfb0000)
  0x0000027709b22b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "main" - 0x000002770bf27748, stack(0x0000007f8b600000,0x0000007f8b7f0000)

VM thread locals for the failing thread 0x0000027709427880:
  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)
    0x0000027709427880: 0x000002770b976010
  8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
  16 (4 bytes): Safepoint.safepointRequested = (int) 2147398126 (0x7ffeb1ee)
  20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
  24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)
    0x0000027709427898: 0x000002770d900000 0x000002770da00000
    0x00000277094278a8: 0x000002770d926fa8 0x0000000000000000
  56 (8 bytes): PlatformThreads.currentThread = (Object) java.lang.Thread (0x000002770d701028)
  64 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)
  72 (8 bytes): AccessControlContextStack = (Object) java.util.ArrayDeque (0x000002770d710a68)
  80 (8 bytes): ExceptionUnwind.currentException = (Object) null
  88 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom (0x000002770d747d18)
  96 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
  104 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
  112 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x000002770d701a28)
  120 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
  128 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  136 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  144 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
  152 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
  160 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)
    0x0000027709427920: 0x0000000000000000
  168 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 1038960 (0x00000000000fda70)
  176 (8 bytes): VMThreads.IsolateTL = (Word) 2710291087360 (0x0000027709f00000)
  184 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 500 (0x00000000000001f4)
  192 (8 bytes): VMThreads.OSThreadIdTL = (Word) 35896 (0x0000000000008c38)
  200 (8 bytes): VMThreads.StackBase = (Word) 547811360768 (0x0000007f8c1a0000)
  208 (8 bytes): VMThreads.StackEnd = (Word) 547809329152 (0x0000007f8bfb0000)
  216 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)
    0x0000027709427958: 0x0000000000000000
  224 (8 bytes): VMThreads.nextTL = (Word) 2710280574464 (0x00000277094f9600)
  232 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 2710279714912 (0x0000027709427860)
  240 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
  244 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
  248 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
  252 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
  256 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
  260 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 1 (0x00000001)

No VMOperation in progress

The 15 most recent VM operation status changes (oldest first):

Counters:

Java frame anchors for the failing thread 0x0000027709427880:
  No anchors

Stacktrace for the failing thread 0x0000027709427880:
  SP 0x0000007f8b7eee10 IP 0x00007ff8ae57d300  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:116)
  SP 0x0000007f8b7eee10 IP 0x00007ff8ae57d300  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shouldNotReachHere(VMErrorSubstitutions.java:109)
  SP 0x0000007f8b7eee40 IP 0x00007ff8ae5d44e4  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:65)
  SP 0x0000007f8b7eee50 IP 0x00007ff8ae56afde  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.onYellowZoneMadeAvailable(StackOverflowCheckImpl.java:197)
  SP 0x0000007f8b7eee70 IP 0x00007ff8ae56b312  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.makeYellowZoneAvailable(StackOverflowCheckImpl.java:172)
  SP 0x0000007f8b7eee70 IP 0x00007ff8ae56b312  [image code] com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.throwNewStackOverflowError(StackOverflowCheckImpl.java:308)
  SP 0x0000007f8b7eeff0 IP 0x00007ff8af92312d  [image code] net.sf.saxon.option.cpp.SaxonCAPI.destroy(SaxonCAPI.java:361)
  SP 0x0000007f8b7ef030 IP 0x00007ff8ae50fd49  [image code] com.oracle.svm.core.code.IsolateEnterStub.SaxonCAPI_destroy_af4003d90d189ca5b0d8f9b7f6f7fbc3c3e762de(IsolateEnterStub.java:0)

VM mutexes:
  mutex "mainVMOperationControlWorkQueue" is unlocked.
  mutex "thread" is unlocked.
  mutex "referencePendingList" is unlocked.

AOT compiled code is mapped at 0x00007ff8ae291000 - 0x00007ff8b045bf9f

Heap settings and statistics:
  Supports isolates: true
  Heap base: 0x0000027709f00000
  Object reference size: 8
  Aligned chunk size: 1048576
  Incremental collections: 0
  Complete collections: 0

Native image heap boundaries:
  ReadOnly Primitives: 0x000002770a001028 - 0x000002770b5b5cc8
  ReadOnly References: 0x000002770b5b5cc8 - 0x000002770b975248
  ReadOnly Relocatables: 0x000002770b976000 - 0x000002770bcb86d0
  Writable Primitives: 0x000002770bcb9000 - 0x000002770be08a50
  Writable References: 0x000002770be08a50 - 0x000002770c478678
  Writable Huge: 0x000002770c500030 - 0x000002770c593bb0
  ReadOnly Huge: 0x000002770c594030 - 0x000002770d1e7f98

Heap:
  Young generation:
    Eden:
      edenSpace:
        aligned: 0/0 unaligned: 0/0
    Survivors:
      Survivor-1 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-1 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 To:
        aligned: 0/0 unaligned: 0/0
  Old generation:
    oldFromSpace:
      aligned: 0/0 unaligned: 0/0
    oldToSpace:
      aligned: 0/0 unaligned: 0/0

  Unused:
    aligned: 0/0

Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A call from native code t
o Java code provided the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.
Actions #11

Updated by O'Neil Delpratt 3 months ago

Martin Honnen wrote in #note-8:

I have tried the SaxonCHE 12.4.2 release from PyPi on a third Windows machine and it also gives that lengthy error message.

But: somewhere before the official release I also pulled a Windows build from Norm's (not so) secret Github build actions repo and interestingly enough this doesn't seem to have the bug, it simply runs the threads and terminates without those errors about yellow zone/stack space.

It would be interesting to know when that was

Actions #12

Updated by Martin Honnen 3 months ago

Two days ago, the 24th, I think.

But the odd thing on further testing is that the project I created that day runs the sample fine without all the yellow zone/thread messages; however, when I now use the files from the download of that day to create a new project I get the same results as with the official release, those yellow zone/thread messages.

So I am afraid I can't clearly pinpoint which file or configuration does trigger or does avoid those messages, other than having that one project from two days ago where the messages don't occur and several other ones, including all with the official release, where the messages occur.

Rather confusing, I admit, and probably not too helpful to identify what is wrong.

What are your current results, still with the official SaxonCEE 12.4.2 result not getting the yellow zone messages but with SaxonCHE 12.4.2 you are getting them?

Actions #13

Updated by Martin Honnen 3 months ago

I have identified what avoids or causes the yellow zone message, if I write the Python code as

def transform(saxon_processor, xslt30_executable, file_name):
    try:
        xdm_node = saxon_processor.parse_xml(xml_file_name=f'input/{file_name}')
        xslt30_executable.set_global_context_item(xdm_item=xdm_node)
        xslt30_executable.apply_templates_returning_file(xdm_value=xdm_node, output_file=f'output/{file_name}')
        return True
    except PySaxonApiError as e:
        return e.message
    finally:
        saxon_processor.detach_current_thread

(in the original bug report I had tried that unsuccessfully as an alternative or as an attempt to fix the problem from the Python side) both SaxonC HE 12.4.2 and EE 12.4.2 as officially released seem to run the program cleanly, without the yellow zone messages. If that finally clause is omitted then I get (under Windows) the yellow zone messages.

That additional finally clause is also what makes the difference in the project using that intermediary SaxonC 12.4.2 build I downloaded and tested on Jan 24th.

So this looks fixed, after all, if it is the Python API user's responsibility to use saxon_processor.detach_current_thread to clean up.

Sorry about the confusion.

Actions #14

Updated by O'Neil Delpratt 3 months ago

  • Status changed from In Progress to Closed

Please register to edit this issue

Also available in: Atom PDF