bugGNU Octave - Bugs: bug #58004, [octave-forge] (io) xmlread.m...


bug #58004: [octave-forge] (io) xmlread.m makes Octave crash

Submitted by:  Philip Nienhuis <philipnienhuis>
Submitted on:  Tue 17 Mar 2020 02:13:51 PM UTC  
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  None Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  Open
Release:  6.0.90 Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 17 Mar 2020 02:13:51 PM UTC, original submission:  

During the release process of io-2.6.0 (still pending) we've hit hangs and crashes related to xmlread.m.
See [*]

Steps to reproduce a crash (taken literally from Olaf's example in the mentioned thread):

octave:2> hf = figure ();
octave:3> sombrero ();
octave:4> fname = [tempname(), ".svg"];
octave:5> print (fname);
octave:6> close (hf)

and loading the needed Java classes:

octave:8> javaaddpath ("/usr/share/java/xercesImpl.jar")
octave:9> javaaddpath ("/usr/share/java/xml-apis.jar")

, I got a segfault with repeatedly executing the further demo code:

octave:10> dom = xmlread (fname);
octave:11> dom.hasChildNodes ()
ans = 1
octave:12> root_node = dom.getChildNodes ().item (0);
octave:13> while (1)
> root_node = dom.getChildNodes ().item (0);
> endwhile
fatal: caught signal Segmentation fault -- stopping myself...
make: *** [Makefile:205: run] Segmentation fault

The xmlread.m code in itself looks correct (conforms to the Javadocs), and trying the essential code parts in Matlab (r2014a) shows no errors and gives correct output. Note that Matlab ships xercesImpl and xml-apis jars into its installation. (I didn't try the while() in the example.)

Furthermore, the involved Java class libs xercesImpl.jar and xml-apis.jar are very widely used (as is Java) so it seems almost inevitable to conclude that the bug is in Octave itself.

FWIW, I've been unable to provoke the hangs or crashes on my Windows systems (Windows 7 -to be retired very soon- and Windows 10) nor on my Mageia 7 Linux systems, all with Octave-7.0.0 and Octave-6.0.0 from Feb. 17.

For the moment I plan to prepare an io package release w/o the xml functions, they can be put back once this issue has been resolved.

Panxto (creator of the xml functions) cc'd

[*] https://sourceforge.net/p/octave/package-releases/405/

Philip Nienhuis <philipnienhuis>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


   bug dependencies.

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by philipnienhuis (Submitted the item)
  • -email is unavailable- added by philipnienhuis

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-04-28 philipnienhuis Dependencies- => Depends on bugs #58266
    2020-03-25 philipnienhuis Summary(octave-forge) [io] xmlread.m makes Octave crash => [octave-forge] (io) xmlread.m makes Octave crash
    2020-03-17 philipnienhuis Carbon-Copy- => Added pantxo@users.sourceforge.net

    Back to the top

    Powered by Savane 3.5