bugGNU Octave - Bugs: bug #66471, polymorphic allocator memory issues

 
 

bug #66471: polymorphic allocator memory issues

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Thu 21 Nov 2024 03:10:34 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 29 Nov 2024 10:18:43 PM UTC, comment #8: 

After path/PKG_ADD fix, pmr issue is still here. Here is the latest trace (now is with clang-19.1.3):

$ LSAN_OPTIONS="leak_check_at_exit=0" ASAN_OPTIONS="detect_odr_violation=0" octave-cli -qf
octave:1> pkg load stk
octave:2> __stk_sampling_vdc_rr2__ (2,1)

ans = <2x1 stk_dataframe array>

=================================================================
==605768==ERROR: AddressSanitizer: heap-use-after-free on address 0x5020004d5a30 at pc 0x0000004cac97 bp 0x7ffdf5adebc0 sp 0x7ffdf5ade380
READ of size 16 at 0x5020004d5a30 thread T0
    #0 0x0000004cac96 in __asan_memmove (/usr/local/bin/octave-cli-10.0.0+0x4cac96) (BuildId: 4814b5fa123a6d58662b82b860b878e4090fcf7c)
    #1 0x7f704be63012 in double* std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<double const, double>(double const*, double const*, double*) /opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_algobase.h:452:6
    #2 0x7f704be62fc4 in double* std::__copy_move_a2<false, double const*, double*>(double const*, double const*, double*) /opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_algobase.h:520:14
    #3 0x7f704be62e64 in double* std::__copy_move_a1<false, double const*, double*>(double const*, double const*, double*) /opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_algobase.h:548:14
    #4 0x7f704c27fd54 in double* std::__copy_move_a<false, double const*, double*>(double const*, double const*, double*) /opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_algobase.h:556:3
    #5 0x7f704c27fc49 in double* std::copy<double const*, double*>(double const*, double const*, double*) /opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_algobase.h:650:14
    #6 0x7f7048eb7aef in double* std::__copy_n<double const*, long, double*>(double const*, long, double*, std::random_access_iterator_tag) /opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_algo.h:683:14
    #7 0x7f7048eb7124 in double* std::copy_n<double const*, long, double*>(double const*, long, double*) /opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_algo.h:715:14
    #8 0x7f7048eb9bee in long octave::idx_vector::index<double>(double const*, long, double*) const /home/dima/src/dev/octave/clang_asan/../liboctave/array/idx-vector.h:595:9
    #9 0x7f7048ebab7f in Array<double, std::pmr::polymorphic_allocator<double>>::index(octave::idx_vector const&, octave::idx_vector const&) const /home/dima/src/dev/octave/clang_asan/../liboctave/array/Array-base.cc:822:18
    #10 0x7f7048ebeae2 in Array<double, std::pmr::polymorphic_allocator<double>>::index(octave::idx_vector const&, octave::idx_vector const&, bool, double const&) const /home/dima/src/dev/octave/clang_asan/../liboctave/array/Array-base.cc:1100:14
    #11 0x7f704b693a00 in Array<double, std::pmr::polymorphic_allocator<double>>::index(octave::idx_vector const&, octave::idx_vector const&, bool) const /home/dima/src/dev/octave/clang_asan/../liboctave/array/Array.h:731:12
    #12 0x7f704b6574fa in octave_base_matrix<NDArray>::do_index_op(octave_value_list const&, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-base-mat.cc:204:37
    #13 0x7f704b6560fd in octave_base_matrix<NDArray>::subsref(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::list<octave_value_list, std::allocator<octave_value_list>> const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-base-mat.cc:77:16
    #14 0x7f704b65657b in octave_base_matrix<NDArray>::subsref(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::list<octave_value_list, std::allocator<octave_value_list>> const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-base-mat.h:103:12
    #15 0x7f704b8edc6c in octave_value::subsref(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::list<octave_value_list, std::allocator<octave_value_list>> const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov.cc:1459:17
    #16 0x7f704baff23a in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.cc:654:38
    #17 0x7f704bb04975 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.h:105:32
    #18 0x7f704bab68bb in octave::tree_evaluator::convert_to_const_vector(octave::tree_argument_list*) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:2368:31
    #19 0x7f704bafd922 in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.cc:450:31
    #20 0x7f704bb04975 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.h:105:32
    #21 0x7f704ba7e69f in octave::tree_simple_assignment::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-assign.cc:97:41
    #22 0x7f704ba9aad4 in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4072:47
    #23 0x7f704bb1f30a in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #24 0x7f704ba9b656 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4157:16
    #25 0x7f704b51e7fa in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #26 0x7f704ba971e5 in octave::tree_evaluator::visit_simple_for_command(octave::tree_simple_for_command&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3275:20
    #27 0x7f704bb0d15a in octave::tree_simple_for_command::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-loop.h:154:8
    #28 0x7f704ba9a7ba in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4047:20
    #29 0x7f704bb1f30a in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #30 0x7f704ba9b656 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4157:16
    #31 0x7f704b51e7fa in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #32 0x7f704ba994d3 in octave::tree_evaluator::visit_if_command_list(octave::tree_if_command_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3920:23
    #33 0x7f704bae850a in octave::tree_if_command_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-select.h:139:8
    #34 0x7f704ba9912e in octave::tree_evaluator::visit_if_command(octave::tree_if_command&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3898:10
    #35 0x7f704bb1b8aa in octave::tree_if_command::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-select.h:168:8
    #36 0x7f704ba9a7ba in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4047:20
    #37 0x7f704bb1f30a in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #38 0x7f704ba9b656 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4157:16
    #39 0x7f704b51e7fa in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #40 0x7f704bac094d in octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3798:19
    #41 0x7f704b8cc0e5 in octave_user_function::execute(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-usr-fcn.cc:569:13
    #42 0x7f704b8cbf32 in octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-usr-fcn.cc:562:10
    #43 0x7f704bafdd13 in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.cc:470:33
    #44 0x7f704bb04975 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.h:105:32
    #45 0x7f704ba7e69f in octave::tree_simple_assignment::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-assign.cc:97:41
    #46 0x7f704ba9aad4 in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4072:47
    #47 0x7f704bb1f30a in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #48 0x7f704ba9b656 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4157:16
    #49 0x7f704b51e7fa in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #50 0x7f704ba994d3 in octave::tree_evaluator::visit_if_command_list(octave::tree_if_command_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3920:23
    #51 0x7f704bae850a in octave::tree_if_command_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-select.h:139:8
    #52 0x7f704ba9912e in octave::tree_evaluator::visit_if_command(octave::tree_if_command&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3898:10
    #53 0x7f704bb1b8aa in octave::tree_if_command::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-select.h:168:8
    #54 0x7f704ba9a7ba in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4047:20
    #55 0x7f704bb1f30a in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #56 0x7f704ba9b656 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4157:16
    #57 0x7f704b51e7fa in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #58 0x7f704bac094d in octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3798:19
    #59 0x7f704b8cc0e5 in octave_user_function::execute(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-usr-fcn.cc:569:13
    #60 0x7f704b8cbf32 in octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-usr-fcn.cc:562:10
    #61 0x7f704bafdd13 in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.cc:470:33
    #62 0x7f704bb04975 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.h:105:32
    #63 0x7f704ba7e69f in octave::tree_simple_assignment::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-assign.cc:97:41
    #64 0x7f704ba9aad4 in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4072:47
    #65 0x7f704bb1f30a in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #66 0x7f704ba9b656 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4157:16
    #67 0x7f704b51e7fa in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #68 0x7f704bac094d in octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3798:19
    #69 0x7f704b8cc0e5 in octave_user_function::execute(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-usr-fcn.cc:569:13
    #70 0x7f704b8cbf32 in octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-usr-fcn.cc:562:10
    #71 0x7f704bafdd13 in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.cc:470:33
    #72 0x7f704bb04975 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.h:105:32
    #73 0x7f704ba9aad4 in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4072:47
    #74 0x7f704bb1f30a in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #75 0x7f704ba9b656 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4157:16
    #76 0x7f704b51e7fa in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #77 0x7f704bac094d in octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3798:19
    #78 0x7f704b8cc0e5 in octave_user_function::execute(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-usr-fcn.cc:569:13
    #79 0x7f704b8cbf32 in octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-usr-fcn.cc:562:10
    #80 0x7f704c330303 in octave::interpreter::feval(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1577:14
    #81 0x7f704c32ef0c in octave::interpreter::feval(char const*, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1562:10
    #82 0x7f704baa673b in octave::tree_evaluator::bind_ans(octave_value const&, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4577:29
    #83 0x7f704ba9acb2 in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4084:21
    #84 0x7f704bb1f30a in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #85 0x7f704ba9b656 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4157:16
    #86 0x7f704b51e7fa in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #87 0x7f704baa16d6 in octave::tree_evaluator::eval(std::shared_ptr<octave::tree_statement_list>&, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:1000:18
    #88 0x7f704baa3d83 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #89 0x7f704c32ed9f in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #90 0x7f704c32bd78 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #91 0x7f704abf2e75 in octave::cli_application::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/octave.cc:443:23
    #92 0x000000510cd1 in main /home/dima/src/dev/octave/clang_asan/../src/main-cli.cc:150:17
    #93 0x7f7046a295cf in __libc_start_call_main (/lib64/libc.so.6+0x295cf) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)
    #94 0x7f7046a2967f in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2967f) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)
    #95 0x00000042c524 in _start (/usr/local/bin/octave-cli-10.0.0+0x42c524) (BuildId: 4814b5fa123a6d58662b82b860b878e4090fcf7c)

