bugGNU Octave - Bugs: bug #55047, Running the test suite causes...

 
 

bug #55047: Running the test suite causes Octave to segfault on Windows

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Sun 18 Nov 2018 02:02:38 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 17 Jan 2019 04:10:36 AM UTC, comment #20: 

Oops, I forgot that mlock doesn't take a function name but must be called from inside the function you wish to lock.

Closing this report as fixed.

John W. Eaton <jwe>
Group administrator
Wed 16 Jan 2019 10:52:31 PM UTC, comment #19: 

JWE:
Your fix works, nice, thanks.

As to mlock:

>> __init_qt__
>> mlock ("__init_qt__")
warning: print_usage: Texinfo formatting filter exited abnormally
warning: called from
    print_usage at line 74 column 5
warning: print_usage: raw Texinfo source of help text follows...
error: Invalid call to mlock.  Correct usage is:


(with a cross-build from yesterday evening)

Philip Nienhuis <philipnienhuis>
Group Member
Wed 16 Jan 2019 09:33:43 PM UTC, comment #18: 

JWE wrote:

As a quick test, you can also take one of the builds you have that shows the
crash and do


__init_qt__
mlock ("__init_qt__")
__run_test_suite__


and see if that works.  It should be essentially the same as my change.

Avinoam Kalma <avinoam>
Group Member
Wed 16 Jan 2019 09:23:38 PM UTC, comment #17: 

As a quick test, you can also take one of the builds you have that shows the crash and do


__init_qt__
mlock ("__init_qt__")
__run_test_suite__
-verbatim+

and see if that works.  It should be essentially the same as my change.

John W. Eaton <jwe>
Group administrator
Wed 16 Jan 2019 08:59:15 PM UTC, comment #16: 

Thanks,
I'll give it a try. Will take some time (make dist, cross-build, install ...

Philip Nienhuis <philipnienhuis>
Group Member
Wed 16 Jan 2019 08:44:14 PM UTC, comment #15: 

My test shows that locking _init_qt_ also avoids the crash, so I pushed this changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/8953dd219f4c

John W. Eaton <jwe>
Group administrator
Wed 16 Jan 2019 05:08:23 PM UTC, comment #14: 

Philip:  For testing, I backed out the following changesets along with a few updates to account for conflicts due to other unrelated changes since these were made:

332be8be16eb
4b661d535ddb
553278e5aac7
14e844f1459a

But now I'm wondering whether we just need to mlock _init_qt_.oct when _init_qt_ is called.  We already do that for _init_gnuplot_ and _init_fltk_.

I'll try that before pushing a changeset.

See also bug #55254.

John W. Eaton <jwe>
Group administrator
Wed 16 Jan 2019 05:00:43 PM UTC, comment #13: 

@JWE: is that this one:  25931:332be8be16eb ?

According to the log that cset dates from Sep 28, while a Windows binary from Oct 14 still runs __run_test_suite__ fine.
Depends a bit on when that cset was actually pushed.
I tested another binary from Sep 30, it doesn't segfault on __run_test_suite__ either.

But maybe there's some other magic involved.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 16 Jan 2019 04:39:31 PM UTC, comment #12: 

It looks like dynamically loading the Qt graphics code on Windows is the problem.  I should have a changeset ready sometime later today.

John W. Eaton <jwe>
Group administrator
Wed 16 Jan 2019 03:23:07 PM UTC, comment #11: 

@Markus comment #9:
No, sorry, I usually build Windows binaries after merging default with my local adaptations so I expect the HGID to be that of those merges. I usually do that in the evenings (Central Eur. time).
I'll try to check if I can pinpoint it a little more precisely based om m-file csets (-changes) around Nov. 14.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 16 Jan 2019 03:00:53 PM UTC, comment #10: 

A simple script which demonstrates a crash which may be related:


cd  'C:\Octave\Octave-5.0.1\mingw64\share\octave\5.0.1\etc\tests\fixed'
test bug-55308.tst
clear all
test bug-55308.tst


Avinoam Kalma <avinoam>
Group Member
Wed 16 Jan 2019 08:08:46 AM UTC, comment #9: 

@Philip: Do know know which hg id the October 14 build was based on?

