bugGNU Octave - Bugs: bug #61911, testsuite segfaults on Debian armel

 
 

bug #61911: testsuite segfaults on Debian armel

Submitter:  Sébastien Villemot <svillemot>
Submitted:  Mon 24 Jan 2022 05:11:53 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 7.0.92 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 12 Apr 2022 12:43:06 PM UTC, comment #24: 

I'm assuming this no longer occurs with the tarball for the 7.1.0 release. If it still occurs, please comment and we'll re-open.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Sat 26 Mar 2022 09:26:04 PM UTC, comment #23: 

Compile with default flags on Debian armel chroot
5fa3d8f0dcb3+ (stable) w/ test for bug 35881 is out, "make check" goes through:


Failure Summary:

  libinterp/corefcn/conv2.cc-tst ................................. pass   48/51
                                                    (reported bug) XFAIL   3
  libinterp/corefcn/data.cc-tst .................................. pass 1204/1211
                                                                   FAIL    1
                                                    (reported bug) XFAIL   6
  libinterp/corefcn/dlmread.cc-tst ............................... pass    9/11
                                                                   FAIL    1
                                                              REGRESSION   1
  libinterp/corefcn/file-io.cc-tst ............................... pass   97/98
                                                    (reported bug) XFAIL   1
  libinterp/corefcn/gsvd.cc-tst .................................. pass   43/46
                                                    (reported bug) XFAIL   3
  libinterp/corefcn/mappers.cc-tst ............................... pass  418/420
                                                                   FAIL    2
  libinterp/corefcn/max.cc-tst ................................... pass  111/114
                                                    (reported bug) XFAIL   3
  libinterp/corefcn/pr-output.cc-tst ............................. pass   12/13
                                                    (reported bug) XFAIL   1
  libinterp/octave-value/ov-java.cc-tst .......................... pass   14/15
                                                    (reported bug) XFAIL   1
  libinterp/parse-tree/pt-tm-const.cc-tst ........................ pass  202/203
                                                    (reported bug) XFAIL   1
  ode/ode15i.m ................................................... pass   47/48
                                                                   FAIL    1

 ................................................... pass   38/40
                                                                   FAIL    2
  plot/draw/isosurface.m ......................................... pass   29/30
                                                    (reported bug) XFAIL   1
  specfun/gammainc.m ............................................. pass   87/88
                                                    (reported bug) XFAIL   1
  testfun/test.m ................................................. pass   56/57
                                                    (reported bug) XFAIL   1
  bug-35881/bug-35881.tst ........................................ pass    0/1
                                                              REGRESSION   1
  bug-49379/bug-49379.tst ........................................ pass    0/1
                                                    (reported bug) XFAIL   1
  classdef/classdef.tst .......................................... pass   34/37
                                                    (reported bug) XFAIL   3
  fcn-handle/bug-51567.tst ....................................... pass    0/2
                                                    (reported bug) XFAIL   2

Summary:

  PASS                            17059
  FAIL                                7
  REGRESSION                          2
  XFAIL (reported bug)               28
  SKIP (missing feature)            105
  SKIP (run-time condition)          52


Failure details:


test libinterp/corefcn/data.cc-tst

***** assert (single (NA ("double")), NA ("single"))
!!!!! test failed
ASSERT errors for:  assert (single (NA ("double")),NA ("single"))

  Location  |  Observed  |  Expected  |  Reason
     ()          NaN           NA        'NA' mismatch

test libinterp/corefcn/dlmread.cc-tst
!!!!! test failed
ASSERT errors for:  assert (dlmread (file),[1, NA, 3])

  Location  |  Observed  |  Expected  |  Reason
    (2)           0            NA        'NA' mismatch

test libinterp/corefcn/mappers.cc-tst

***** assert (isna (single (NA)))

!!!!! test failed
assert (isna (single (NA))) failed


test  ode/ode15i.m
[IDA ERROR]  IDASolve
  At t = 0, the linear solver setup failed unrecoverably.

***** testif HAVE_SUNDIALS_SUNLINSOL_KLU
 opt = odeset ("Jacobian", @jacfunsparse, "AbsTol", 1e-7, "RelTol", 1e-7);
 [t, y] = ode15i (@rob, [0, 100], [1; 0; 0], [-1e-4; 1e-4; 0], opt);
 assert ([t(end), y(end,:)], fref, 1e-3);
!!!!! test failed
IDASolve failed
test ode/ode15s.m

[IDA ERROR]  IDASolve
  At t = 0, the linear solver setup failed unrecoverably.

***** testif HAVE_SUNDIALS_SUNLINSOL_KLU
 opt = odeset ("MStateDependence", "none",
               "Mass", sparse ([1, 0, 0; 0, 1, 0; 0, 0, 0]),
               "Jacobian", @jacfunsparse);
 [t, y] = ode15s (@rob, [0, 100], [1; 0; 0], opt);
 assert ([t(end), y(end,:)], frefrob, 1e-3);
!!!!! test failed
IDASolve failed


Dmitri.
--