0x5020004d5a30 is located 0 bytes inside of 16-byte region [0x5020004d5a30,0x5020004d5a40)
freed by thread T0 here:
    #0 0x0000004cc77a in free (/usr/local/bin/octave-cli-10.0.0+0x4cc77a) (BuildId: 4814b5fa123a6d58662b82b860b878e4090fcf7c)
    #1 0x7f704c46b154 in xfree(void*) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:108:3
    #2 0x7f704c46db9c in mex::free(void*) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3341:11
    #3 0x7f704c46d9cb in mxFree(void*) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3372:18
    #4 0x7f704c47f1c5 in mxArray_base_full::~mxArray_base_full() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:1610:5
    #5 0x7f704c488f10 in mxArray_separate_full::~mxArray_separate_full() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:2144:3
    #6 0x7f704c488f48 in mxArray_separate_full::~mxArray_separate_full() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:2142:3
    #7 0x7f704c46e1a3 in mxArray::~mxArray() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3095:3
    #8 0x7f704c46ea3b in mex::~mex() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3243:7
    #9 0x7f704c46fb73 in octave::call_mex(octave_mex_function&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3529:1
    #10 0x7f704babe6c5 in octave::tree_evaluator::execute_mex_function(octave_mex_function&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3596:12
    #11 0x7f704b8595d5 in octave_mex_function::execute(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-mex-fcn.cc:97:13
    #12 0x7f704b7cc50c in octave_function::call(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-fcn.cc:74:10
    #13 0x7f704bafdd13 in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.cc:470:33
    #14 0x7f704bb04975 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.h:105:32
    #15 0x7f704ba9aad4 in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4072:47
    #16 0x7f704bb1f30a in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #17 0x7f704ba9b656 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4157:16
    #18 0x7f704b51e7fa in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #19 0x7f704baa16d6 in octave::tree_evaluator::eval(std::shared_ptr<octave::tree_statement_list>&, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:1000:18
    #20 0x7f704baa3d83 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #21 0x7f704c32ed9f in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #22 0x7f704c32bd78 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #23 0x7f704abf2e75 in octave::cli_application::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/octave.cc:443:23
    #24 0x000000510cd1 in main /home/dima/src/dev/octave/clang_asan/../src/main-cli.cc:150:17
    #25 0x7f7046a295cf in __libc_start_call_main (/lib64/libc.so.6+0x295cf) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)