Markus Mützel <mmuetzel>
Group administrator
Wed 16 Jan 2019 07:44:28 AM UTC, comment #8: 

@jwe, comment #4: This cset also causes Octave to crash (or hang, I don't remember) when building the doc on Mac OS (see http://octave.1599824.n4.nabble.com/building-on-macOS-td4689952.html). So if you think it is possible to back it out until we understand what is going wrong, then it would probably be good to do that.

Pantxo Diribarne <pantxo>
Group Member
Tue 15 Jan 2019 09:25:18 PM UTC, comment #7: 

Based on my archive of Windows binaries, all I can see is that the change happened between Oct 14 (still good) and Oct 25 (segfaults).

IIRC the long interval between these builds is due to a vacation :-)

Philip Nienhuis <philipnienhuis>
Group Member
Tue 15 Jan 2019 06:20:56 PM UTC, comment #6: 

The 2 fails are because I am using fltk:

getframe: figure must be visible or qt toolkit must be used with __gl_window__ property 'on' or QT_OFFSCREEN feature available


I also see the same regression on Linux. So all in all: Everything looks good (apart from this crash).

Markus Mützel <mmuetzel>
Group administrator
Tue 15 Jan 2019 06:17:39 PM UTC, comment #5: 

To be honest, I am just guessing as to what is causing the crash.
But it looks like this might "solve" the issue. Running the test suite with fltk does NOT segfault for me:

graphics_toolkit fltk
__run_test_suite__


(I see 2 fails and 1 regression.)

Markus Mützel <mmuetzel>
Group administrator
Tue 15 Jan 2019 05:53:39 PM UTC, comment #4: 

Markus, thanks for doing the bisecting.

Ah, so I'd bet that the first bad changeset is the one in which I made Octave dynamically load the qt graphics toolkit.  If undoing that change does fix the problem, then maybe I should just remove it for the release?

John W. Eaton <jwe>
Group administrator
Sun 13 Jan 2019 07:15:49 PM UTC, comment #3: 

Octave is still crashing at the fixed tests for me with hg id 8c3e727c44b5.

Is this a blocker for Octave 5?

What can I do to help solve this?

Attached is the backtrace with gdb of that segmentation fault. The top of that backtrace:

Thread 15 received signal SIGSEGV, Segmentation fault.
0x000000000d6a294a in graphics_toolkit::initialize (go=..., this=0x471157f8)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/corefcn/graphics-toolkit.h:210
210     /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/corefcn/graphics-toolkit.h: No such file or directory.
(gdb) bt
#0  0x000000000d6a294a in graphics_toolkit::initialize (go=..., this=0x471157f8)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/corefcn/graphics-toolkit.h:210
#1  base_graphics_object::initialize (this=0x7edfe300, go=...) at libinterp/corefcn/graphics.h:2866
#2  0x000000000d342061 in graphics_object::initialize (this=0x47115870) at libinterp/corefcn/graphics.h:3093
#3  xinitialize (h=...)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/corefcn/graphics.cc:3055
#4  0x000000000d3d6b8f in F__go_figure__ (args=...)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/corefcn/graphics.cc:12652
#5  0x000000000d0981cf in octave_builtin::call (this=0x461587b0, tw=..., nargout=1, args=...)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/octave-value/ov-builtin.cc:65
#6  0x000000000d1a721a in octave::tree_evaluator::visit_index_expression (this=0x448fd128, idx_expr=...)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-eval.cc:2008
#7  0x000000000d6ec716 in octave::tree_evaluator::evaluate (this=0x448fd128, expr=0x46e17e90, nargout=<optimized out>)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-eval.h:312
#8  0x000000000d1a8842 in octave::tree_evaluator::visit_simple_assignment (this=0x448fd128, expr=...)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-eval.cc:2681
#9  0x000000000d6ec716 in octave::tree_evaluator::evaluate (this=0x448fd128, expr=0x4b130070, nargout=<optimized out>)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-eval.h:312
#10 0x000000000d1a3e70 in octave::tree_evaluator::visit_statement (this=0x448fd128, stmt=...)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-eval.cc:2776
#11 0x000000000d1994eb in octave::tree_statement::accept (tw=..., this=0x4b12f230)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-stmt.h:119
#12 octave::tree_evaluator::visit_statement_list (this=0x448fd128, lst=...)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-eval.cc:2845
#13 0x000000000d1a3e0b in octave::tree_evaluator::visit_statement (this=0x448fd128, stmt=...)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-eval.cc:2754
#14 0x000000000d1994eb in octave::tree_statement::accept (tw=..., this=0x4b130f30)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-stmt.h:119
#15 octave::tree_evaluator::visit_statement_list (this=0x448fd128, lst=...)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-eval.cc:2845
#16 0x000000000d1a5b6a in octave::tree_statement_list::accept (tw=..., this=0x4b0075f0)
    at /home/osboxes/Documents/Repositories/Octave/mxe-octave-3/tmp-default-octave/octave-6.0.0/libinterp/parse-tree/pt-stmt.h:194