Dmitri A. Sergatskov <dasergatskov>
Fri 25 Mar 2022 08:36:58 PM UTC, comment #22: 

If I split the failing make doc command:


/bin/bash run-octave -disable-asan --norc --silent --no-history --path ../doc/interpreter --eval "genpropdoc ('legend');" > doc/interpreter/plot-legendproperties.texi-t
/usr/local/src/octave/gcc_asan/libtool: line 4739: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
/usr/local/src/octave/gcc_asan/libtool: line 4739: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
/usr/local/src/octave/gcc_asan/libtool: line 4739: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
warning: using the gnuplot graphics toolkit is discouraged

The gnuplot graphics toolkit is not actively maintained and has a number
of limitations that are unlikely to be fixed.  Communication with gnuplot
uses a one-directional pipe and limited information is passed back to the
Octave interpreter so most changes made interactively in the plot window
will not be reflected in the graphics properties managed by Octave.  For
example, if the plot window is closed with a mouse click, Octave will not
be notified and will not update its internal list of open figure windows.
The qt toolkit is recommended instead.

mv doc/interpreter/plot-legendproperties.texi-t doc/interpreter/plot-legendproperties.texi


then it seems to work. It looks to me a race problem:
attempt to renamed the file before it's been written on disk.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 25 Mar 2022 07:59:59 PM UTC, comment #21: 

I tried to build hg id 5fa3d8f0dcb3 (stable) on
sid chroot armel (with debugs and asan flags)

First it failed building docs:


make[2]: Entering directory '/usr/local/src/octave/gcc_asan'
rm -f doc/interpreter/plot-legendproperties.texi-t doc/interpreter/plot-legendproperties.texi && /bin/bash run-octave -disable-asan --norc --silent --no-history --path ../doc/interpreter --eval "genpropdoc ('legend');" > doc/interpreter/plot-legendproperties.texi-t && mv doc/interpreter/plot-legendproperties.texi-t doc/interpreter/plot-legendproperties.texi
/usr/local/src/octave/gcc_asan/libtool: line 4739: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
/usr/local/src/octave/gcc_asan/libtool: line 4739: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
/usr/local/src/octave/gcc_asan/libtool: line 4739: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
make[2]: *** [Makefile:31037: doc/interpreter/plot-legendproperties.texi] Error 1
make[2]: Leaving directory '/usr/local/src/octave/gcc_asan'
make[1]: *** [Makefile:27443: all-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/octave/gcc_asan'
make: *** [Makefile:10848: all] Error 2


Then it  fails during make check:


make[4]: Entering directory '/usr/local/src/octave/gcc_asan/test'
  GEN      mex/.octave-dirstamp
  MKMEXFILE      mex/bug_54096.mex
  MKMEXFILE      mex/bug_51725.mex
  MKMEXFILE      mex/mexnumtst.mex
/usr/local/src/octave/gcc_asan/libtool: line 4739: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
/usr/local/src/octave/gcc_asan/libtool: line 4739: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
/usr/local/src/octave/gcc_asan/libtool: line 4739: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory

Integrated test scripts:

  liboctave/array/Array.cc-tst ...................................=================================================================
==377012==ERROR: AddressSanitizer: stack-use-after-scope on address 0xffc092b4 at pc 0xf74ef6bc bp 0xffc0928c sp 0xffc08e60
WRITE of size 12 at 0xffc092b4 thread T0
    #0 0xf74ef6b8 in __interceptor_sigaltstack ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:9986
    #1 0xf7555548 in __asan::PlatformUnpoisonStacks() ../../../../src/libsanitizer/asan/asan_posix.cpp:44
    #2 0xf755aa84 in __asan_handle_no_return ../../../../src/libsanitizer/asan/asan_rtl.cpp:612
    #3 0xf5f6dcb8 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3842
    #4 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #5 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #6 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #7 0xf5f6a9c8 in octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) ../libinterp/parse-tree/pt-eval.cc:3512
    #8 0xf5c7fc74 in octave_user_function::execute(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:495
    #9 0xf5c7fae4 in octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:488
    #10 0xf5fd7ebc in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-idx.cc:408
    #11 0xf5f51f28 in octave::tree_evaluator::eval_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, int&, int) ../libinterp/parse-tree/pt-eval.cc:1052
    #12 0xf5f52c78 in octave::tree_evaluator::eval(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) ../libinterp/parse-tree/pt-eval.cc:1111
    #13 0xf69b5c50 in octave::interpreter::eval(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) ../libinterp/corefcn/interpreter.cc:1502
    #14 0xf5ec42a4 in octave::Feval(octave::interpreter&, octave_value_list const&, int) ../libinterp/parse-tree/oct-parse.yy:6432
    #15 0xf5a2c8b0 in octave_builtin::execute(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-builtin.cc:65
    #16 0xf5b4afcc in octave_function::call(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-fcn.cc:57
    #17 0xf5fd7ebc in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-idx.cc:408
    #18 0xf5fdf2e0 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-idx.h:108
    #19 0xf5f6d330 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3781
    #20 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #21 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #22 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #23 0xf5f6f100 in octave::tree_evaluator::visit_try_catch_command(octave::tree_try_catch_command&) ../libinterp/parse-tree/pt-eval.cc:3981
    #24 0xf5fbf0b8 in octave::tree_try_catch_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-except.h:84
    #25 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #26 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #27 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #28 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #29 0xf5f6c03c in octave::tree_evaluator::visit_if_command_list(octave::tree_if_command_list&) ../libinterp/parse-tree/pt-eval.cc:3629
    #30 0xf5f8ad14 in octave::tree_if_command_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:118
    #31 0xf5f6baa4 in octave::tree_evaluator::visit_if_command(octave::tree_if_command&) ../libinterp/parse-tree/pt-eval.cc:3607
    #32 0xf5ffd16c in octave::tree_if_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:151
    #33 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #34 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #35 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #36 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #37 0xf5f6c03c in octave::tree_evaluator::visit_if_command_list(octave::tree_if_command_list&) ../libinterp/parse-tree/pt-eval.cc:3629
    #38 0xf5f8ad14 in octave::tree_if_command_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:118
    #39 0xf5f6baa4 in octave::tree_evaluator::visit_if_command(octave::tree_if_command&) ../libinterp/parse-tree/pt-eval.cc:3607
    #40 0xf5ffd16c in octave::tree_if_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:151
    #41 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #42 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #43 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #44 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #45 0xf5f70aa0 in octave::tree_evaluator::visit_unwind_protect_command(octave::tree_unwind_protect_command&) ../libinterp/parse-tree/pt-eval.cc:4126
    #46 0xf5fbf1b4 in octave::tree_unwind_protect_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-except.h:151
    #47 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #48 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #49 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #50 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #51 0xf5f8f2a4 in void octave::tree_evaluator::execute_range_loop<double>(octave::range<double, void> const&, int, octave::octave_lvalue&, octave::tree_statement_list*) ../libinterp/parse-tree/pt-eval.cc:3048
    #52 0xf5f667c8 in octave::tree_evaluator::visit_simple_for_command(octave::tree_simple_for_command&) ../libinterp/parse-tree/pt-eval.cc:3095
    #53 0xf5fea414 in octave::tree_simple_for_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-loop.h:191
    #54 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #55 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #56 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #57 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #58 0xf5f6a9c8 in octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) ../libinterp/parse-tree/pt-eval.cc:3512
    #59 0xf5c7fc74 in octave_user_function::execute(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:495
    #60 0xf5c7fae4 in octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:488
    #61 0xf5fd7ebc in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-idx.cc:408
    #62 0xf5f21f00 in octave::tree_multi_assignment::evaluate_n(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-assign.cc:201
    #63 0xf5f26bf0 in octave::tree_multi_assignment::evaluate(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-assign.h:156
    #64 0xf5f6d330 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3781
    #65 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #66 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #67 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #68 0xf5f6c03c in octave::tree_evaluator::visit_if_command_list(octave::tree_if_command_list&) ../libinterp/parse-tree/pt-eval.cc:3629
    #69 0xf5f8ad14 in octave::tree_if_command_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:118
    #70 0xf5f6baa4 in octave::tree_evaluator::visit_if_command(octave::tree_if_command&) ../libinterp/parse-tree/pt-eval.cc:3607
    #71 0xf5ffd16c in octave::tree_if_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:151
    #72 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #73 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #74 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #75 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #76 0xf5f6c03c in octave::tree_evaluator::visit_if_command_list(octave::tree_if_command_list&) ../libinterp/parse-tree/pt-eval.cc:3629
    #77 0xf5f8ad14 in octave::tree_if_command_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:118
    #78 0xf5f6baa4 in octave::tree_evaluator::visit_if_command(octave::tree_if_command&) ../libinterp/parse-tree/pt-eval.cc:3607
    #79 0xf5ffd16c in octave::tree_if_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:151
    #80 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #81 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #82 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #83 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #84 0xf5f8f2a4 in void octave::tree_evaluator::execute_range_loop<double>(octave::range<double, void> const&, int, octave::octave_lvalue&, octave::tree_statement_list*) ../libinterp/parse-tree/pt-eval.cc:3048
    #85 0xf5f667c8 in octave::tree_evaluator::visit_simple_for_command(octave::tree_simple_for_command&) ../libinterp/parse-tree/pt-eval.cc:3095
    #86 0xf5fea414 in octave::tree_simple_for_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-loop.h:191
    #87 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #88 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #89 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #90 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #91 0xf5f70aa0 in octave::tree_evaluator::visit_unwind_protect_command(octave::tree_unwind_protect_command&) ../libinterp/parse-tree/pt-eval.cc:4126
    #92 0xf5fbf1b4 in octave::tree_unwind_protect_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-except.h:151
    #93 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #94 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #95 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #96 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #97 0xf5f6a9c8 in octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) ../libinterp/parse-tree/pt-eval.cc:3512
    #98 0xf5c7fc74 in octave_user_function::execute(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:495
    #99 0xf5c7fae4 in octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:488
    #100 0xf5fd7ebc in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-idx.cc:408
    #101 0xf5f21f00 in octave::tree_multi_assignment::evaluate_n(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-assign.cc:201
    #102 0xf5f26bf0 in octave::tree_multi_assignment::evaluate(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-assign.h:156
    #103 0xf5f6d330 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3781
    #104 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #105 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #106 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #107 0xf5f6c03c in octave::tree_evaluator::visit_if_command_list(octave::tree_if_command_list&) ../libinterp/parse-tree/pt-eval.cc:3629
    #108 0xf5f8ad14 in octave::tree_if_command_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:118
    #109 0xf5f6baa4 in octave::tree_evaluator::visit_if_command(octave::tree_if_command&) ../libinterp/parse-tree/pt-eval.cc:3607
    #110 0xf5ffd16c in octave::tree_if_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:151
    #111 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #112 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #113 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #114 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #115 0xf5f8f2a4 in void octave::tree_evaluator::execute_range_loop<double>(octave::range<double, void> const&, int, octave::octave_lvalue&, octave::tree_statement_list*) ../libinterp/parse-tree/pt-eval.cc:3048
    #116 0xf5f667c8 in octave::tree_evaluator::visit_simple_for_command(octave::tree_simple_for_command&) ../libinterp/parse-tree/pt-eval.cc:3095
    #117 0xf5fea414 in octave::tree_simple_for_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-loop.h:191
    #118 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #119 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #120 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #121 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #122 0xf5f6a9c8 in octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) ../libinterp/parse-tree/pt-eval.cc:3512
    #123 0xf5c7fc74 in octave_user_function::execute(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:495
    #124 0xf5c7fae4 in octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:488
    #125 0xf5fd7ebc in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-idx.cc:408
    #126 0xf5f21f00 in octave::tree_multi_assignment::evaluate_n(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-assign.cc:201
    #127 0xf5f26bf0 in octave::tree_multi_assignment::evaluate(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-assign.h:156
    #128 0xf5f6d330 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3781
    #129 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #130 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #131 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #132 0xf5f8f2a4 in void octave::tree_evaluator::execute_range_loop<double>(octave::range<double, void> const&, int, octave::octave_lvalue&, octave::tree_statement_list*) ../libinterp/parse-tree/pt-eval.cc:3048
    #133 0xf5f667c8 in octave::tree_evaluator::visit_simple_for_command(octave::tree_simple_for_command&) ../libinterp/parse-tree/pt-eval.cc:3095
    #134 0xf5fea414 in octave::tree_simple_for_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-loop.h:191
    #135 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #136 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #137 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #138 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #139 0xf5f6f100 in octave::tree_evaluator::visit_try_catch_command(octave::tree_try_catch_command&) ../libinterp/parse-tree/pt-eval.cc:3981
    #140 0xf5fbf0b8 in octave::tree_try_catch_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-except.h:84
    #141 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #142 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #143 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #144 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #145 0xf5f70aa0 in octave::tree_evaluator::visit_unwind_protect_command(octave::tree_unwind_protect_command&) ../libinterp/parse-tree/pt-eval.cc:4126
    #146 0xf5fbf1b4 in octave::tree_unwind_protect_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-except.h:151
    #147 0xf5f6cf90 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3756
    #148 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #149 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #150 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #151 0xf5f6a9c8 in octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) ../libinterp/parse-tree/pt-eval.cc:3512
    #152 0xf5c7fc74 in octave_user_function::execute(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:495
    #153 0xf5c7fae4 in octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:488
    #154 0xf5fd7ebc in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-idx.cc:408
    #155 0xf5fdf2e0 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) ../libinterp/parse-tree/pt-idx.h:108
    #156 0xf5f6d330 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3781
    #157 0xf6001a68 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #158 0xf5f6e1a4 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3866
    #159 0xf5936334 in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #160 0xf5f68d18 in octave::tree_evaluator::execute_user_script(octave_user_script&, int, octave_value_list const&) ../libinterp/parse-tree/pt-eval.cc:3366
    #161 0xf5c7a7c4 in octave_user_script::execute(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:196
    #162 0xf5c7a64c in octave_user_script::call(octave::tree_evaluator&, int, octave_value_list const&) ../libinterp/octave-value/ov-usr-fcn.cc:189
    #163 0xf5f5db50 in octave::tree_evaluator::source_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool) ../libinterp/parse-tree/pt-eval.cc:2190
    #164 0xf69b77bc in octave::interpreter::source_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool) ../libinterp/corefcn/interpreter.cc:1700
    #165 0xf5ec217c in octave::source_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool) ../libinterp/parse-tree/oct-parse.yy:6195
    #166 0xf699f064 in safe_source_file ../libinterp/corefcn/interpreter.cc:351
    #167 0xf69b4060 in octave::interpreter::execute_command_line_file() ../libinterp/corefcn/interpreter.cc:1333
    #168 0xf69a4e90 in octave::interpreter::execute() ../libinterp/corefcn/interpreter.cc:868
    #169 0xf4cc206c in octave::cli_application::execute() ../libinterp/octave.cc:425
    #170 0x412840 in main ../src/main-cli.cc:121
    #171 0xf223fe20 in __libc_start_main csu/libc-start.c:332

Address 0xffc092b4 is located in stack of thread T0
SUMMARY: AddressSanitizer: stack-use-after-scope ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:9986 in __interceptor_sigaltstack
Shadow bytes around the buggy address:
  0x3ff81200: 00 00 00 00 f8 00 00 00 00 00 f8 f8 00 00 f8 f8
  0x3ff81210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x3ff81220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x3ff81230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x3ff81240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x3ff81250: f8 f8 f8 f8 f8 f8[f8]f8 00 00 00 00 00 00 00 00
  0x3ff81260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x3ff81270: 00 00 f8 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x3ff81280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x3ff81290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x3ff812a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==377012==ABORTING
make[4]: *** [Makefile:2848: check-local] Error 1
make[4]: Leaving directory '/usr/local/src/octave/gcc_asan/test'
make[3]: *** [Makefile:2700: check-am] Error 2
make[3]: Leaving directory '/usr/local/src/octave/gcc_asan/test'
make[2]: *** [Makefile:2702: check] Error 2
make[2]: Leaving directory '/usr/local/src/octave/gcc_asan/test'
make[1]: *** [Makefile:27443: check-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/octave/gcc_asan'
make: *** [Makefile:27741: check] Error 2


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 25 Mar 2022 10:41:36 AM UTC, comment #20: 

It was with 7.0.92. I did not yet test the tip of the stable branch, I’ll see if I can give it a try.

Sébastien Villemot <svillemot>
Fri 25 Mar 2022 10:37:48 AM UTC, comment #19: 

Thanks for that info.

Is this with the tarball for 7.0.92? Or a current tip of the repository?

jwe checked in a few changes very recently (regarding potential mis-uses of "mutable"). Do those make any difference?

Markus Mützel <mmuetzel>
Group administrator
Fri 25 Mar 2022 09:55:09 AM UTC, comment #18: 

Actually I don’t really think this issue is fixed. I still get segfaults on armel and other platforms in the testsuite on Debian build daemons.

In particular, I just got on mipsel (MIPS 32-bit little endian) with ASAN+gcc a memory problem similar to what Dimitri got on ARM:


  liboctave/array/Array.cc-tst ...................................=================================================================
==7968==ERROR: AddressSanitizer: stack-use-after-scope on address 0xbec8a01c at pc 0xb6a94f57 bp 0xbec89bc0 sp 0xbec89bc8
WRITE of size 12 at 0xbec8a01c thread T0
    #0 0xb6a94f54 in __interceptor_sigaltstack ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:9986
    #1 0xb6adc738 in __asan::PlatformUnpoisonStacks() ../../../../src/libsanitizer/asan/asan_posix.cpp:44
    #2 0xb6adfeb2 in __asan_handle_no_return ../../../../src/libsanitizer/asan/asan_rtl.cpp:612
    #3 0xb5959424 in octave::tree_evaluator::visit_statement(octave::tree_statement&) libinterp/parse-tree/pt-eval.cc:3842
    #4 0xb59b8566 in octave::tree_statement::accept(octave::tree_walker&) libinterp/parse-tree/pt-stmt.h:124
    #5 0xb5959784 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) libinterp/parse-tree/pt-eval.cc:3866
    #6 0xb54f99de in octave::tree_statement_list::accept(octave::tree_walker&) libinterp/parse-tree/pt-stmt.h:201
    #7 0xb5956ff8 in octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) libinterp/parse-tree/pt-eval.cc:3512
    #8 0xb574cc0e in octave_user_function::execute(octave::tree_evaluator&, int, octave_value_list const&) libinterp/octave-value/ov-usr-fcn.cc:495
    #9 0xb574cb10 in octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) libinterp/octave-value/ov-usr-fcn.cc:488
    #10 0xb599d796 in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) libinterp/parse-tree/pt-idx.cc:408


(some more calls)


Address 0xbec8a01c is located in stack of thread T0
SUMMARY: AddressSanitizer: stack-use-after-scope ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:9986 in __interceptor_sigaltstack
Shadow bytes around the buggy address:
  0x37d913b0: f8 00 00 00 00 00 f8 f8 00 00 f8 f8 00 00 00 00
  0x37d913c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x37d913d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x37d913e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x37d913f0: 00 00 00 00 00 00 00 00 00 00 00 00 f8 f8 f8 f8
=>0x37d91400: f8 f8 f8[f8]00 00 00 00 00 00 00 00 00 00 00 00
  0x37d91410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f8 00
  0x37d91420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x37d91430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x37d91440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x37d91450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==7968==ABORTING
make[4]: *** [Makefile:2848 : check-local] Error 1


I think it’s better to reopen this issue, at least to track this specific ASAN error.

Sébastien Villemot <svillemot>
Tue 22 Mar 2022 05:16:52 PM UTC, comment #17: 

I'm not sure which change in Octave might have fixed it. But I'm glad it is no longer happening for you. (Was one of Octave's dependencies updated in the meantime?)

Closing report (with unknown status).

Markus Mützel <mmuetzel>
Group administrator
Mon 21 Mar 2022 10:59:32 AM UTC, comment #16: 

Note that this specific bug no longer happens with 7.0.92, so it can probably be closed.

There is now a different issue (see bug #62207).

Sébastien Villemot <svillemot>
Fri 28 Jan 2022 04:41:26 PM UTC, comment #15: 

All the tests that I performed were done using a Debian armel chroot, on a host system running real ARM hardware, similarly to Dmitri.

Here are the machines that were used:
- the tests mentionned in my first 3 posts were produced on an ARMv7 32-bit machine (Marvell Armada 370/XP CPU) (host running a Debian armhf system)
- my last test (ASAN with GCC & Clang) was produced on an ARMv8 64-bit machine (host running a Debian arm64 system)

Sébastien Villemot <svillemot>
Fri 28 Jan 2022 12:49:29 PM UTC, comment #14: 

I want to emphasize that there is no VM here. I am running 32-bit fp-emulated binary (armel) on 64-bit aarch64 (Cortex-A72) system.

This might be different from Sébastien's config.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 28 Jan 2022 12:23:42 PM UTC, comment #13: 

It could be. As I mentioned in comment 8 I also see
this error at exit:


octave:1> quit
error: ignoring const execution_exception& while preparing to exit


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 28 Jan 2022 07:41:30 AM UTC, comment #12: 

The last line in Octave's code is this one:
https://hg.savannah.gnu.org/hgweb/octave/file/347dbc9049d5/libinterp/parse-tree/pt-eval.cc#l3827

Is there an issue with exception handling on that platform? Or are we doing something wrong with throwing at that point?

Markus Mützel <mmuetzel>
Group administrator
Fri 28 Jan 2022 04:45:50 AM UTC, comment #11: 

I got one almost right away at liboctave/array/Sparse.cc-tst
(gcc + ASAN)


Integrated test scripts:

  liboctave/array/Array.cc-tst ................................... pass   21/21
  liboctave/array/CMatrix.cc-tst ................................. pass   11/11
  liboctave/array/CSparse.cc-tst ................................. pass   10/10
  liboctave/array/Sparse.cc-tst ..................................=================================================================
==459233==ERROR: AddressSanitizer: stack-use-after-scope on address 0xffb9db3c at pc 0xf770d6bc bp 0xffb9db14 sp 0xffb9d6e8
WRITE of size 12 at 0xffb9db3c thread T0
    #0 0xf770d6b8 in __interceptor_sigaltstack ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:9986
    #1 0xf7773548 in __asan::PlatformUnpoisonStacks() ../../../../src/libsanitizer/asan/asan_posix.cpp:44
    #2 0xf7778a84 in __asan_handle_no_return ../../../../src/libsanitizer/asan/asan_rtl.cpp:612
    #3 0xf6161a28 in octave::tree_evaluator::visit_statement(octave::tree_statement&) ../libinterp/parse-tree/pt-eval.cc:3827
    #4 0xf61f7c80 in octave::tree_statement::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:124
    #5 0xf6161f14 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) ../libinterp/parse-tree/pt-eval.cc:3851
    #6 0xf5a2628c in octave::tree_statement_list::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-stmt.h:201
    #7 0xf61629fc in octave::tree_evaluator::visit_switch_command(octave::tree_switch_command&) ../libinterp/parse-tree/pt-eval.cc:3928
    #8 0xf61f357c in octave::tree_switch_command::accept(octave::tree_walker&) ../libinterp/parse-tree/pt-select.h:279


(full log is attached Sparse_asan.txt)

And it is reproduciable 100% of few tries I had.

Dmitri.
--



(file #52767)

Dmitri A. Sergatskov <dasergatskov>
Thu 27 Jan 2022 05:52:53 PM UTC, comment #10: 

I have recompiled Octave 7.0.90 on Debian sid armel, with ASAN, and with both GCC and Clang.

I attach the results of exercising the testsuite with both compilers. In both cases, I get memory bugs, though it is not the same one across compilers and it happens much earlier with GCC.

I don’t really know what to conclude from that. If I had no issue with Clang, I would have been tempted to conclude that it’s a GCC bug, but things are not that simple.

Note that I’m not personally interested in Octave on armel, which is an inadequate platform for number crunching (since it does not have hardware floats). But since this is an architecture officially supported by Debian, as the maintainer of the Debian package, I have no choice but to investigate issues there. In the worst case, if we can’t find a solution, I will disable the testsuite at build time on Debian armel, but that’s not very satisfactory.

Also note that there are test failures with Octave 6.4.0 on Debian armel (see https://buildd.debian.org/status/fetch.php?pkg=octave&arch=armel&ver=6.4.0-2&stamp=1642375809&raw=0). But at least there is no crash with that version.


(file #52754, file #52755)

Sébastien Villemot <svillemot>
Wed 26 Jan 2022 06:49:16 AM UTC, comment #9: 

Haven't looked at the tests in svds.m or bug-35881.tst.
Could it be possible that the OOM killer is terminating the Octave process?

Markus Mützel <mmuetzel>
Group administrator
Tue 25 Jan 2022 09:21:39 PM UTC, comment #8: 

And pretty much the same with gcc (./configure without any params):


Failure Summary:

  libinterp/corefcn/conv2.cc-tst ................................. pass   48/51
                                                    (reported bug) XFAIL   3
  libinterp/corefcn/data.cc-tst .................................. pass 1204/1211
                                                                   FAIL    1
                                                    (reported bug) XFAIL   6
  libinterp/corefcn/dlmread.cc-tst ............................... pass    9/11
                                                                   FAIL    1
                                                              REGRESSION   1
  libinterp/corefcn/file-io.cc-tst ............................... pass   97/98
                                                    (reported bug) XFAIL   1
  libinterp/corefcn/gsvd.cc-tst .................................. pass   43/46
                                                    (reported bug) XFAIL   3
  libinterp/corefcn/mappers.cc-tst ............................... pass  416/418
                                                                   FAIL    2
  libinterp/corefcn/max.cc-tst ................................... pass  111/114
                                                    (reported bug) XFAIL   3
  libinterp/corefcn/pr-output.cc-tst ............................. pass   12/13
                                                    (reported bug) XFAIL   1
  libinterp/octave-value/ov-java.cc-tst .......................... pass   14/15
                                                    (reported bug) XFAIL   1
  libinterp/parse-tree/pt-tm-const.cc-tst ........................ pass  202/203
                                                    (reported bug) XFAIL   1
  ode/ode15i.m ................................................... pass   47/48
                                                                   FAIL    1
  ode/ode15s.m ................................................... pass   38/40
                                                                   FAIL    2
  plot/draw/isosurface.m ......................................... pass   29/30
                                                    (reported bug) XFAIL   1
  specfun/gammainc.m ............................................. pass   87/88
                                                    (reported bug) XFAIL   1
  testfun/test.m ................................................. pass   56/57
                                                    (reported bug) XFAIL   1
  bug-49379/bug-49379.tst ........................................ pass    0/1
                                                    (reported bug) XFAIL   1
  classdef/classdef.tst .......................................... pass   34/37
                                                    (reported bug) XFAIL   3
  fcn-handle/bug-51567.tst ....................................... pass    0/2
                                                    (reported bug) XFAIL   2

Summary:

  PASS                            17031
  FAIL                                7
  REGRESSION                          1
  XFAIL (reported bug)               28
  SKIP (missing feature)             98
  SKIP (run-time condition)          52


Also noticed:



octave:1> quit
error: ignoring const execution_exception& while preparing to exit


with both gcc and clang builds.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 25 Jan 2022 07:14:08 PM UTC, comment #7: 

I have compiled rc1 on debian sid chroot armel (on Ubuntu 21.10 as a host) with clang


../configure CC=clang CXX=clang++ CXXFLAGS="-std=c++11" LDFLAGS="-latomic"


-latomic was required, std=c++11 probably not.

It did not crash during make test though it had a few more FAILures.


Failure Summary:

  libinterp/corefcn/conv2.cc-tst ................................. pass   48/51
                                                    (reported bug) XFAIL   3
  libinterp/corefcn/data.cc-tst .................................. pass 1204/1211
                                                                   FAIL    1
                                                    (reported bug) XFAIL   6
  libinterp/corefcn/dlmread.cc-tst ............................... pass    9/11
                                                                   FAIL    1
                                                              REGRESSION   1
  libinterp/corefcn/file-io.cc-tst ............................... pass   97/98
                                                    (reported bug) XFAIL   1
  libinterp/corefcn/gsvd.cc-tst .................................. pass   43/46
                                                    (reported bug) XFAIL   3
  libinterp/corefcn/mappers.cc-tst ............................... pass  416/418
                                                                   FAIL    2
  libinterp/corefcn/max.cc-tst ................................... pass  111/114
                                                    (reported bug) XFAIL   3
  libinterp/corefcn/pr-output.cc-tst ............................. pass   12/13
                                                    (reported bug) XFAIL   1
  libinterp/octave-value/ov-java.cc-tst .......................... pass   14/15
                                                    (reported bug) XFAIL   1
  libinterp/parse-tree/pt-tm-const.cc-tst ........................ pass  202/203
                                                    (reported bug) XFAIL   1
  ode/ode15i.m ................................................... pass   47/48
                                                                   FAIL    1
  ode/ode15s.m ................................................... pass   38/40
                                                                   FAIL    2
  plot/draw/isosurface.m ......................................... pass   29/30
                                                    (reported bug) XFAIL   1
  specfun/gammainc.m ............................................. pass   87/88
                                                    (reported bug) XFAIL   1
  testfun/test.m ................................................. pass   56/57
                                                    (reported bug) XFAIL   1
  bug-49379/bug-49379.tst ........................................ pass    0/1
                                                    (reported bug) XFAIL   1
  classdef/classdef.tst .......................................... pass   34/37
                                                    (reported bug) XFAIL   3
  fcn-handle/bug-51567.tst ....................................... pass    0/2
                                                    (reported bug) XFAIL   2

Summary:

  PASS                            17031
  FAIL                                7
  REGRESSION                          1
  XFAIL (reported bug)               28
  SKIP (missing feature)             98
  SKIP (run-time condition)          52


(I get dlmread FAIL and REGRESSION on aarch64 buid).



uname -v
#17-Ubuntu SMP PREEMPT Thu Jan 13 01:27:28 UTC 2022

file src/.libs/octave-cli
src/.libs/octave-cli: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, BuildID[sha1]=4babeb227e9498c1cf1fcce2cba6d4d854b8abf9, for GNU/Linux 3.2.0, with debug_info, not stripped

clang -v
Debian clang version 13.0.1-+rc3-1~exp1
Target: arm-unknown-linux-gnueabi
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabi/11
Selected GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabi/11
Candidate multilib: .;@m32
Selected multilib: .;@m32


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 25 Jan 2022 05:15:10 PM UTC, comment #6: 


> In particular, is there an easy procedure to build Octave with ASAN?


Dmitri's reference in comment #5 is a source for how to do this.  It is quite straightforward.

Rik <rik5>
Group administrator
Tue 25 Jan 2022 03:28:26 PM UTC, comment #5: 

https://wiki.octave.org/wiki/index.php?title=Finding_Memory_Leaks

Could you compile with clang and see if problem persist?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 25 Jan 2022 03:10:19 PM UTC, comment #4: 

commentaire #3 :

> Question #1: Does RC1 pass on other 32-bit platforms or is it all 32-bit CPUs which have an issue?


Yes, RC1 passes on other 32-bit platforms: armhf (ARM v7 with hardware float) and i386 (x86)

> Question #2: Does ARM v5 pass with 64-bit builds?


I don’t think there is such a think as ARM v5 64-bit. But RC1 passes on ARM v8 64-bit.

> Question #3: Do you have interactive access to an ARM v5 32-bit without hardware float machine?  It would be useful to know if just running octave and trying "test svds" causes a segfault or whether it is only when run as part of the test suite.


I’ve tried to reproduce the problem on a machine to which I have access, and I indeed got a segfault, but a bit later (in bug-35881/bug-35881.tst).

The backtrace shows that it happens at libinterp/parse-tree/pt-idx.cc:123: the pointer to be freed is invalid.

Of course at this point it’s impossible to rule out a memory corruption happening before, or a problem in the toolchain (gcc, binutils, libc).

I can try to extract more information as requested. In particular, is there an easy procedure to build Octave with ASAN?

Alternatively, you can try to reproduce it yourself, if you have access to real ARM hardware; it does not need to be as old as ARMv5: it can be a more recent ARM machine running any Linux flavour, in which you install a Debian sid armel chroot.

Sébastien Villemot <svillemot>
Mon 24 Jan 2022 09:41:07 PM UTC, comment #3: 

Question #1: Does RC1 pass on other 32-bit platforms or is it all 32-bit CPUs which have an issue?

Question #2: Does ARM v5 pass with 64-bit builds?

Question #3: Do you have interactive access to an ARM v5 32-bit without hardware float machine?  It would be useful to know if just running octave and trying "test svds" causes a segfault or whether it is only when run as part of the test suite.

Rik <rik5>
Group administrator
Mon 24 Jan 2022 08:22:09 PM UTC, comment #2: 

This is precisely a build with reference BLAS.

Sébastien Villemot <svillemot>
Mon 24 Jan 2022 08:18:36 PM UTC, comment #1: 

The issue most likely is due to bad openblas. Try to re-run the test preloading reference blas.

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Mon 24 Jan 2022 05:11:53 PM UTC, original submission:  

Hi,

Octave 7.0.90 segfaults during its testsuite on the Debian armel port (i.e. ARM v5 32-bit without hardware float). The segfault apparently happens during the test for sparse/svds.m.

See the log at:
https://buildd.debian.org/status/fetch.php?pkg=octave&arch=armel&ver=7.0.90-1&stamp=1642532707&raw=0

If you devs don’t haccess to such a machine, I can try to get a backtrace.

Best,

Sébastien

Sébastien Villemot <svillemot>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #52767:  Sparse_asan.txt.gz added by dasergatskov (3KiB - application/gzip)
file #52754:  gcc-asan.txt added by svillemot (38KiB - text/plain)
file #52755:  clang-asan.txt added by svillemot (135KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by svillemot (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
    2022-04-12 mmuetzel StatusNone Fixed
        Open/ClosedOpen Closed
    2022-03-25 mmuetzel Open/ClosedClosed Open
        Release7.0.90 7.0.92
    2022-03-22 mmuetzel Open/ClosedOpen Closed
    2022-01-28 dasergatskov Attached File- Added Sparse_asan.txt.gz, #52767
    2022-01-27 svillemot Attached File- Added gcc-asan.txt, #52754
        Attached File- Added clang-asan.txt, #52755
    2022-01-25 rik5 CategoryNone Interpreter

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code