previously allocated by thread T0 here:
    #0 0x0000004cca13 in malloc (/usr/local/bin/octave-cli-10.0.0+0x4cca13) (BuildId: 4814b5fa123a6d58662b82b860b878e4090fcf7c)
    #1 0x7f704c46b124 in xmalloc(unsigned long) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:79:15
    #2 0x7f704c46ef00 in mex::malloc_unmarked(unsigned long) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3278:15
    #3 0x7f704c4933d5 in mex::calloc_unmarked(unsigned long, unsigned long) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.h:716:17
    #4 0x7f704c46d923 in mxArray::calloc(unsigned long, unsigned long) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3386:37
    #5 0x7f704c46e6da in mxArray::alloc(bool, unsigned long, unsigned long) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3392:17
    #6 0x7f704c48ace5 in mxArray_base_full::mxArray_base_full(bool, bool, mxClassID, long, long, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:1542:13
    #7 0x7f704c48a9ec in mxArray_separate_full::mxArray_separate_full(mxClassID, long, long, mxComplexity, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:2108:7
    #8 0x7f704c46d086 in mxArray::create_rep(bool, mxClassID, long, long, mxComplexity, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3154:16
    #9 0x7f704c46cf6b in mxArray::mxArray(bool, mxClassID, long, long, mxComplexity, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3036:12
    #10 0x7f704d0bae97 in mxCreateDoubleMatrix /home/dima/src/dev/octave/clang_asan/../libmex/mex.cc:455:32
    #11 0x7f7043884b13 in mexFunction /tmp/oct-hMRkkx/stk/src/stk_sampling_vdc_rr2.c:111:11
    #12 0x7f704c46f941 in octave::call_mex(octave_mex_function&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/mxarray.cc:3506:7
    #13 0x7f704babe6c5 in octave::tree_evaluator::execute_mex_function(octave_mex_function&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3596:12
    #14 0x7f704b8595d5 in octave_mex_function::execute(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-mex-fcn.cc:97:13
    #15 0x7f704b7cc50c in octave_function::call(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-fcn.cc:74:10
    #16 0x7f704bafdd13 in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.cc:470:33
    #17 0x7f704bb04975 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.h:105:32
    #18 0x7f704ba9aad4 in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4072:47
    #19 0x7f704bb1f30a in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #20 0x7f704ba9b656 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4157:16
    #21 0x7f704b51e7fa in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #22 0x7f704baa16d6 in octave::tree_evaluator::eval(std::shared_ptr<octave::tree_statement_list>&, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:1000:18
    #23 0x7f704baa3d83 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #24 0x7f704c32ed9f in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #25 0x7f704c32bd78 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #26 0x7f704abf2e75 in octave::cli_application::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/octave.cc:443:23
    #27 0x000000510cd1 in main /home/dima/src/dev/octave/clang_asan/../src/main-cli.cc:150:17
    #28 0x7f7046a295cf in __libc_start_call_main (/lib64/libc.so.6+0x295cf) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)

SUMMARY: AddressSanitizer: heap-use-after-free (/usr/local/bin/octave-cli-10.0.0+0x4cac96) (BuildId: 4814b5fa123a6d58662b82b860b878e4090fcf7c) in __asan_memmove
Shadow bytes around the buggy address:
  0x5020004d5780: fa fa fd fd fa fa 00 04 fa fa fd fa fa fa fd fa
  0x5020004d5800: fa fa fd fd fa fa 00 00 fa fa fd fd fa fa fd fd
  0x5020004d5880: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
  0x5020004d5900: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
  0x5020004d5980: fa fa fd fa fa fa fd fd fa fa fd fd fa fa fd fd
