Project

Profile

Help

Bug #6656

closed

Multiple calls to XdmNode.getParent() leads to Invalid handle exception

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

Status:
Resolved
Priority:
Normal
Category:
SaxonC API
Start date:
2025-01-19
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

Reported by user: https://saxonica.plan.io/boards/4/topics/9868

Calling XdmNode.getParent() Then deleting the parent node Then calling XdmNode.getParent() causes crash with the following intertnal exception:

java.lang.IllegalArgumentException: Invalid handle exception
Actions #1

Updated by O'Neil Delpratt 1 day ago

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

This issue was fixed 6 months ago. Unfortunately it was after SaxonC 12.5 was released.

The fix was in the XdmNode.cpp file to avoid caching the parent node. See fix below:


XdmNode *XdmNode::getParent() {
    int64_t nodeRef =
        getParentForXdmNode(SaxonProcessor::sxn_environ->thread, (void *)value);
    if (nodeRef > SXN_UNSET) {
      return new XdmNode(nullptr, nodeRef, UNKNOWN);
    }
    return nullptr;
}
Actions #2

Updated by O'Neil Delpratt 1 day ago

  • Status changed from New to Resolved

Please register to edit this issue

Also available in: Atom PDF