Project

Profile

Help

Bug #6615

closed

isEmpty crash for new empty XdmMap

Added by Christian Schmitz about 1 month ago. Updated 21 days ago.

Status:
Resolved
Priority:
Normal
Category:
SaxonC API
Start date:
2024-12-23
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

I work with Saxon C++ classes in v12.5 and while writing some code to show properties of a map, I got this crash:

If you use XdmMap default constructor and check whether it is empty, you get a java exception and app is aborted.

e.g.

XdmMap *d = new XdmMap();
bool r = d->isEmpty();

provides a:

java.lang.IllegalArgumentException: Invalid handle
    at com.oracle.svm.core.handles.ObjectHandlesImpl.doGet(ObjectHandlesImpl.java:232)
    at com.oracle.svm.core.handles.ObjectHandlesImpl.get(ObjectHandlesImpl.java:220)
    at net.sf.saxon.option.cpp.XdmUtils.j_xdmMap_isEmpty(XdmUtils.java:962)
Actions #1

Updated by O'Neil Delpratt about 1 month ago

  • Category set to SaxonC API
  • Status changed from New to In Progress
  • Assignee set to O'Neil Delpratt
  • % Done changed from 0 to 100
  • Applies to branch 12, trunk added
  • Fix Committed on Branch 12, trunk added
  • SaxonC Languages All added

Thanks for reporting this issue. This is a bug which I have now fixed. There are also related issues with other methods on the XdmMap when the map is empty which I have also fixed. Usually an XdmMap is created via the utility methods in the SaxonProcessor, but it still should not crash out when you create an XdmMap object using the default constructor.

I suspect similar problem with the XdmArray. Added unit tests and doing more testing in this area.

Actions #2

Updated by Christian Schmitz about 1 month ago

Thanks.

You can find other issues fixed in my copy of the libsaxon code. I put the changes here for you to look into:

https://github.com/MonkeybreadSoftware/libsaxon

I may also create more issues here as I have probably something like 20 things to report :-)

Actions #3

Updated by O'Neil Delpratt about 1 month ago

  • % Done changed from 100 to 50

I have made some further improvements for the XdmArray default constructor. For the empty case we now create the internal representation via Java for the empty XdmArray. Similar change required for XdmMap

Actions #4

Updated by O'Neil Delpratt 21 days ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

Changes have been made to both XdmArray and XdmMap

Please register to edit this issue

Also available in: Atom PDF