=>0x5020004d5a00: fa fa fd fd fa fa[fd]fd fa fa fd fa fa fa fd fa
  0x5020004d5a80: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fd
  0x5020004d5b00: fa fa fd fd fa fa 00 00 fa fa fd fd fa fa fd fd
  0x5020004d5b80: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
  0x5020004d5c00: fa fa fd fd fa fa fd fa fa fa fd fa fa fa fd fa
  0x5020004d5c80: fa fa fd fa fa fa fd fd fa fa 00 00 fa fa fd fd
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
==605768==ABORTING


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 22 Nov 2024 09:04:49 PM UTC, comment #7: 

This looks like a different bug -- it is not affected by pmr switch

octave:2> __octave_config_info__ ("STD_PMR_POLYMORPHIC_ALLOCATOR")
ans = 0
octave:3> path(path,'junk')
warning: addpath: junk: No such file or directory
subdirs =
{
  [1,1] = junk1
  [1,2] = junk2
}

warning: addpath: /home/dima/src/dev/octave/clang_asan/junk2: No such file or directory
warning: called from
    ./PKG_ADD at line 2 column 1

warning: addpath: /home/dima/src/dev/octave/clang_asan/junk1: No such file or directory
warning: called from
    ./PKG_ADD at line 2 column 1

=================================================================
==885032==ERROR: AddressSanitizer: heap-use-after-free on address 0x51300071cc80 at pc 0x7fa3df29b473 bp 0x7fa2bb146180 sp 0x7fa2bb146178
READ of size 8 at 0x51300071cc80 thread T8 (QThread)
    #0 0x7fa3df29b472 in std::_List_iterator<octave::load_path::dir_info>::operator++() /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_list.h:289:21
    #1 0x7fa3df27be44 in octave::load_path::set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:351:17
    #2 0x7fa3df2984e4 in octave::Fpath(octave::interpreter&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:2617:10


I will make another bug report.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 22 Nov 2024 08:39:52 PM UTC, comment #6: 

I am not sure if this is related or a different bug.
Make a directory say "scratch". Put the file PKG_ADD into this directory:


$ cat PKG_ADD
subdirs={'junk1', 'junk2'}
addpath (fullfile (fileparts (mfilename ('fullpath')), subdirs){:});


Now with octave 10 w/ ASAN (I used octave-cli to avoid Qt and threading):

$ octave-cli -qf
subdirs =
{
  [1,1] = junk1
  [1,2] = junk2
}

warning: addpath: /home/dima/scratch/junk2: No such file or directory
warning: called from
    ./PKG_ADD at line 2 column 1

warning: addpath: /home/dima/scratch/junk1: No such file or directory
warning: called from
    ./PKG_ADD at line 2 column 1

octave:1> path(path,'junk')
warning: addpath: junk: No such file or directory
subdirs =
{
  [1,1] = junk1
  [1,2] = junk2
}

warning: addpath: /home/dima/scratch/junk2: No such file or directory
warning: called from
    ./PKG_ADD at line 2 column 1

warning: addpath: /home/dima/scratch/junk1: No such file or directory
warning: called from
    ./PKG_ADD at line 2 column 1

=================================================================
==730026==ERROR: AddressSanitizer: heap-use-after-free on address 0x513000692180 at pc 0x7fcf368adf33 bp 0x7ffceceb61e0 sp 0x7ffceceb61d8
READ of size 8 at 0x513000692180 thread T0
    #0 0x7fcf368adf32 in std::_List_iterator<octave::load_path::dir_info>::operator++() /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_list.h:289:21
    #1 0x7fcf3688e904 in octave::load_path::set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:351:17
    #2 0x7fcf368aafa4 in octave::Fpath(octave::interpreter&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:2617:10
    #3 0x7fcf35f4d843 in octave::tree_evaluator::execute_builtin_function(octave_builtin&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3555:16
    #4 0x7fcf35b761d5 in octave_builtin::execute(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-builtin.cc:49:13
    #5 0x7fcf35c5a18c in octave_function::call(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-fcn.cc:74:10
    #6 0x7fcf35f912b8 in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.cc:470:33
    #7 0x7fcf35f98565 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.h:105:32
    #8 0x7fcf35f27a2e in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4073:47
    #9 0x7fcf35fb48f2 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #10 0x7fcf35f286e8 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4158:16
    #11 0x7fcf35986122 in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #12 0x7fcf35f2eee6 in octave::tree_evaluator::eval(std::shared_ptr<octave::tree_statement_list>&, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:1000:18
    #13 0x7fcf35f31840 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #14 0x7fcf3683a09f in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #15 0x7fcf36836e37 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #16 0x7fcf34fedafd in octave::cli_application::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/octave.cc:443:23
    #17 0x508a73 in main /home/dima/src/dev/octave/clang_asan/../src/main-cli.cc:150:17
    #18 0x7fcf30c295cf in __libc_start_call_main (/lib64/libc.so.6+0x295cf) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)
    #19 0x7fcf30c2967f in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2967f) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)
    #20 0x42c524 in _start (/usr/local/bin/octave-cli-10.0.0+0x42c524) (BuildId: b4d98b842f9edc060fff343f3e34956f8d57ef54)