So together with the window of changesets, this could be an issue with how we initialize the qt graphics toolkit.

The last test appearing in the command window is that for bug #55308.

(file #45956)

Markus Mützel <mmuetzel>
Group administrator
Fri 30 Nov 2018 10:08:56 PM UTC, comment #2: 

Just as a info point, if I change runtestsuit to run the fixed tests before the integrated tests, it does not crash.

John Donoghue <lostbard>
Group Member
Sun 18 Nov 2018 05:00:16 PM UTC, comment #1: 

On my 64-bit Windows 7 Professional box and Windows 7 Enterprise box at work, _run_test_suite_ segfaults in the fixed tests section, and fntests.log always ends with the colormap test.

Insofar it is consistent on just my boxes and ends elsewhere on other people's boxes I can't say. What might matter there is that I have several binary patches in my cross-builds (h5read, uitable, matrix right division, shortcut keys for variable editor).

The individual tests run fine (cd-ing to the fixed test dir and running them one by one (using "test <blabla>.tst").
I also tried running just the fixed tests:
_run_test_suite ({}, {'/path/to/fixed/tests'}, {})
and also then I saw no segfault.
Echo of screen messages attached.
Because of that I didn't pay much attention, but I agree with Markus that _run_test_suite_ shouldn't end in a segfault.

Maybe the amount of tests, or amount of some type(s) of tests, induces oversaturation of Octave's resources somewhere?


(file #45482)

Philip Nienhuis <philipnienhuis>
Group Member
Sun 18 Nov 2018 02:02:38 PM UTC, original submission:  

When executing "__run_test_suite__" with Octave from the default branch on Windows causes it to crash with a segmentation fault. See the attached backtraces.
The crash happens at the fixed tests towards the end of the test suite at different tests that seem to be unrelated. But the backtraces look similar.

The last version that completes the test suite without crashing is hg id a0079f6f8c4 with 466c405ee09b and ac0b3c09c3db grafted on top.
I am having trouble cross-compiling a lot of the sub-sequent nodes for Windows. The next version I managed to cross-compile is hg id 14e844f1459a. That version already shows the segfault.

So this leaves a window of ~25 changesets starting with:

Changeset:
25931 (332be8be16eb) dynamically load qt graphics …
User:
John W. Eaton <jwe@octave.org>
Date:
2018-09-28 18:18:09 -0400 (7 weeks)


And ending with:

Changeset:
25959 (14e844f1459a) fix linking of __init_qt__.la on Windows systems (bug #54881) …
User:
John W. Eaton <jwe@octave.org>
Date:
2018-10-23 16:53:04 -0400 (3 weeks)


Markus Mützel <mmuetzel>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45956:  gdb_log_8c3e727c44b5.log added by mmuetzel (37KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by mmuetzel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-17 jwe StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2019-01-16 jwe StatusConfirmed Ready For Test
    2019-01-13 mmuetzel Attached File- Added gdb_log_8c3e727c44b5.log, #45956
    2018-11-18 philipnienhuis Carbon-Copy- Added philipnienhuis
    2018-11-18 philipnienhuis StatusNone Confirmed
    2018-11-18 philipnienhuis Attached File- Added one_single_and_fixed_tests_bug_55047.txt, #45482
    2018-11-18 mmuetzel Attached File- Added gdb_log_e5acf1d94d33.txt, #45477
        Attached File- Added gdb_log_e142769913f8.txt, #45478

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code