0x513000692180 is located 0 bytes inside of 344-byte region [0x513000692180,0x5130006922d8)
freed by thread T0 here:
    #0 0x506d71 in operator delete(void*) (/usr/local/bin/octave-cli-10.0.0+0x506d71) (BuildId: b4d98b842f9edc060fff343f3e34956f8d57ef54)
    #1 0x7fcf3684525c in std::__new_allocator<std::_List_node<octave::load_path::dir_info>>::deallocate(std::_List_node<octave::load_path::dir_info>*, unsigned long) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/new_allocator.h:172:2
    #2 0x7fcf368449b8 in std::allocator_traits<std::allocator<std::_List_node<octave::load_path::dir_info>>>::deallocate(std::allocator<std::_List_node<octave::load_path::dir_info>>&, std::_List_node<octave::load_path::dir_info>*, unsigned long) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/alloc_traits.h:517:13
    #3 0x7fcf368449b8 in std::__cxx11::_List_base<octave::load_path::dir_info, std::allocator<octave::load_path::dir_info>>::_M_put_node(std::_List_node<octave::load_path::dir_info>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_list.h:522:9
    #4 0x7fcf368aed3f in std::__cxx11::list<octave::load_path::dir_info, std::allocator<octave::load_path::dir_info>>::_M_erase(std::_List_iterator<octave::load_path::dir_info>) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_list.h:2024:2
    #5 0x7fcf368aebc5 in std::__cxx11::list<octave::load_path::dir_info, std::allocator<octave::load_path::dir_info>>::erase(std::_List_const_iterator<octave::load_path::dir_info>) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/list.tcc:158:7
    #6 0x7fcf3689c355 in octave::load_path::move(std::_List_iterator<octave::load_path::dir_info>, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:1058:23
    #7 0x7fcf36890b7b in octave::load_path::add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:1138:5
    #8 0x7fcf368900c6 in octave::load_path::prepend(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:372:5
    #9 0x7fcf368ac0a1 in octave::Faddpath(octave::interpreter&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:2767:16
    #10 0x7fcf35f4d843 in octave::tree_evaluator::execute_builtin_function(octave_builtin&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3555:16
    #11 0x7fcf35b761d5 in octave_builtin::execute(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-builtin.cc:49:13
    #12 0x7fcf35c5a18c in octave_function::call(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-fcn.cc:74:10
    #13 0x7fcf35f912b8 in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.cc:470:33
    #14 0x7fcf35f98565 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.h:105:32
    #15 0x7fcf35f27a2e in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4073:47
    #16 0x7fcf35fb48f2 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #17 0x7fcf35f286e8 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4158:16
    #18 0x7fcf35986122 in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #19 0x7fcf35f4e3e6 in octave::tree_evaluator::execute_user_script(octave_user_script&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3634:13
    #20 0x7fcf35d398e5 in octave_user_script::execute(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-usr-fcn.cc:210:13
    #21 0x7fcf35d3979c in octave_user_script::call(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-usr-fcn.cc:203:10
    #22 0x7fcf35f43306 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) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:2213:9
    #23 0x7fcf3683dd7b 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) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1744:15
    #24 0x7fcf35eb1b1a 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) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/oct-parse.yy:5737:12
    #25 0x7fcf3689bcd3 in octave::load_path::execute_pkg_add_or_del(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&) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:999:5
    #26 0x7fcf3688c68e in octave::load_path::execute_pkg_add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:962:3
    #27 0x7fcf3688c541 in octave::load_path::load_path(octave::interpreter&)::$_0::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:253:57
    #28 0x7fcf3688c4ec in void std::__invoke_impl<void, octave::load_path::load_path(octave::interpreter&)::$_0&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&>(std::__invoke_other, octave::load_path::load_path(octave::interpreter&)::$_0&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/invoke.h:61:14
    #29 0x7fcf3688c48c in std::enable_if<is_invocable_r_v<void, octave::load_path::load_path(octave::interpreter&)::$_0&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&>, void>::type std::__invoke_r<void, octave::load_path::load_path(octave::interpreter&)::$_0&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&>(octave::load_path::load_path(octave::interpreter&)::$_0&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/invoke.h:111:2
    #30 0x7fcf3688c354 in std::_Function_handler<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), octave::load_path::load_path(octave::interpreter&)::$_0>::_M_invoke(std::_Any_data const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/std_function.h:290:9

previously allocated by thread T0 here:
    #0 0x5064f1 in operator new(unsigned long) (/usr/local/bin/octave-cli-10.0.0+0x5064f1) (BuildId: b4d98b842f9edc060fff343f3e34956f8d57ef54)
    #1 0x7fcf368b25e7 in std::__new_allocator<std::_List_node<octave::load_path::dir_info>>::allocate(unsigned long, void const*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/new_allocator.h:151:27
    #2 0x7fcf368b23bc in std::allocator_traits<std::allocator<std::_List_node<octave::load_path::dir_info>>>::allocate(std::allocator<std::_List_node<octave::load_path::dir_info>>&, unsigned long) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/alloc_traits.h:482:20
    #3 0x7fcf368b23bc in std::__cxx11::_List_base<octave::load_path::dir_info, std::allocator<octave::load_path::dir_info>>::_M_get_node() /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_list.h:518:16
    #4 0x7fcf368b217a in std::_List_node<octave::load_path::dir_info>* std::__cxx11::list<octave::load_path::dir_info, std::allocator<octave::load_path::dir_info>>::_M_create_node<octave::load_path::dir_info const&>(octave::load_path::dir_info const&) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_list.h:710:21
    #5 0x7fcf368b2074 in void std::__cxx11::list<octave::load_path::dir_info, std::allocator<octave::load_path::dir_info>>::_M_insert<octave::load_path::dir_info const&>(std::_List_iterator<octave::load_path::dir_info>, octave::load_path::dir_info const&) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_list.h:2005:18
    #6 0x7fcf368b0461 in std::__cxx11::list<octave::load_path::dir_info, std::allocator<octave::load_path::dir_info>>::push_front(octave::load_path::dir_info const&) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_list.h:1256:15
    #7 0x7fcf3689c3b2 in octave::load_path::move(std::_List_iterator<octave::load_path::dir_info>, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:1063:25
    #8 0x7fcf36890b7b in octave::load_path::add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:1138:5
    #9 0x7fcf36890079 in octave::load_path::append(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:365:5
    #10 0x7fcf3688e7aa in octave::load_path::set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:344:5
    #11 0x7fcf368aafa4 in octave::Fpath(octave::interpreter&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:2617:10
    #12 0x7fcf35f4d843 in octave::tree_evaluator::execute_builtin_function(octave_builtin&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:3555:16
    #13 0x7fcf35b761d5 in octave_builtin::execute(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-builtin.cc:49:13
    #14 0x7fcf35c5a18c in octave_function::call(octave::tree_evaluator&, int, octave_value_list const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-fcn.cc:74:10
    #15 0x7fcf35f912b8 in octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.cc:470:33
    #16 0x7fcf35f98565 in octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-idx.h:105:32
    #17 0x7fcf35f27a2e in octave::tree_evaluator::visit_statement(octave::tree_statement&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4073:47
    #18 0x7fcf35fb48f2 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #19 0x7fcf35f286e8 in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:4158:16
    #20 0x7fcf35986122 in octave::tree_statement_list::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:215:8
    #21 0x7fcf35f2eee6 in octave::tree_evaluator::eval(std::shared_ptr<octave::tree_statement_list>&, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:1000:18
    #22 0x7fcf35f31840 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #23 0x7fcf3683a09f in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #24 0x7fcf36836e37 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #25 0x7fcf34fedafd in octave::cli_application::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/octave.cc:443:23
    #26 0x508a73 in main /home/dima/src/dev/octave/clang_asan/../src/main-cli.cc:150:17
    #27 0x7fcf30c295cf in __libc_start_call_main (/lib64/libc.so.6+0x295cf) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)

SUMMARY: AddressSanitizer: heap-use-after-free /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:351:17 in octave::load_path::set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)
Shadow bytes around the buggy address:
  0x513000691f00: 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa fa
  0x513000691f80: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x513000692000: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x513000692080: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x513000692100: fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x513000692180:[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x513000692200: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x513000692280: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa
  0x513000692300: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x513000692380: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x513000692400: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
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
==730026==ABORTING


Dmitri.
--
 


Dmitri A. Sergatskov <dasergatskov>
Thu 21 Nov 2024 09:23:08 PM UTC, comment #5: 

Attached is the full trace of

octave:2> pkg load stk
octave:3> __stk_sampling_vdc_rr2__(10,1)

ans = <10x1 stk_dataframe array>

=================================================================
==393798==ERROR: AddressSanitizer: heap-use-after-free on address 0x507000357c20 at pc 0x0000004c5db7 bp 0x7f46582108e0 sp 0x7f46582100a0
READ of size 80 at 0x507000357c20 thread T8 (QThread)
    #0 0x4c5db6 in __asan_memmove (/usr/local/libexec/octave/10.0.0/exec/x86_64-pc-linux-gnu/octave-gui+0x4c5db6) (BuildId: 4f5040c5051881a5755926222df61af133dc99de)
    #1 0x7f477bb33b66 in double* std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<double const, double>(double const*, double const*, double*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_algobase.h:437:6
    #2 0x7f477bb33b14 in double* std::__copy_move_a2<false, double const*, double*>(double const*, double const*, double*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_algobase.h:505:14
    #3 0x7f477bb339a4 in double* std::__copy_move_a1<false, double const*, double*>(double const*, double const*, double*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_algobase.h:533:14
    #4 0x7f477bf8222c in double* std::__copy_move_a<false, double const*, double*>(double const*, double const*, double*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_algobase.h:541:3
    #5 0x7f477bf82119 in double* std::copy<double const*, double*>(double const*, double const*, double*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_algobase.h:632:14
    #6 0x7f47788c95af in double* std::__copy_n<double const*, long, double*>(double const*, long, double*, std::random_access_iterator_tag) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_algo.h:731:14
    #7 0x7f47788c8b53 in double* std::copy_n<double const*, long, double*>(double const*, long, double*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_algo.h:763:14
    #8 0x7f47788cb87a in long octave::idx_vector::index<double>(double const*, long, double*) const /home/dima/src/dev/octave/clang_asan/../liboctave/array/idx-vector.h:595:9
    #9 0x7f47788cc907 in Array<double, std::pmr::polymorphic_allocator<double>>::index(octave::idx_vector const&, octave::idx_vector const&) const /home/dima/src/dev/octave/clang_asan/../liboctave/array/Array-base.cc:822:18
    #10 0x7f47788d0c3b in Array<double, std::pmr::polymorphic_allocator<double>>::index(octave::idx_vector const&, octave::idx_vector const&, bool, double const&) const /home/dima/src/dev/octave/clang_asan/../liboctave/array/Array-base.cc:1100:14
    #11 0x7f477b310050 in Array<double, std::pmr::polymorphic_allocator<double>>::index(octave::idx_vector const&, octave::idx_vector const&, bool) const /home/dima/src/dev/octave/clang_asan/../liboctave/array/Array.h:731:12
    #12 0x7f477b2d06b6 in octave_base_matrix<NDArray>::do_index_op(octave_value_list const&, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-base-mat.cc:204:37
    #13 0x7f477b2cf1af in octave_base_matrix<NDArray>::subsref(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::list<octave_value_list, std::allocator<octave_value_list>> const&) /home/dima/src/dev/octave/clang_asan/../libinterp/octave-value/ov-base-mat.cc:77:16
...

(using clang compiler this time).

(File asan_stk_clang.txt)

Is this what you are asking for?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 21 Nov 2024 09:08:18 PM UTC, comment #4: 

Does one of the arguments to std::copy_n at frame #7 have address 0x60700046994?  If so, which one?

Can you get source locations for stack frames #8, #9, #10, ...?

If the call to long octave::idx_vector::index<double>(double const*, long, double*) const defined in ../liboctave/array/idx-vector.h comes from either possible call in Array<T, Alloc>::index (const octave::idx_vector& i, const octave::idx_vector& j) const defined in Array-base.cc (either line 822 or 834) I don't see why the arguments would be freed before they are used.

John W. Eaton <jwe>
Group administrator
Thu 21 Nov 2024 08:14:50 PM UTC, comment #3: 

Perhaps an easier reproducer is:
(without pmr)

octave:9> __stk_sampling_vdc_rr2__(10,2)

ans = <10x1 stk_dataframe array>

   :  --------
 * :  0.000000
 * :  0.666667
 * :  0.333333
 * :  0.222222
 * :  0.888889
 * :  0.555556
 * :  0.111111
 * :  0.777778
 * :  0.444444
 * :  0.074074


(with pmr)


octave:1> pkg load stk
octave:2> __stk_sampling_vdc_rr2__(10,1)

ans = <10x1 stk_dataframe array>

=================================================================
==271954==ERROR: AddressSanitizer: heap-use-after-free on address 0x607000469940 at pc 0x7fd922e3a077 bp 0x7fd7fe570120 sp 0x7fd7fe56f8c8
READ of size 80 at 0x607000469940 thread T8 (QThread)
    #0 0x7fd922e3a076 in __interceptor_memmove (/lib64/libasan.so.6+0x3a076)
    #1 0x7fd9223706b1 in double* std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<double>(double const*, double const*, double*) /usr/include/c++/11/bits/stl_algobase.h:431
    #2 0x7fd91ece32d2 in double* std::__copy_move_a2<false, double const*, double*>(double const*, double const*, double*) /usr/include/c++/11/bits/stl_algobase.h:495
    #3 0x7fd91ece0cc2 in double* std::__copy_move_a1<false, double const*, double*>(double const*, double const*, double*) /usr/include/c++/11/bits/stl_algobase.h:522
    #4 0x7fd91f15f7e8 in double* std::__copy_move_a<false, double const*, double*>(double const*, double const*, double*) /usr/include/c++/11/bits/stl_algobase.h:529
    #5 0x7fd91f1592d6 in double* std::copy<double const*, double*>(double const*, double const*, double*) /usr/include/c++/11/bits/stl_algobase.h:620
    #6 0x7fd91bd02d1f in double* std::__copy_n<double const*, long, double*>(double const*, long, double*, std::random_access_iterator_tag) /usr/include/c++/11/bits/stl_algo.h:725
    #7 0x7fd91bcfa733 in double* std::copy_n<double const*, long, double*>(double const*, long, double*) /usr/include/c++/11/bits/stl_algo.h:757
    #8 0x7fd91bcfa05f in long octave::idx_vector::index<double>(double const*, long, double*) const ../liboctave/array/idx-vector.h:595
    #9 0x7fd91bcde6c0 in Array<double, std::pmr::polymorphic_allocator<double> >::index(octave::idx_vector const&, octave::idx_vector const&) const (/usr/local/lib/octave/10.0.0/liboctave.so.11+0x4de6c0)
    #10 0x7fd91bce18ce in Array<double, std::pmr::polymorphic_allocator<double> >::index(octave::idx_vector const&, octave::idx_vector const&, bool, double const&) const (/usr/local/lib/octave/10.0.0/liboctave.so.11+0x4e18ce)
    #11 0x7fd91e550fbe in Array<double, std::pmr::polymorphic_allocator<double> >::index(octave::idx_vector const&, octave::idx_vector const&, bool) const (/usr/local/lib/octave/10.0.0/liboctinterp.so.12+0x1150fbe)
    #12 0x7fd91e539e2b in octave_base_matrix<NDArray>::do_index_op(octave_value_list const&, bool) (/usr/local/lib/octave/10.0.0/liboctinterp.so.12+0x1139e2b)
    #13 0x7fd91e5384dd in octave_base_matrix<NDArray>::subsref(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::list<octave_value_list, std::allocator<oc
...


Without ASAN it returns all zeros or crashes (on MacOS).

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 21 Nov 2024 05:12:05 PM UTC, comment #2: 

CC'ing jwe because I think he has the best understanding of how the data transfer from mxArray objects to Array objects should be handled with polymorphic allocators.

Markus Mützel <mmuetzel>
Group administrator
Thu 21 Nov 2024 03:12:08 PM UTC, comment #1: 
Dmitri A. Sergatskov <dasergatskov>
Thu 21 Nov 2024 03:10:34 PM UTC, original submission:  

Running "pkg test stk" on octave 10 compiled with ASAN enabled
results in:

STK_EXAMPLE_DOE01  Examples of two-dimensional designs

 All designs are constructed on the hyper-rectangle BOX = [0; 2] x [0; 4].

 Examples of the following designs are shown:
  a) Regular grid                         --> stk_sampling_regulargrid,
  b) "Maximin" latin hypercube sample     --> stk_sampling_maximinlhs,
  c) RR2-scrambled Halton sequence        --> stk_sampling_halton_rr2,
  d) Uniformly distributed random sample  --> stk_sampling_randunif.


Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at https://www.octave.org and via the help@octave.org
mailing list.
=================================================================
==1465459==ERROR: AddressSanitizer: heap-use-after-free on address 0x614000794440 at pc 0x7f4483e3a077 bp 0x7f435f430270 sp 0x7f435f42fa18
READ of size 392 at 0x614000794440 thread T8 (QThread)
    #0 0x7f4483e3a076 in __interceptor_memmove (/lib64/libasan.so.6+0x3a076)
    #1 0x7f44833706b1 in double* std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m<double>(double const*, double const*, double*) /usr/include/c++/11/bits/stl_algobase.h:431
    #2 0x7f447fce3c12 in double* std::__copy_move_a2<false, double const*, double*>(double const*, double const*, double*) /usr/include/c++/11/bits/stl_algobase.h:495
    #3 0x7f447fce1602 in double* std::__copy_move_a1<false, double const*, double*>(double const*, double const*, double*) /usr/include/c++/11/bits/stl_algobase.h:522
    #4 0x7f4480160128 in double* std::__copy_move_a<false, double const*, double*>(double const*, double const*, double*) /usr/include/c++/11/bits/stl_algobase.h:529
    #5 0x7f4480159c16 in double* std::copy<double const*, double*>(double const*, double const*, double*) /usr/include/c++/11/bits/stl_algobase.h:620
    #6 0x7f447cd02d4f in double* std::__copy_n<double const*, long, double*>(double const*, long, double*, std::random_access_iterator_tag) /usr/include/c++/11/bits/stl_algo.h:725
    #7 0x7f447ccfa763 in double* std::copy_n<double const*, long, double*>(double const*, long, double*) /usr/include/c++/11/bits/stl_algo.h:757
    #8 0x7f447ccfb1ec in long octave::idx_vector::assign<double>(double const*, long, double*) const (/usr/local/lib/octave/10.0.0/liboctave.so.11+0x4fb1ec)
    #9 0x7f447cce379e in Array<double, std::pmr::polymorphic_allocator<double> >::assign(octave::idx_vector const&, octave::idx_vector const&, Array<double, std::pmr::polymorphic_allocator<double> > const&, double const&) (/usr/local/lib/octave/10.0.0/liboctave.so.11+0x4e379e)
    #10 0x7f447f551bc9 in Array<double, std::pmr::polymorphic_allocator<double> >::assign(octave::idx_vector const&, octave::idx_vector const&, Array<double, std::pmr::polymorphic_allocator<double> > const&) (/usr/local/lib/octave/10.0.0/liboctinterp.so.12+0x1151bc9)
    #11 0x7f447f53b5e1 in octave_base_matrix<NDArray>::assign(octave_value_list const&, NDArray const&) (/usr/local/lib/octave/10.0.0/liboctinterp.so.12+0x113b5e1)
    #12 0x7f447ef4256f in oct_assignop_assign ../libinterp/operators/op-m-m.cc:156
    #13 0x7f447f5899fc in octave_base_value::numeric_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::list<octave_value_list, std::allocator<octave_value_list> > const&, octave_value const&) ../libinterp/octave-value/ov-base.cc:1246
...

(full log attached.)

Running the test with octave compiled with "normal" optimization
flags and w/o ASAN results in a few FAILs. On x86_64:

Failure Summary:

    ..tave/api-v59/packages/stk-2.8.1/param/estim/stk_param_relik.m  pass    5/8
                                                                     FAIL    3

  Summary:

    PASS                             1555
    FAIL                                3


and a couple more on MacOS (Apple CPU):

Failure Summary:

    ..k-2.8.1/examples/02_design_of_experiments/stk_example_doe01.m  pass    0/1
                                                                     FAIL    1
    ..k-2.8.1/examples/02_design_of_experiments/stk_example_doe02.m  pass    0/1
                                                                     FAIL    1
    ..tave/api-v59/packages/stk-2.8.1/param/estim/stk_param_relik.m  pass    5/8
                                                                     FAIL    3

  Summary:

    PASS                             1553
    FAIL                                5


When octave is compiled with "--disable-std-pmr-polymorphic-allocator" tests pass and ASAN finds no problem.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #56637:  stk_asan_crash.txt.gz added by dasergatskov (5KiB - application/gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by mmuetzel
  • -email is unavailable- added by dasergatskov (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-11-21 mmuetzel Carbon-Copy- Added jwe
    2024-11-21 dasergatskov Attached File- Added stk_asan_crash.txt.gz, #56637

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code