bugGNU Octave - Bugs: bug #66477, ASAN error with path(_)...

 
 

bug #66477: ASAN error with path(_) manipulations

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Fri 22 Nov 2024 09:14:01 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Ready For Test Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  9.3.0 (current stable)
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 02 Dec 2024 09:50:55 AM UTC, comment #21: 

Thank you for checking.

Since the issue with the biosig package is reproducible at the revision immediately before the changes for this report, I agree that it might be best to investigate that issue in a different report.

(An interesting question for that report might be whether the test for that package also fails on the stable branch - on which there isn't a liboctmex library...
Fwiw, it's passing these tests with the nightly builds in CI:
https://github.com/gnu-octave/octave-buildbot/actions/runs/12100014953/job/33738164943#step:14:264
Those are from the stable branch of the Octave repository though.)

Markus Mützel <mmuetzel>
Group administrator
Sat 30 Nov 2024 03:42:02 PM UTC, comment #20: 

It is on dev. Also using dev biosig snapshot. It looks like a biosig
problem; I can reproduce it with hgid=c5447408b158.

Summary:

  PASS                               19
  FAIL                                1

See the file /home/dima/src/biosig-code/fntests.log for additional details.

253 (of 257) .m files have no tests.

Please help improve Octave by contributing tests for these files
(see the list in the file /home/dima/src/biosig-code/fntests.log).

octave:3> test sumskipnan verbose
????? sumskipnan does not exist in path
octave:4> pkg load biosig
octave:5> test sumskipnan verbose
>>>>> /home/dima/.local/share/octave/api-v59/packages/biosig-2.6.1/t400_Classification/sumskipnan.m
***** assert(sumskipnan([1,2],1),[1,2])
***** assert(sumskipnan([1,NaN],2),1)
***** assert(sumskipnan([1,NaN],2),1)
***** assert(sumskipnan([nan,1,4,5]),10)
***** assert(sumskipnan([nan,1,4,5]',1,[3;2;1;0]),6)
!!!!! test failed
weighted sumskipnan requires sumskipnan_mex
octave:6> sumskipnan_mex
error: sumskipnan_mex: SUMSKIPNAN.MEX requires between 1 and 4 arguments.
octave:7> which sumskipnan_mex
'sumskipnan_mex' is a function from the file /home/dima/.local/share/octave/api-v59/packages/biosig-2.6.1/t400_Classification/sumskipnan_mex.mex
-verbose-

I guess we can deal with this package later.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sat 30 Nov 2024 12:23:26 PM UTC, comment #19: 

I don't know how the change from here could have caused that kind of error. (But sometimes there are odd side effects.)

Can you confirm that the test passed before that commit and it started to fail with that change?

Are you testing the stable branch or the default branch?

Markus Mützel <mmuetzel>
Group administrator
Fri 29 Nov 2024 10:07:25 PM UTC, comment #18: 

I wonder if that broke "biosig". I see:

octave:3> pkg test biosig
Testing functions in package 'biosig':

Integrated test scripts:

                                                                                  [ CPU    /  CLOCK ]
  ..ve/api-v59/packages/biosig-2.6.1/t300_FeatureExtraction/csp.m  pass    1/1    [ 6.870s /  0.322s]
  ..6.1/t300_FeatureExtraction/get_local_maxima_above_threshold.m 0 spurious events removed
1 spurious events removed
0 spurious events removed
1 spurious events removed
 pass   11/11   [ 3.052s /  0.218s]
  ..tave/api-v59/packages/biosig-2.6.1/t400_Classification/covm.m  pass    3/3    [ 0.128s /  0.129s]
  ..pi-v59/packages/biosig-2.6.1/t400_Classification/sumskipnan.m  pass    4/5    [ 0.189s /  0.190s]
                                                                   FAIL    1

Fixed test scripts:

                                                        total time (CPU / CLOCK)  [  16.4s /    4.7s]
Failure Summary:

  ..pi-v59/packages/biosig-2.6.1/t400_Classification/sumskipnan.m  pass    4/5
                                                                   FAIL    1

Summary:

  PASS                               19
  FAIL                                1

See the file /home/dima/src/biosig-code/fntests.log for additional details.

253 (of 257) .m files have no tests.

Please help improve Octave by contributing tests for these files
(see the list in the file /home/dima/src/biosig-code/fntests.log).

octave:4> pkg load biosig
octave:5> test sumskipnan verbose
>>>>> /home/dima/.local/share/octave/api-v59/packages/biosig-2.6.1/t400_Classification/sumskipnan.m
***** assert(sumskipnan([1,2],1),[1,2])
***** assert(sumskipnan([1,NaN],2),1)
***** assert(sumskipnan([1,NaN],2),1)
***** assert(sumskipnan([nan,1,4,5]),10)
***** assert(sumskipnan([nan,1,4,5]',1,[3;2;1;0]),6)
!!!!! test failed
weighted sumskipnan requires sumskipnan_mex
octave:6> sumskipnan_mex
error: sumskipnan_mex: SUMSKIPNAN.MEX requires between 1 and 4 arguments.
octave:7> which sumskipnan_mex
'sumskipnan_mex' is a function from the file /home/dima/.local/share/octave/api-v59/packages/biosig-2.6.1/t400_Classification/sumskipnan_mex.mex



Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 29 Nov 2024 05:10:57 PM UTC, comment #17: 

I added a couple of comments to the patch and pushed it to the stable branch (because it addresses a potential crash):
https://hg.savannah.gnu.org/hgweb/octave/rev/54eaac570ad4

A follow-up change addresses one of the FIXME notes in that area on the default branch:
https://hg.savannah.gnu.org/hgweb/octave/rev/5041b3bf23a6

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Thu 28 Nov 2024 12:28:10 AM UTC, comment #16: 

This works:

octave:1> cd a/
octave:2> path(path)
octave:3> path(path, "b")
warning: addpath: b: No such file or directory
octave:4> version -hgid
ans = c5447408b158+


Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Thu 28 Nov 2024 12:23:49 AM UTC, comment #15: 

Oof. One would have thought that I would have memorized the sequence of commands before finalizing a change. But I missed one step (and also forgot to check the final patch).

The attached patch now looks better afaict.
Could you please check again?

(file #56650)

Markus Mützel <mmuetzel>
Group administrator
Wed 27 Nov 2024 07:06:36 PM UTC, comment #14: 

That would not compile for me:

libtool: compile:  clang++ -std=gnu++17 -DHAVE_CONFIG_H -I. -I.. -DOCTINTERP_DLL -Iliboctave -I../liboctave -I../liboctave/array -Iliboctave/numeric -I../liboctave/numeric -Iliboctave/operators -I../liboctave/operators -I../liboctave/system -I../liboctave/util -I../libinterp/octave-value -Ilibinterp -I../libinterp -I../libinterp/operators -Ilibinterp/parse-tree -I../libinterp/parse-tree -Ilibinterp/corefcn -I../libinterp/corefcn -I../liboctave/wrappers -I/usr/include/GraphicsMagick -DOCTAVE_MEX_SOVERSION=1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -Dyysymbol_kind_t=octave_tex_symbol_kind_t -fPIC -pthread -fopenmp -fsanitize=address -fno-omit-frame-pointer -Wall -W -Wshadow -Woverloaded-virtual -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -fvisibility=hidden -ggdb3 -O0 -march=native -mtune=native -MT libinterp/corefcn/libcorefcn_la-load-path.lo -MD -MP -MF libinterp/corefcn/.deps/libcorefcn_la-load-path.Tpo -c ../libinterp/corefcn/load-path.cc  -fPIC -DPIC -o libinterp/corefcn/.libs/libcorefcn_la-load-path.o
../libinterp/corefcn/load-path.cc:353:13: error: member reference type 'octave::load_path::dir_info' is not a pointer; did you mean to use '.'?
  353 |       if (di->dir_name.compare (".") && m_add_hook)
      |           ~~^~
      |             .
In file included from ../libinterp/corefcn/load-path.cc:33:
In file included from ../liboctave/system/dir-ops.h:33:
In file included from ../liboctave/util/str-vec.h:35:
In file included from ../liboctave/array/Array.h:44:
In file included from ../liboctave/util/oct-sort.h:92:
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/functional:552:2: warning: 'result_of<(lambda at ../libinterp/corefcn/load-path.cc:1183:29) &()>' is deprecated: use 'std::invoke_result' instead [-Wdeprecated-declarations]
  552 |         using _Res_type_impl
      |         ^
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/functional:556:2: note: in instantiation of template type alias '_Res_type_impl' requested here
  556 |         using _Res_type = _Res_type_impl<_Functor, _CallArgs, _Bound_args...>;
      |         ^
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/functional:586:28: note: in instantiation of template type alias '_Res_type' requested here
  586 |                typename _Result = _Res_type<tuple<_Args...>>>
      |                                   ^
../liboctave/util/unwind-prot.h:164:14: note: in instantiation of template class 'std::_Bind<(lambda at ../libinterp/corefcn/load-path.cc:1183:29) ()>' requested here
  164 |     : m_fcn (std::bind (fcn, args...))
      |              ^
../libinterp/corefcn/load-path.cc:1183:17: note: in instantiation of function template specialization 'octave::unwind_action::unwind_action<(lambda at ../libinterp/corefcn/load-path.cc:1183:29)>' requested here
 1183 |   unwind_action close_file ([cfile] () { fclose (cfile); });
      |                 ^
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/type_traits:2590:9: note: 'result_of<(lambda at ../libinterp/corefcn/load-path.cc:1183:29) &()>' has been explicitly marked deprecated here
 2590 |     { } _GLIBCXX17_DEPRECATED_SUGGEST("std::invoke_result");
      |         ^
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux/bits/c++config.h:2419:45: note: expanded from macro '_GLIBCXX17_DEPRECATED_SUGGEST'
 2419 | # define _GLIBCXX17_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
      |                                             ^
/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux/bits/c++config.h:2395:19: note: expanded from macro '_GLIBCXX_DEPRECATED_SUGGEST'
 2395 |   __attribute__ ((__deprecated__ ("use '" ALT "' instead")))
      |                   ^
1 warning and 1 error generated.
make[2]: *** [Makefile:19965: libinterp/corefcn/libcorefcn_la-load-path.lo] Error 1
make[2]: Leaving directory '/home/dima/src/dev/octave/clang_asan'
make[1]: *** [Makefile:28537: all-recursive] Error 1
make[1]: Leaving directory '/home/dima/src/dev/octave/clang_asan'
make: *** [Makefile:11552: all] Error 2


Should I installed the patch on a fresh clone, or on top of your previous patch?

Dmitri.
--



Dmitri A. Sergatskov <dasergatskov>
Wed 27 Nov 2024 06:50:52 PM UTC, comment #13: 

Ah. Ok.
The following steps seem to suffice to trigger the issue:

octave:1> cd a
octave:2> path(path)
subdirs =
{
  [1,1] = junk1
  [1,2] = junk2
}

warning: addpath: /home/osboxes/Documents/Repositories/Octave/octave-2/.build-asan-clang/a/junk2: No such file or directory
warning: called from
    ./PKG_ADD at line 2 column 1

warning: addpath: /home/osboxes/Documents/Repositories/Octave/octave-2/.build-asan-clang/a/junk1: No such file or directory
warning: called from
    ./PKG_ADD at line 2 column 1

=================================================================
==296505==ERROR: AddressSanitizer: heap-use-after-free on address 0x51300068c680 at pc 0x7b1c1957992b bp 0x7b1b8cde7140 sp 0x7b1b8cde7138
READ of size 8 at 0x51300068c680 thread T18 (QThread)
    #0 0x7b1c1957992a in std::_List_iterator<octave::load_path::dir_info>::operator++() /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_list.h:289:21


So, the issue might be triggered if there is a PKG_ADD script in the current directory and '.' is added to the load path?
Setting `path('.')` doesn't suffice to trigger the issue though. Maybe, the path list needs to be long enough to end up at an iterator that actually cannot be incremented?

We probably never want to execute a PKG_ADD script in the current directory anyway.

Does the attached patch avoid the issue for you? (It does for me afaict.)

(file #56649)

Markus Mützel <mmuetzel>
Group administrator
Wed 27 Nov 2024 04:54:25 PM UTC, comment #12: 


octave:1> ls a
PKG_ADD
octave:2> addpath('a')
subdirs =
{
  [1,1] = junk1
  [1,2] = junk2
}

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

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

octave:3> cd a
warning: load_path: a: No such file or directory
warning: load-path: update failed for 'a', removing from path
octave:4> addpath('a')
warning: addpath: a: No such file or directory
octave:5> path(path,'b')
warning: addpath: b: No such file or directory
subdirs =
{
  [1,1] = junk1
  [1,2] = junk2
}

warning: addpath: /home/dima/src/dev/octave/clang_asan/a/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/a/junk1: No such file or directory
warning: called from
    ./PKG_ADD at line 2 column 1

=================================================================
==36573==ERROR: AddressSanitizer: heap-use-after-free on address 0x5030004ba850 at pc 0x7f349c2b135e bp 0x7f3378203190 sp 0x7f3378203188
READ of size 8 at 0x5030004ba850 thread T8 (QThread)
    #0 0x7f349c2b135d in std::__shared_ptr<octave::load_path::dir_info, (__gnu_cxx::_Lock_policy)2>::operator bool() const /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/shared_ptr_base.h:1670:16
...


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 27 Nov 2024 04:48:50 PM UTC, comment #11: 

Those steps do not crash for me either. Try:

cd a
path(path,'b')


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 27 Nov 2024 03:49:21 PM UTC, comment #10: 

I tried to reproduce the issue on Ubuntu 24.10 by configuring Octave with:

../configure --disable-java --disable-docs --enable-address-sanitizer-flags CPPFLAGS=-I/usr/include/hdf5/serial LDFLAGS=-L/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/hdf5/serial CC=clang 'CXX=clang++ -std=gnu++17' 'CFLAGS=-ggdb3 -O0' 'CXXFLAGS=-ggdb3 -O0' 'FFLAGS=-ggdb3 -O0'


But the steps from comment #0 don't cause an issue for me:

$ LSAN_OPTIONS="leak_check_at_exit=0" ./run-octave -qf
octave:1> ls a
PKG_ADD
octave:2> addpath('a')
subdirs =
{
  [1,1] = junk1
  [1,2] = junk2
}

warning: addpath: /home/osboxes/Documents/Repositories/Octave/octave-2/.build-asan-clang/a/junk2: No such file or directory
warning: called from
    a/PKG_ADD at line 2 column 1

warning: addpath: /home/osboxes/Documents/Repositories/Octave/octave-2/.build-asan-clang/a/junk1: No such file or directory
warning: called from
    a/PKG_ADD at line 2 column 1

octave:3>


These steps don't trigger any issue with the GCC ASAN for me either.

Am I missing something?

Markus Mützel <mmuetzel>
Group administrator
Mon 25 Nov 2024 05:29:35 PM UTC, comment #9: 

I don't know if I correctly understand how `std::shared_ptr` is supposed to work.
Does the attached second version of the patch behave differently?


(file #56646)

Markus Mützel <mmuetzel>
Group administrator
Mon 25 Nov 2024 05:29:13 PM UTC, comment #8: 

BTW, I noticed the problem when i was trying to load "biosig" package with ASAN compiled octave. PKG_ADD construct is from there.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 25 Nov 2024 05:25:03 PM UTC, comment #7: 

Yeah. The issue is with this loop in load-path.cc:351
https://hg.savannah.gnu.org/hgweb/octave/file/4026749d3662/libinterp/corefcn/load-path.cc#l351

  for (auto& di : m_dir_info_list)
    {
      if (m_add_hook)
        m_add_hook (di.dir_name);
    }


Calling the function `m_add_hook` could re-create m_dir_info_list from scratch (which it does with that content of the PKG_ADD script). In that case, the loop can no longer increment to the next iterator (because the iterator for the current iteration is already invalid after that happened).
It would probably be ok to just stop the loop at that point.

The question is: how can we detect that that happened?

Markus Mützel <mmuetzel>
Group administrator
Mon 25 Nov 2024 04:03:20 PM UTC, comment #6: 

I think you're right that the problem is the loop over the elements of m_dir_info_list in load_path::set, but the problem is that the PKG_ADD file that causes the trouble results in a call to modify the m_dir_info_list object while we are inside that loop.

The PKG_ADD file was intended to allow commands like "autoload" to be executed when a new element is added to the load path, not to add more elements to the path.  I don't know how to easily fix this code to handle the possibility of recursively adding elements to the path.

Maybe it's also time to rethink the design decision that allows arbitrary code to be executed in a PKG_ADD file.

John W. Eaton <jwe>
Group administrator
Mon 25 Nov 2024 03:48:09 PM UTC, comment #5: 

All paths may be valid, it still crashes:

$ LSAN_OPTIONS="leak_check_at_exit=0" ./run-octave -qf
octave:1> cd ~/scratch
octave:2> ls
junk  junk1  junk2  PKG_ADD
octave:3> path(path, "junk")
subdirs =
{
  [1,1] = junk1
  [1,2] = junk2
}

=================================================================
==1717472==ERROR: AddressSanitizer: heap-use-after-free on address 0x503000abc8c0 at pc 0x7f68fa4b135e bp 0x7f67d641d190 sp 0x7f67d641d188
READ of size 8 at 0x503000abc8c0 thread T8 (QThread)
    #0 0x7f68fa4b135d in std::__shared_ptr<octave::load_path::dir_info, (__gnu_cxx::_Lock_policy)2>::operator bool() const /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/shared_ptr_base.h:1670:16
    #1 0x7f68fa491331 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:356:17
    #2 0x7f68fa4adb84 in octave::Fpath(octave::interpreter&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:2622:10
    #3 0x7f68f9b50ab3 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 0x7f68f9779445 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 0x7f68f985d3fc 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 0x7f68f9b94528 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 0x7f68f9b9b7d5 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 0x7f68f9b2ac9e 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 0x7f68f9bb7b62 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #10 0x7f68f9b2b958 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 0x7f68f9589392 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 0x7f68f9b32156 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 0x7f68f9b34ab0 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #14 0x7f68fa43d30f in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #15 0x7f68fa43a0a7 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #16 0x7f68fd9872bb in octave::interpreter_qobject::execute() /home/dima/src/dev/octave/clang_asan/../libgui/src/interpreter-qobject.cc:88:32
    #17 0x7f68fdaca749 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (octave::interpreter_qobject::*)()>::call(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:145:13
    #18 0x7f68fdaca58c in void QtPrivate::FunctionPointer<void (octave::interpreter_qobject::*)()>::call<QtPrivate::List<>, void>(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182:13
    #19 0x7f68fdaca427 in QtPrivate::QCallableObject<void (octave::interpreter_qobject::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:520:21
    #20 0x7f68fb7e305f in QObject::event(QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qobject.cpp:1437:31
    #21 0x7f68fc9c4d25 in QApplicationPrivate::notify_helper(QObject*, QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/widgets/kernel/qapplication.cpp:3296:31
    #22 0x7f68fdab3c33 in octave::octave_qapplication::notify(QObject*, QEvent*) /home/dima/src/dev/octave/clang_asan/../libgui/src/octave-qobject.cc:150:28
    #23 0x7f68fb790b57 in QCoreApplication::notifyInternal2(QObject*, QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qcoreapplication.cpp:1121:24
    #24 0x7f68fb794726 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qcoreapplication.cpp:1901:36
    #25 0x7f68fba44eb6 in postEventSourceDispatch /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:243:39
    #26 0x7f68f451af4e in g_main_context_dispatch (/lib64/libglib-2.0.so.0+0x54f4e) (BuildId: 1176d3bedb308fc2c848a95e1bfa25fddafae512)
    #27 0x7f68f4570267  (/lib64/libglib-2.0.so.0+0xaa267) (BuildId: 1176d3bedb308fc2c848a95e1bfa25fddafae512)
    #28 0x7f68f4518712 in g_main_context_iteration (/lib64/libglib-2.0.so.0+0x52712) (BuildId: 1176d3bedb308fc2c848a95e1bfa25fddafae512)
    #29 0x7f68fba4466d in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:393:43
    #30 0x7f68fb79d1ea in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qeventloop.cpp:182:22
    #31 0x7f68fb89e505 in QThread::exec() /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread.cpp:578:36
    #32 0x7f68fb931a37  /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:324:17
    #33 0x7f68fb931a37 in terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:260:27
    #34 0x7f68fb931a37 in QThreadPrivate::start(void*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:283:27
    #35 0x4c3b9c in asan_thread_start(void*) asan_interceptors.cpp.o
    #36 0x7f68f4c89e91 in start_thread (/lib64/libc.so.6+0x89e91) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)
    #37 0x7f68f4d0ef1f in __GI___clone3 (/lib64/libc.so.6+0x10ef1f) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)

0x503000abc8c0 is located 16 bytes inside of 32-byte region [0x503000abc8b0,0x503000abc8d0)
freed by thread T8 (QThread) here:
    #0 0x506da1 in operator delete(void*) (/home/dima/src/dev/octave/clang_asan/src/.libs/octave-gui+0x506da1) (BuildId: 4189cc74c0b6718a179c316220ebbbbace1423a4)
    #1 0x7f68fa447cbc in std::__new_allocator<std::_List_node<std::shared_ptr<octave::load_path::dir_info>>>::deallocate(std::_List_node<std::shared_ptr<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 0x7f68fa447c28 in std::allocator_traits<std::allocator<std::_List_node<std::shared_ptr<octave::load_path::dir_info>>>>::deallocate(std::allocator<std::_List_node<std::shared_ptr<octave::load_path::dir_info>>>&, std::_List_node<std::shared_ptr<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 0x7f68fa447c28 in std::__cxx11::_List_base<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::_M_put_node(std::_List_node<std::shared_ptr<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 0x7f68fa4b226f in std::__cxx11::list<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::_M_erase(std::_List_iterator<std::shared_ptr<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 0x7f68fa4b20f5 in std::__cxx11::list<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::erase(std::_List_const_iterator<std::shared_ptr<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 0x7f68fa49ef9c in octave::load_path::move(std::_List_iterator<std::shared_ptr<octave::load_path::dir_info>>, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:1063:23
    #7 0x7f68fa4937ae 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:1143:5
    #8 0x7f68fa492b76 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:377:5
    #9 0x7f68fa4aec81 in octave::Faddpath(octave::interpreter&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:2772:16
    #10 0x7f68f9b50ab3 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 0x7f68f9779445 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 0x7f68f985d3fc 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 0x7f68f9b94528 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 0x7f68f9b9b7d5 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 0x7f68f9b2ac9e 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 0x7f68f9bb7b62 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #17 0x7f68f9b2b958 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 0x7f68f9589392 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 0x7f68f9b51656 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 0x7f68f993cb55 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 0x7f68f993ca0c 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 0x7f68f9b46576 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 0x7f68fa440feb 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 0x7f68f9ab4d8a 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 0x7f68fa49e9a3 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:1004:5
    #26 0x7f68fa48f0ee 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:967:3
    #27 0x7f68fa48efa1 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 0x7f68fa48ef4c 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 0x7f68fa48eeec 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 0x7f68fa48edb4 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 T8 (QThread) here:
    #0 0x506521 in operator new(unsigned long) (/home/dima/src/dev/octave/clang_asan/src/.libs/octave-gui+0x506521) (BuildId: 4189cc74c0b6718a179c316220ebbbbace1423a4)
    #1 0x7f68fa4b3c87 in std::__new_allocator<std::_List_node<std::shared_ptr<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 0x7f68fa4b3a5c in std::allocator_traits<std::allocator<std::_List_node<std::shared_ptr<octave::load_path::dir_info>>>>::allocate(std::allocator<std::_List_node<std::shared_ptr<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 0x7f68fa4b3a5c in std::__cxx11::_List_base<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<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 0x7f68fa4b3897 in std::_List_node<std::shared_ptr<octave::load_path::dir_info>>* std::__cxx11::list<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::_M_create_node<std::shared_ptr<octave::load_path::dir_info> const&>(std::shared_ptr<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 0x7f68fa4b3794 in void std::__cxx11::list<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::_M_insert<std::shared_ptr<octave::load_path::dir_info> const&>(std::_List_iterator<std::shared_ptr<octave::load_path::dir_info>>, std::shared_ptr<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 0x7f68fa4b36d1 in std::__cxx11::list<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::push_front(std::shared_ptr<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 0x7f68fa49eff9 in octave::load_path::move(std::_List_iterator<std::shared_ptr<octave::load_path::dir_info>>, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:1068:25
    #8 0x7f68fa4937ae 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:1143:5
    #9 0x7f68fa492b29 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:370:5
    #10 0x7f68fa49120a 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 0x7f68fa4adb84 in octave::Fpath(octave::interpreter&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:2622:10
    #12 0x7f68f9b50ab3 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 0x7f68f9779445 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 0x7f68f985d3fc 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 0x7f68f9b94528 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 0x7f68f9b9b7d5 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 0x7f68f9b2ac9e 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 0x7f68f9bb7b62 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #19 0x7f68f9b2b958 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 0x7f68f9589392 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 0x7f68f9b32156 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 0x7f68f9b34ab0 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #23 0x7f68fa43d30f in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #24 0x7f68fa43a0a7 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #25 0x7f68fd9872bb in octave::interpreter_qobject::execute() /home/dima/src/dev/octave/clang_asan/../libgui/src/interpreter-qobject.cc:88:32
    #26 0x7f68fdaca749 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (octave::interpreter_qobject::*)()>::call(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:145:13
    #27 0x7f68fdaca58c in void QtPrivate::FunctionPointer<void (octave::interpreter_qobject::*)()>::call<QtPrivate::List<>, void>(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182:13
    #28 0x7f68fdaca427 in QtPrivate::QCallableObject<void (octave::interpreter_qobject::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:520:21
    #29 0x7f68fb7e305f in QObject::event(QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qobject.cpp:1437:31
    #30 0x7f68fc9c4d25 in QApplicationPrivate::notify_helper(QObject*, QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/widgets/kernel/qapplication.cpp:3296:31

Thread T8 (QThread) created by T0 here:
    #0 0x4ad355 in pthread_create (/home/dima/src/dev/octave/clang_asan/src/.libs/octave-gui+0x4ad355) (BuildId: 4189cc74c0b6718a179c316220ebbbbace1423a4)
    #1 0x7f68fb9313f4 in QThread::start(QThread::Priority) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:721:30

SUMMARY: AddressSanitizer: heap-use-after-free /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:356: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:
  0x503000abc600: fa fa 00 00 00 00 fa fa fd fd fd fa fa fa fd fd
  0x503000abc680: fd fd fa fa 00 00 00 fa fa fa 00 00 00 07 fa fa
  0x503000abc700: 00 00 00 fa fa fa 00 00 00 00 fa fa fd fd fd fa
  0x503000abc780: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd
  0x503000abc800: fd fd fa fa fd fd fd fd fa fa fd fd fd fa fa fa
=>0x503000abc880: fd fd fd fd fa fa fd fd[fd]fd fa fa fd fd fd fa
  0x503000abc900: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd
  0x503000abc980: fd fd fa fa fd fd fd fd fa fa fd fd fd fa fa fa
  0x503000abca00: fd fd fd fd fa fa fd fd fd fa fa fa fd fd fd fa
  0x503000abca80: fa fa 00 00 00 03 fa fa fd fd fd fa fa fa fd fd
  0x503000abcb00: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa
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
==1717472==ABORTING


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 25 Nov 2024 02:41:36 PM UTC, comment #4: 

It still crashes:

$ LSAN_OPTIONS="leak_check_at_exit=0" ./run-octave -qf
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

octave:1> version -hgid
ans = 4026749d3662+
octave:2> 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

=================================================================
==1715125==ERROR: AddressSanitizer: heap-use-after-free on address 0x503000ade460 at pc 0x7f44a56b135e bp 0x7f43816cd190 sp 0x7f43816cd188
READ of size 8 at 0x503000ade460 thread T8 (QThread)
    #0 0x7f44a56b135d in std::__shared_ptr<octave::load_path::dir_info, (__gnu_cxx::_Lock_policy)2>::operator bool() const /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/shared_ptr_base.h:1670:16
    #1 0x7f44a5691331 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:356:17
    #2 0x7f44a56adb84 in octave::Fpath(octave::interpreter&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:2622:10
    #3 0x7f44a4d50ab3 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 0x7f44a4979445 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 0x7f44a4a5d3fc 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 0x7f44a4d94528 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 0x7f44a4d9b7d5 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 0x7f44a4d2ac9e 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 0x7f44a4db7b62 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #10 0x7f44a4d2b958 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 0x7f44a4789392 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 0x7f44a4d32156 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 0x7f44a4d34ab0 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #14 0x7f44a563d30f in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #15 0x7f44a563a0a7 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #16 0x7f44a8b872bb in octave::interpreter_qobject::execute() /home/dima/src/dev/octave/clang_asan/../libgui/src/interpreter-qobject.cc:88:32
    #17 0x7f44a8cca749 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (octave::interpreter_qobject::*)()>::call(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:145:13
    #18 0x7f44a8cca58c in void QtPrivate::FunctionPointer<void (octave::interpreter_qobject::*)()>::call<QtPrivate::List<>, void>(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182:13
    #19 0x7f44a8cca427 in QtPrivate::QCallableObject<void (octave::interpreter_qobject::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:520:21
    #20 0x7f44a69e305f in QObject::event(QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qobject.cpp:1437:31
    #21 0x7f44a7bc4d25 in QApplicationPrivate::notify_helper(QObject*, QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/widgets/kernel/qapplication.cpp:3296:31
    #22 0x7f44a8cb3c33 in octave::octave_qapplication::notify(QObject*, QEvent*) /home/dima/src/dev/octave/clang_asan/../libgui/src/octave-qobject.cc:150:28
    #23 0x7f44a6990b57 in QCoreApplication::notifyInternal2(QObject*, QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qcoreapplication.cpp:1121:24
    #24 0x7f44a6994726 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qcoreapplication.cpp:1901:36
    #25 0x7f44a6c44eb6 in postEventSourceDispatch /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:243:39
    #26 0x7f449f71af4e in g_main_context_dispatch (/lib64/libglib-2.0.so.0+0x54f4e) (BuildId: 1176d3bedb308fc2c848a95e1bfa25fddafae512)
    #27 0x7f449f770267  (/lib64/libglib-2.0.so.0+0xaa267) (BuildId: 1176d3bedb308fc2c848a95e1bfa25fddafae512)
    #28 0x7f449f718712 in g_main_context_iteration (/lib64/libglib-2.0.so.0+0x52712) (BuildId: 1176d3bedb308fc2c848a95e1bfa25fddafae512)
    #29 0x7f44a6c4466d in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:393:43
    #30 0x7f44a699d1ea in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qeventloop.cpp:182:22
    #31 0x7f44a6a9e505 in QThread::exec() /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread.cpp:578:36
    #32 0x7f44a6b31a37  /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:324:17
    #33 0x7f44a6b31a37 in terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:260:27
    #34 0x7f44a6b31a37 in QThreadPrivate::start(void*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:283:27
    #35 0x4c3b9c in asan_thread_start(void*) asan_interceptors.cpp.o
    #36 0x7f449fe89e91 in start_thread (/lib64/libc.so.6+0x89e91) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)
    #37 0x7f449ff0ef1f in __GI___clone3 (/lib64/libc.so.6+0x10ef1f) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)

0x503000ade460 is located 16 bytes inside of 32-byte region [0x503000ade450,0x503000ade470)
freed by thread T8 (QThread) here:
    #0 0x506da1 in operator delete(void*) (/home/dima/src/dev/octave/clang_asan/src/.libs/octave-gui+0x506da1) (BuildId: 4189cc74c0b6718a179c316220ebbbbace1423a4)
    #1 0x7f44a5647cbc in std::__new_allocator<std::_List_node<std::shared_ptr<octave::load_path::dir_info>>>::deallocate(std::_List_node<std::shared_ptr<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 0x7f44a5647c28 in std::allocator_traits<std::allocator<std::_List_node<std::shared_ptr<octave::load_path::dir_info>>>>::deallocate(std::allocator<std::_List_node<std::shared_ptr<octave::load_path::dir_info>>>&, std::_List_node<std::shared_ptr<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 0x7f44a5647c28 in std::__cxx11::_List_base<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::_M_put_node(std::_List_node<std::shared_ptr<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 0x7f44a56b226f in std::__cxx11::list<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::_M_erase(std::_List_iterator<std::shared_ptr<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 0x7f44a56b20f5 in std::__cxx11::list<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::erase(std::_List_const_iterator<std::shared_ptr<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 0x7f44a569ef9c in octave::load_path::move(std::_List_iterator<std::shared_ptr<octave::load_path::dir_info>>, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:1063:23
    #7 0x7f44a56937ae 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:1143:5
    #8 0x7f44a5692b76 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:377:5
    #9 0x7f44a56aec81 in octave::Faddpath(octave::interpreter&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:2772:16
    #10 0x7f44a4d50ab3 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 0x7f44a4979445 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 0x7f44a4a5d3fc 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 0x7f44a4d94528 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 0x7f44a4d9b7d5 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 0x7f44a4d2ac9e 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 0x7f44a4db7b62 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #17 0x7f44a4d2b958 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 0x7f44a4789392 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 0x7f44a4d51656 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 0x7f44a4b3cb55 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 0x7f44a4b3ca0c 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 0x7f44a4d46576 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 0x7f44a5640feb 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 0x7f44a4cb4d8a 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 0x7f44a569e9a3 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:1004:5
    #26 0x7f44a568f0ee 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:967:3
    #27 0x7f44a568efa1 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 0x7f44a568ef4c 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 0x7f44a568eeec 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 0x7f44a568edb4 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 T8 (QThread) here:
    #0 0x506521 in operator new(unsigned long) (/home/dima/src/dev/octave/clang_asan/src/.libs/octave-gui+0x506521) (BuildId: 4189cc74c0b6718a179c316220ebbbbace1423a4)
    #1 0x7f44a56b3c87 in std::__new_allocator<std::_List_node<std::shared_ptr<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 0x7f44a56b3a5c in std::allocator_traits<std::allocator<std::_List_node<std::shared_ptr<octave::load_path::dir_info>>>>::allocate(std::allocator<std::_List_node<std::shared_ptr<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 0x7f44a56b3a5c in std::__cxx11::_List_base<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<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 0x7f44a56b3897 in std::_List_node<std::shared_ptr<octave::load_path::dir_info>>* std::__cxx11::list<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::_M_create_node<std::shared_ptr<octave::load_path::dir_info> const&>(std::shared_ptr<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 0x7f44a56b3794 in void std::__cxx11::list<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::_M_insert<std::shared_ptr<octave::load_path::dir_info> const&>(std::_List_iterator<std::shared_ptr<octave::load_path::dir_info>>, std::shared_ptr<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 0x7f44a56b36d1 in std::__cxx11::list<std::shared_ptr<octave::load_path::dir_info>, std::allocator<std::shared_ptr<octave::load_path::dir_info>>>::push_front(std::shared_ptr<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 0x7f44a569eff9 in octave::load_path::move(std::_List_iterator<std::shared_ptr<octave::load_path::dir_info>>, bool) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:1068:25
    #8 0x7f44a56937ae 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:1143:5
    #9 0x7f44a5692b29 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:370:5
    #10 0x7f44a569120a 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 0x7f44a56adb84 in octave::Fpath(octave::interpreter&, octave_value_list const&, int) /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:2622:10
    #12 0x7f44a4d50ab3 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 0x7f44a4979445 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 0x7f44a4a5d3fc 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 0x7f44a4d94528 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 0x7f44a4d9b7d5 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 0x7f44a4d2ac9e 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 0x7f44a4db7b62 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #19 0x7f44a4d2b958 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 0x7f44a4789392 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 0x7f44a4d32156 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 0x7f44a4d34ab0 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #23 0x7f44a563d30f in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #24 0x7f44a563a0a7 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #25 0x7f44a8b872bb in octave::interpreter_qobject::execute() /home/dima/src/dev/octave/clang_asan/../libgui/src/interpreter-qobject.cc:88:32
    #26 0x7f44a8cca749 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (octave::interpreter_qobject::*)()>::call(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:145:13
    #27 0x7f44a8cca58c in void QtPrivate::FunctionPointer<void (octave::interpreter_qobject::*)()>::call<QtPrivate::List<>, void>(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182:13
    #28 0x7f44a8cca427 in QtPrivate::QCallableObject<void (octave::interpreter_qobject::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:520:21
    #29 0x7f44a69e305f in QObject::event(QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qobject.cpp:1437:31
    #30 0x7f44a7bc4d25 in QApplicationPrivate::notify_helper(QObject*, QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/widgets/kernel/qapplication.cpp:3296:31

Thread T8 (QThread) created by T0 here:
    #0 0x4ad355 in pthread_create (/home/dima/src/dev/octave/clang_asan/src/.libs/octave-gui+0x4ad355) (BuildId: 4189cc74c0b6718a179c316220ebbbbace1423a4)
    #1 0x7f44a6b313f4 in QThread::start(QThread::Priority) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:721:30

SUMMARY: AddressSanitizer: heap-use-after-free /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/load-path.cc:356: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:
  0x503000ade180: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fd
  0x503000ade200: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd
  0x503000ade280: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa
  0x503000ade300: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fd
  0x503000ade380: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd
=>0x503000ade400: fd fd fa fa fd fd fd fd fa fa fd fd[fd]fd fa fa
  0x503000ade480: fd fd fd fa fa fa fd fd fd fd fa fa fd fd fd fa
  0x503000ade500: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd
  0x503000ade580: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa
  0x503000ade600: fd fd fd fd fa fa fd fd fd fa fa fa fd fd fd fa
  0x503000ade680: fa fa fd fd fd fa fa fa fd fd fd fd 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
==1715125==ABORTING


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 25 Nov 2024 02:33:12 PM UTC, comment #3: 

Does the attached patch make a difference?


(file #56644)

Markus Mützel <mmuetzel>
Group administrator
Sat 23 Nov 2024 12:24:15 AM UTC, comment #2: 

On MacOS with "normally" compiled binary:

% octave
GNU Octave, version 10.0.0
...
For changes from previous versions, type 'news'.

subdirs =
{
  [1,1] = junk1
  [1,2] = junk2
}

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

warning: addpath: /Users/dmitri/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: /Users/dmitri/scratch/junk2: No such file or directory
warning: called from
    ./PKG_ADD at line 2 column 1

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

fatal: caught signal Segmentation fault: 11 -- stopping myself...
zsh: segmentation fault  octave
%


System trace:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               octave-gui [42008]
Path:                  /usr/local/libexec/octave/10.0.0/exec/aarch64-apple-darwin24.1.0/octave-gui
Identifier:            octave-gui
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        zsh [640]
Responsible:           Terminal [472]
User ID:               501

Date/Time:             2024-11-22 19:19:43.1847 -0500
OS Version:            macOS 15.1.1 (24B2091)
Report Version:        12
Anonymous UUID:        3C16A2FF-44F6-F36D-F940-EC56D3EB3952


Time Awake Since Boot: 3900 seconds

System Integrity Protection: enabled

Crashed Thread:        2  QThread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000822
Exception Codes:       0x0000000000000001, 0x0000000000000822

VM Region Info: 0x822 is not in any region.  Bytes before following region: 4378294238
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->
      __TEXT                      104f78000-104f7c000    [   16K] r-x/r-x SM=COW  /usr/local/libexec/octave/10.0.0/exec/aarch64-apple-darwin24.1.0/octave-gui

Thread 0::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib                       0x19c7f1e34 mach_msg2_trap + 8
1   libsystem_kernel.dylib                       0x19c8045d0 mach_msg2_internal + 80
2   libsystem_kernel.dylib                       0x19c7fa9d8 mach_msg_overwrite + 480
3   libsystem_kernel.dylib                       0x19c7f217c mach_msg + 24
4   CoreFoundation                               0x19c919edc __CFRunLoopServiceMachPort + 160
5   CoreFoundation                               0x19c91873c __CFRunLoopRun + 1212
6   CoreFoundation                               0x19c917bc4 CFRunLoopRunSpecific + 588
7   HIToolbox                                    0x1a7d89f64 RunCurrentEventLoopInMode + 292
8   HIToolbox                                    0x1a7d8fd54 ReceiveNextEventCommon + 636
9   HIToolbox                                    0x1a7d8feb8 _BlockUntilNextEventMatchingListInModeWithFilter + 76
10  AppKit                                       0x1a044398c _DPSNextEvent + 660
11  AppKit                                       0x1a0d83ddc -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688
12  AppKit                                       0x1a0436a64 -[NSApplication run] + 480
13  libqcocoa.dylib                              0x10da173f4 QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1932
14  QtCore                                       0x10a9ff0c8 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 448
15  QtCore                                       0x10a9f8a24 QCoreApplication::exec() + 112
16  liboctgui.11.dylib                           0x1055e2140 octave::qt_application::execute() + 76
17  octave-gui                                   0x104f7b5a4 main + 1848
18  dyld                                         0x19c4b0274 start + 2840

Thread 1:
0   libsystem_pthread.dylib                      0x19c82e0e8 start_wqthread + 0

Thread 2 Crashed:: QThread
0   liboctave.11.dylib                           0x108f16788 octave::sys::file_ops::concat(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 44
1   liboctinterp.12.dylib                        0x107896b90 octave::load_path::execute_pkg_add_or_del(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 48
2   liboctinterp.12.dylib                        0x1078a1f4c std::__1::__function::__func<octave::load_path::load_path(octave::interpreter&)::$_0, std::__1::allocator<octave::load_path::load_path(octave::interpreter&)::$_0>, void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 60
3   liboctinterp.12.dylib                        0x1078905c8 octave::load_path::set(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool, bool) + 1192
4   liboctinterp.12.dylib                        0x10789faac octave::Fpath(octave::interpreter&, octave_value_list const&, int) + 236
5   liboctinterp.12.dylib                        0x1073d45a8 octave::tree_evaluator::execute_builtin_function(octave_builtin&, int, octave_value_list const&) + 632
6   liboctinterp.12.dylib                        0x1072b33a4 octave_function::call(octave::tree_evaluator&, int, octave_value_list const&) + 124
7   liboctinterp.12.dylib                        0x1073e89dc octave::tree_index_expression::evaluate_n(octave::tree_evaluator&, int) + 8012
8   liboctinterp.12.dylib                        0x1073e9a44 octave::tree_index_expression::evaluate(octave::tree_evaluator&, int) + 36
9   liboctinterp.12.dylib                        0x1073d7fc0 octave::tree_evaluator::visit_statement(octave::tree_statement&) + 448
10  liboctinterp.12.dylib                        0x1073d8628 octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) + 100
11  liboctinterp.12.dylib                        0x1073c156c octave::tree_evaluator::eval(std::__1::shared_ptr<octave::tree_statement_list>&, bool) + 36
12  liboctinterp.12.dylib                        0x1073c1e18 octave::tree_evaluator::repl() + 660
13  liboctinterp.12.dylib                        0x10786bee0 octave::interpreter::execute() + 340
14  liboctgui.11.dylib                           0x105589a0c octave::interpreter_qobject::execute() + 636
15  QtCore                                       0x10aa2c624 QObject::event(QEvent*) + 300
16  QtWidgets                                    0x10bbe3f28 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 272
17  QtWidgets                                    0x10bbe4e5c QApplication::notify(QObject*, QEvent*) + 516
18  liboctgui.11.dylib                           0x1055cfc94 octave::octave_qapplication::notify(QObject*, QEvent*) + 40
19  QtCore                                       0x10a9f84ec QCoreApplication::notifyInternal2(QObject*, QEvent*) + 204
20  QtCore                                       0x10a9f9214 QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 520
21  QtCore                                       0x10ab18f5c QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 68
22  QtCore                                       0x10a9ff0c8 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 448
23  QtCore                                       0x10aaa4c78 QThread::exec() + 156
24  QtCore                                       0x10ab177b8 QThreadPrivate::start(void*) + 336
25  libsystem_pthread.dylib                      0x19c8332e4 _pthread_start + 136
26  libsystem_pthread.dylib                      0x19c82e0fc thread_start + 8

Thread 3:
0   libsystem_kernel.dylib                       0x19c7fd840 __sigwait + 8
1   libsystem_pthread.dylib                      0x19c833a9c sigwait + 40
2   liboctave.11.dylib                           0x108f5e9f4 signal_watcher(void*) + 56
3   libsystem_pthread.dylib                      0x19c8332e4 _pthread_start + 136
4   libsystem_pthread.dylib                      0x19c82e0fc thread_start + 8

Thread 4:: com.apple.NSEventThread
0   libsystem_kernel.dylib                       0x19c7f1e34 mach_msg2_trap + 8
1   libsystem_kernel.dylib                       0x19c8045d0 mach_msg2_internal + 80
2   libsystem_kernel.dylib                       0x19c7fa9d8 mach_msg_overwrite + 480
3   libsystem_kernel.dylib                       0x19c7f217c mach_msg + 24
4   CoreFoundation                               0x19c919edc __CFRunLoopServiceMachPort + 160
5   CoreFoundation                               0x19c91873c __CFRunLoopRun + 1212
6   CoreFoundation                               0x19c917bc4 CFRunLoopRunSpecific + 588
7   AppKit                                       0x1a0568b10 _NSEventThread + 148
8   libsystem_pthread.dylib                      0x19c8332e4 _pthread_start + 136
9   libsystem_pthread.dylib                      0x19c82e0fc thread_start + 8


Thread 2 crashed with ARM Thread State (64-bit):
    x0: 0x000000000000080b   x1: 0x000000035c936038   x2: 0x000000035c936038   x3: 0x00006000028e0060
    x4: 0x0000000000001400   x5: 0x0000000000000012   x6: 0x0000000000001400   x7: 0x000000035c935430
    x8: 0x000000035c935ff8   x9: 0x00000000f362e031  x10: 0x0000000000000154  x11: 0x0000000000000030
   x12: 0x00000000000007fb  x13: 0x00000000000007fd  x14: 0x00000000f382e802  x15: 0x00000000f362e031
   x16: 0x0000000108f1675c  x17: 0x0000000000000002  x18: 0x0000000000000000  x19: 0x000000035c935ff8
   x20: 0x000000035c936038  x21: 0x000000000000080b  x22: 0x0000000107c7c7b8  x23: 0x000000010d1c90b0
   x24: 0x0000000000000001  x25: 0x0000600003206d80  x26: 0x000000010d1c90d0  x27: 0x0000000000000026
   x28: 0x0000600003207080   fp: 0x000000035c935fd0   lr: 0x0000000107896b90
    sp: 0x000000035c935f60   pc: 0x0000000108f16788 cpsr: 0x80000000
   far: 0x0000000000000000  esr: 0x56000080  Address size fault

Binary Images:
       0x104f78000 -        0x104f7bfff octave-gui (*) <4bb928ea-49cb-3396-9599-ad1ddb67da20> /usr/local/libexec/octave/10.0.0/exec/aarch64-apple-darwin24.1.0/octave-gui
       0x105474000 -        0x1057bbfff liboctgui.11.dylib (*) <86e00ee9-7f77-360a-8f9f-b80559a11d31> /usr/local/lib/octave/10.0.0/liboctgui.11.dylib
       0x104fa8000 -        0x104fb7fff liboctmex.1.dylib (*) <58761649-1ea8-38a8-8650-78ea87039cd4> /usr/local/lib/octave/10.0.0/liboctmex.1.dylib
       0x106e0c000 -        0x107c6ffff liboctinterp.12.dylib (*) <6c44d008-31ef-3d1a-b21c-0e9e5a2749e8> /usr/local/lib/octave/10.0.0/liboctinterp.12.dylib
       0x1082a4000 -        0x109073fff liboctave.11.dylib (*) <5347f852-8f94-3a3a-8e9c-d11b5384f3c3> /usr/local/lib/octave/10.0.0/liboctave.11.dylib
       0x10502c000 -        0x10506ffff libarpack.2.dylib (*) <cbb1758d-1a1d-3b03-b77a-34d60acf2f87> /opt/homebrew/*/libarpack.2.dylib
       0x104ffc000 -        0x10501ffff libqrupdate.1.1.dylib (*) <b6b86299-becb-3563-8b50-fc9f4064cc8f> /opt/homebrew/*/libqrupdate.1.1.dylib
       0x109528000 -        0x10a753fff libopenblasp-r0.3.28.dylib (*) <febe7d58-24c4-3158-b36f-6e041856621e> /opt/homebrew/*/libopenblasp-r0.3.28.dylib
       0x105114000 -        0x105187fff libpcre2-8.0.dylib (*) <107253e4-36a9-3ae5-af71-4714efb012dd> /opt/homebrew/*/libpcre2-8.0.dylib
       0x105978000 -        0x105ad7fff libgfortran.5.dylib (*) <7c51f167-308c-3862-9748-bf6ecab6c8d8> /opt/homebrew/*/libgfortran.5.dylib
       0x10519c000 -        0x1051dbfff libquadmath.0.dylib (*) <885f7c39-48e9-3017-8f97-e601529d7eeb> /opt/homebrew/*/libquadmath.0.dylib
       0x1051f8000 -        0x105223fff libreadline.8.2.dylib (*) <f465e032-b558-3f2a-b48f-905c5451f8ee> /opt/homebrew/*/libreadline.8.2.dylib
       0x105b54000 -        0x105c57fff libiconv.2.dylib (*) <a7bc2dd5-d32e-3110-9b0c-6ae9e8ed84ac> /opt/homebrew/*/libiconv.2.dylib
       0x105eb4000 -        0x10609bfff libqscintilla2_qt6.15.2.1.dylib (*) <1cfdd42f-dc2d-35b7-9e70-4ed266c8195e> /opt/homebrew/*/libqscintilla2_qt6.15.2.1.dylib
       0x10641c000 -        0x1066cffff libhdf5.310.5.0.dylib (*) <6931f609-b2a0-32d3-8fe4-7ceeda252733> /opt/homebrew/*/libhdf5.310.5.0.dylib
       0x105248000 -        0x105267fff libGraphicsMagick++.12.dylib (*) <e7dc994a-b662-3f7c-8200-f7643a22cf17> /opt/homebrew/*/libGraphicsMagick++.12.dylib
       0x105c74000 -        0x105d47fff libGraphicsMagick.3.dylib (*) <48fcd9cf-9269-3339-af30-d649152162c0> /opt/homebrew/*/libGraphicsMagick.3.dylib
       0x1052b4000 -        0x1052effff liblcms2.2.dylib (*) <51dd12a2-3e55-3503-8930-5fa1f8fad181> /opt/homebrew/*/liblcms2.2.dylib
       0x104fcc000 -        0x104fd3fff libltdl.7.dylib (*) <ada7d7a1-906d-389e-9f9a-2ad0b3a366ca> /opt/homebrew/*/libltdl.7.dylib
       0x1060f8000 -        0x106223fff libcholmod.5.3.0.dylib (*) <11e82a52-d9dd-351e-abb1-d2d9525d70bb> /opt/homebrew/*/libcholmod.5.3.0.dylib
       0x10530c000 -        0x10537bfff libumfpack.6.3.5.dylib (*) <e9756ec2-9612-354a-9306-4fbbaa2f4217> /opt/homebrew/*/libumfpack.6.3.5.dylib
       0x104fe4000 -        0x104feffff libamd.3.3.3.dylib (*) <33288323-87c0-38be-b604-158ad772f3fb> /opt/homebrew/*/libamd.3.3.3.dylib
       0x10508c000 -        0x105093fff libcamd.3.3.3.dylib (*) <fab70b42-7509-3bd2-b14c-3a983da80cfa> /opt/homebrew/*/libcamd.3.3.3.dylib
       0x1050a0000 -        0x1050a7fff libcolamd.3.3.4.dylib (*) <8fe6321b-3674-314f-aeda-187e08362fd1> /opt/homebrew/*/libcolamd.3.3.4.dylib
       0x1050b4000 -        0x1050bbfff libccolamd.3.3.4.dylib (*) <53963514-eccd-34db-8f9d-47e31d4a4041> /opt/homebrew/*/libccolamd.3.3.4.dylib
       0x105390000 -        0x1053abfff libcxsparse.4.4.1.dylib (*) <1ac4ba3c-0cc3-3312-949e-517bb8274162> /opt/homebrew/*/libcxsparse.4.4.1.dylib
       0x1050c8000 -        0x1050cbfff libsuitesparseconfig.7.8.3.dylib (*) <519f5200-9937-3665-ad08-9f7247649092> /opt/homebrew/*/libsuitesparseconfig.7.8.3.dylib
       0x105410000 -        0x105443fff libspqr.4.3.4.dylib (*) <995d2758-3a52-3782-bbb5-fac7569aef4f> /opt/homebrew/*/libspqr.4.3.4.dylib
       0x1050dc000 -        0x1050e3fff libfftw3_threads.3.dylib (*) <cc3407ce-4100-3e9a-9fa5-6acd08696477> /opt/homebrew/*/libfftw3_threads.3.dylib
       0x106254000 -        0x1062dbfff libfftw3.3.dylib (*) <08026bd3-02f5-301a-a46e-8277a32bd7f4> /opt/homebrew/*/libfftw3.3.dylib
       0x1050f4000 -        0x1050fbfff libfftw3f_threads.3.dylib (*) <f9dea154-bdaa-3184-ae67-260c413e9537> /opt/homebrew/*/libfftw3f_threads.3.dylib
       0x106300000 -        0x10638bfff libfftw3f.3.dylib (*) <afede373-66d5-360a-80aa-4a1892c032c3> /opt/homebrew/*/libfftw3f.3.dylib
       0x105d78000 -        0x105dabfff libfontconfig.1.dylib (*) <4eda5ace-197c-3100-bc7d-b98c922ee41e> /opt/homebrew/*/libfontconfig.1.dylib
       0x106744000 -        0x1067bffff libfreetype.6.dylib (*) <cfd169d0-526f-3a45-b5db-836906fec3d7> /opt/homebrew/*/libfreetype.6.dylib
       0x1053bc000 -        0x1053cffff libgl2ps.1.4.2.dylib (*) <316aa2bc-fe50-355c-8216-bbbced4fb5b7> /opt/homebrew/*/libgl2ps.1.4.2.dylib
       0x10a984000 -        0x10aceffff org.qt-project.QtCore (6.7) <6d5992f5-e692-35a9-8e1e-5241a90147cd> /opt/homebrew/*/QtCore.framework/Versions/A/QtCore
       0x105e20000 -        0x105e4ffff org.qt-project.QtCore5Compat (6.7) <e8d06c2f-a24e-38ea-a67d-45bdd980d12f> /opt/homebrew/*/QtCore5Compat.framework/Versions/A/QtCore5Compat
       0x105e7c000 -        0x105e93fff org.qt-project.QtXml (6.7) <bbb5e9e5-7efd-38d5-b6ae-472284407bbd> /opt/homebrew/*/QtXml.framework/Versions/A/QtXml
       0x10b570000 -        0x10b927fff org.qt-project.QtGui (6.7) <45cdc0a1-8da5-3076-bf06-bc3c3d062f5f> /opt/homebrew/*/QtGui.framework/Versions/A/QtGui
       0x10bbd8000 -        0x10bf6bfff org.qt-project.QtWidgets (6.7) <a846c516-92cc-3770-bb24-783ae419a5cc> /opt/homebrew/*/QtWidgets.framework/Versions/A/QtWidgets
       0x10686c000 -        0x1068a7fff org.qt-project.QtPrintSupport (6.7) <9f6bb56f-a8aa-3c57-9139-90e09ec97ab5> /opt/homebrew/*/QtPrintSupport.framework/Versions/A/QtPrintSupport
       0x106994000 -        0x1069e7fff org.qt-project.QtOpenGL (6.7) <e63012bb-891c-35ec-ac47-d1793cdcc450> /opt/homebrew/*/QtOpenGL.framework/Versions/A/QtOpenGL
       0x1053e0000 -        0x1053e7fff org.qt-project.QtOpenGLWidgets (6.7) <23ad4ad0-f318-33c7-a8be-d612cb1d1e0b> /opt/homebrew/*/QtOpenGLWidgets.framework/Versions/A/QtOpenGLWidgets
       0x106c0c000 -        0x106d03fff org.qt-project.QtNetwork (6.7) <a4f88419-667c-355f-b372-537e2cb5ba4a> /opt/homebrew/*/QtNetwork.framework/Versions/A/QtNetwork
       0x1063b0000 -        0x1063d3fff org.qt-project.QtSql (6.7) <8075ad02-4151-3d8d-b7a7-d7187c461e99> /opt/homebrew/*/QtSql.framework/Versions/A/QtSql
       0x106ad8000 -        0x106b27fff org.qt-project.QtHelp (6.7) <c71f0e56-fd22-3b9c-903d-9f389a4049b8> /opt/homebrew/*/QtHelp.framework/Versions/A/QtHelp
       0x10afc8000 -        0x10b03ffff libomp.dylib (*) <2a11e6cf-b742-34a8-8cf2-de82f61030a7> /opt/homebrew/*/libomp.dylib
       0x1067e4000 -        0x1067fbfff libgcc_s.1.1.dylib (*) <5d9ada6c-73ed-37c1-9f44-5fe69cfdf692> /opt/homebrew/*/libgcc_s.1.1.dylib
       0x106a34000 -        0x106a6bfff libmpi_usempif08.40.dylib (*) <20c946ba-e5fb-3841-a85a-28bef78a7d7b> /opt/homebrew/*/libmpi_usempif08.40.dylib
       0x105dc4000 -        0x105dcffff libmpi_usempi_ignore_tkr.40.dylib (*) <a6fde500-d77e-30a2-a23f-ead294cb4386> /opt/homebrew/*/libmpi_usempi_ignore_tkr.40.dylib
       0x106b7c000 -        0x106baffff libmpi_mpifh.40.dylib (*) <ce51b653-f106-3095-a3da-cbbe94df18b0> /opt/homebrew/*/libmpi_mpifh.40.dylib
       0x10c218000 -        0x10c3d3fff libmpi.40.dylib (*) <7c770a5c-dac3-31b3-8478-747619442977> /opt/homebrew/*/libmpi.40.dylib
       0x10af14000 -        0x10af53fff libgomp.1.dylib (*) <af1ab035-bc86-3da5-8ab7-a7f3bba671b3> /opt/homebrew/*/libgomp.1.dylib
       0x10b130000 -        0x10b1a3fff libopen-pal.80.dylib (*) <073b6717-82e8-3d25-88f7-de4862ac116d> /opt/homebrew/*/libopen-pal.80.dylib
       0x106818000 -        0x106833fff libevent_core-2.1.7.dylib (*) <5e1d8437-16fa-362b-a86c-ae128a38a900> /opt/homebrew/*/libevent_core-2.1.7.dylib
       0x105de0000 -        0x105de3fff libevent_pthreads-2.1.7.dylib (*) <033e949e-a5bd-37b4-b184-993b7b4b3de2> /opt/homebrew/*/libevent_pthreads-2.1.7.dylib
       0x10b080000 -        0x10b0b7fff libhwloc.15.dylib (*) <bce5f37b-9823-3c37-a3ca-ac232e18f938> /opt/homebrew/*/libhwloc.15.dylib
       0x10b384000 -        0x10b4c3fff libpmix.2.dylib (*) <740e0490-2226-3a75-9931-c679d93717a7> /opt/homebrew/*/libpmix.2.dylib
       0x105df4000 -        0x105dfbfff libsz.2.0.1.dylib (*) <9fcf3453-d1d5-3a7c-bace-c62e3e22b8d3> /opt/homebrew/*/libsz.2.0.1.dylib
       0x106928000 -        0x10694bfff libpng16.16.dylib (*) <867631e4-ec4f-3d9e-9220-5019e027ffac> /opt/homebrew/*/libpng16.16.dylib
       0x10c7d0000 -        0x10c97ffff libicui18n.76.1.dylib (*) <6d1450da-4c55-34cd-bab9-2143844eb566> /opt/homebrew/*/libicui18n.76.1.dylib
       0x10cad4000 -        0x10cc0bfff libicuuc.76.1.dylib (*) <19fbb9ed-0f01-3c34-8782-9056ebf2d195> /opt/homebrew/*/libicuuc.76.1.dylib
       0x10eb44000 -        0x1109a7fff libicudata.76.1.dylib (*) <882036bc-8453-31e0-b67c-2170c85c7271> /opt/homebrew/*/libicudata.76.1.dylib
       0x10c4cc000 -        0x10c5bbfff libglib-2.0.0.dylib (*) <881d8a98-8c3d-3ee0-9cd3-f19b7b986ba2> /opt/homebrew/*/libglib-2.0.0.dylib
       0x1063fc000 -        0x106407fff libdouble-conversion.3.3.0.dylib (*) <265c5ef6-9f50-379b-8148-16eb967378a5> /opt/homebrew/*/libdouble-conversion.3.3.0.dylib
       0x105e08000 -        0x105e0ffff libb2.1.dylib (*) <c4431360-2960-3e50-b699-3691771ade27> /opt/homebrew/*/libb2.1.dylib
       0x10b264000 -        0x10b2cffff libpcre2-16.0.dylib (*) <b9763fe9-0f90-3b3b-a845-66948b44695a> /opt/homebrew/*/libpcre2-16.0.dylib
       0x10c5f4000 -        0x10c67bfff libzstd.1.5.6.dylib (*) <f070d24c-56b5-394b-831d-191725bc4cba> /opt/homebrew/*/libzstd.1.5.6.dylib
       0x104f94000 -        0x104f97fff libgthread-2.0.0.dylib (*) <03e4b614-436a-3ea2-8792-41368a71f2b7> /opt/homebrew/*/libgthread-2.0.0.dylib
       0x10695c000 -        0x10696ffff libintl.8.dylib (*) <948d56d1-9337-3b1a-bff6-b8f26ce1e79d> /opt/homebrew/*/libintl.8.dylib
       0x10cc9c000 -        0x10cd03fff org.qt-project.QtDBus (6.7) <1e0da612-fafe-36ca-8c28-75fd9bdf03f3> /opt/homebrew/*/QtDBus.framework/Versions/A/QtDBus
       0x10cd88000 -        0x10ce3bfff libharfbuzz.0.dylib (*) <8dcf08ba-3866-3d91-b525-d516a0c5fc6f> /opt/homebrew/*/libharfbuzz.0.dylib
       0x1068f4000 -        0x1068fffff libmd4c.0.5.2.dylib (*) <bbb78130-97b1-3019-9bb2-db21119d3562> /opt/homebrew/*/libmd4c.0.5.2.dylib
       0x10b1e4000 -        0x10b213fff libdbus-1.3.dylib (*) <6c15f6c1-09f7-36cb-aab2-d98d5a6c082b> /opt/homebrew/*/libdbus-1.3.dylib
       0x106de8000 -        0x106dfbfff libgraphite2.3.2.1.dylib (*) <d07b94fc-f322-3e73-a5e0-727b6e8e8c90> /opt/homebrew/*/libgraphite2.3.2.1.dylib
       0x10690c000 -        0x106917fff libbrotlidec.1.1.0.dylib (*) <bd4019bd-853b-3046-a8c1-2ba01c634717> /opt/homebrew/*/libbrotlidec.1.1.0.dylib
       0x10af7c000 -        0x10af9bfff libbrotlicommon.1.1.0.dylib (*) <6a2719b4-3ad4-3c19-857f-a08abe547288> /opt/homebrew/*/libbrotlicommon.1.1.0.dylib
       0x10b528000 -        0x10b547fff com.apple.security.csparser (3.0) <db365164-e7d4-3315-a4bf-a306666f29d7> /System/Library/Frameworks/Security.framework/Versions/A/PlugIns/csparser.bundle/Contents/MacOS/csparser
       0x10da00000 -        0x10da8ffff libqcocoa.dylib (*) <1e9a635a-fe81-34bb-b7e7-db79d517be09> /opt/homebrew/*/libqcocoa.dylib
       0x10cea8000 -        0x10cec7fff libqmacstyle.dylib (*) <f9c6c5e4-3986-3857-a64a-24832489a0df> /opt/homebrew/*/libqmacstyle.dylib
       0x35c9e0000 -        0x35c9e7fff __init_gnuplot__.oct (*) <7adca5f3-5b60-3a76-8f90-9b2ec60e07ec> /usr/local/lib/octave/10.0.0/oct/aarch64-apple-darwin24.1.0/__init_gnuplot__.oct
       0x19c7f1000 -        0x19c82bff7 libsystem_kernel.dylib (*) <9fea25a4-e8ca-3f3d-901c-a53ff2bc7217> /usr/lib/system/libsystem_kernel.dylib
       0x19c89c000 -        0x19cd90fff com.apple.CoreFoundation (6.9) <ae4610f8-7c5c-3484-858e-cae7457d206e> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x1a7c7e000 -        0x1a7f85fff com.apple.HIToolbox (2.1.1) <7129a8bf-ce8b-39c6-8565-b280af625fac> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
       0x1a0409000 -        0x1a1804fff com.apple.AppKit (6.9) <f6d80158-7279-340b-81e7-94e875967778> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
       0x19c4aa000 -        0x19c52c7b7 dyld (*) <5ca59b26-65ac-3e9a-89bd-3ffd45a097c2> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
       0x19c82c000 -        0x19c838fff libsystem_pthread.dylib (*) <97366a98-0b27-364f-bf0e-395bf521343f> /usr/lib/system/libsystem_pthread.dylib

...


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sat 23 Nov 2024 12:15:07 AM UTC, comment #1: 

Somehow cut/paste eat some  parentheses.

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


Also file is attached.

Dmitri.
--


(file #56640)

Dmitri A. Sergatskov <dasergatskov>
Fri 22 Nov 2024 09:14:01 PM UTC, original submission:  

Make PKD_ADD in your current pwd.


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

Now (this is with octave 10, but it also present with 9.2.1)

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
    #3 0x7fa3de93aeb3 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 0x7fa3de563655 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 0x7fa3de64769c 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 0x7fa3de97e928 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 0x7fa3de985bd5 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 0x7fa3de91509e 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 0x7fa3de9a1f62 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #10 0x7fa3de915d58 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 0x7fa3de372fe2 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 0x7fa3de91c556 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 0x7fa3de91eeb0 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #14 0x7fa3df2275df in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #15 0x7fa3df224377 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #16 0x7fa3e258599b in octave::interpreter_qobject::execute() /home/dima/src/dev/octave/clang_asan/../libgui/src/interpreter-qobject.cc:88:32
    #17 0x7fa3e26c8e29 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (octave::interpreter_qobject::*)()>::call(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:145:13
    #18 0x7fa3e26c8c6c in void QtPrivate::FunctionPointer<void (octave::interpreter_qobject::*)()>::call<QtPrivate::List<>, void>(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182:13
    #19 0x7fa3e26c8b07 in QtPrivate::QCallableObject<void (octave::interpreter_qobject::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:520:21
    #20 0x7fa3e03e305f in QObject::event(QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qobject.cpp:1437:31
    #21 0x7fa3e15c4d25 in QApplicationPrivate::notify_helper(QObject*, QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/widgets/kernel/qapplication.cpp:3296:31
    #22 0x7fa3e26b2313 in octave::octave_qapplication::notify(QObject*, QEvent*) /home/dima/src/dev/octave/clang_asan/../libgui/src/octave-qobject.cc:150:28
    #23 0x7fa3e0390b57 in QCoreApplication::notifyInternal2(QObject*, QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qcoreapplication.cpp:1121:24
    #24 0x7fa3e0394726 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qcoreapplication.cpp:1901:36
    #25 0x7fa3e0644eb6 in postEventSourceDispatch /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:243:39
    #26 0x7fa3d911af4e in g_main_context_dispatch (/lib64/libglib-2.0.so.0+0x54f4e) (BuildId: 1176d3bedb308fc2c848a95e1bfa25fddafae512)
    #27 0x7fa3d9170267  (/lib64/libglib-2.0.so.0+0xaa267) (BuildId: 1176d3bedb308fc2c848a95e1bfa25fddafae512)
    #28 0x7fa3d9118712 in g_main_context_iteration (/lib64/libglib-2.0.so.0+0x52712) (BuildId: 1176d3bedb308fc2c848a95e1bfa25fddafae512)
    #29 0x7fa3e064466d in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:393:43
    #30 0x7fa3e039d1ea in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qeventloop.cpp:182:22
    #31 0x7fa3e049e505 in QThread::exec() /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread.cpp:578:36
    #32 0x7fa3e0531a37  /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:324:17
    #33 0x7fa3e0531a37 in terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:260:27
    #34 0x7fa3e0531a37 in QThreadPrivate::start(void*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:283:27
    #35 0x4c3b9c in asan_thread_start(void*) asan_interceptors.cpp.o
    #36 0x7fa3d9889e91 in start_thread (/lib64/libc.so.6+0x89e91) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)
    #37 0x7fa3d990ef1f in __GI___clone3 (/lib64/libc.so.6+0x10ef1f) (BuildId: af239b43625f9f643b9508992db71c3cfe45565f)

0x51300071cc80 is located 0 bytes inside of 344-byte region [0x51300071cc80,0x51300071cdd8)
freed by thread T8 (QThread) here:
    #0 0x506da1 in operator delete(void*) (/home/dima/src/dev/octave/clang_asan/src/.libs/octave-gui+0x506da1) (BuildId: 618eaf7f9e00e84506cb5b1c2d27557d70b94bd2)
    #1 0x7fa3df23279c 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 0x7fa3df231ef8 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 0x7fa3df231ef8 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 0x7fa3df29c27f 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 0x7fa3df29c105 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 0x7fa3df289895 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 0x7fa3df27e0bb 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 0x7fa3df27d606 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 0x7fa3df2995e1 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 0x7fa3de93aeb3 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 0x7fa3de563655 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 0x7fa3de64769c 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 0x7fa3de97e928 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 0x7fa3de985bd5 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 0x7fa3de91509e 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 0x7fa3de9a1f62 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #17 0x7fa3de915d58 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 0x7fa3de372fe2 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 0x7fa3de93ba56 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 0x7fa3de726dd5 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 0x7fa3de726c8c 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 0x7fa3de930976 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 0x7fa3df22b2bb 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 0x7fa3de89f18a 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 0x7fa3df289213 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 0x7fa3df279bce 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 0x7fa3df279a81 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 0x7fa3df279a2c 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 0x7fa3df2799cc 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 0x7fa3df279894 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 T8 (QThread) here:
    #0 0x506521 in operator new(unsigned long) (/home/dima/src/dev/octave/clang_asan/src/.libs/octave-gui+0x506521) (BuildId: 618eaf7f9e00e84506cb5b1c2d27557d70b94bd2)
    #1 0x7fa3df29fb27 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 0x7fa3df29f8fc 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 0x7fa3df29f8fc 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 0x7fa3df29f6ba 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 0x7fa3df29f5b4 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 0x7fa3df29d9a1 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 0x7fa3df2898f2 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 0x7fa3df27e0bb 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 0x7fa3df27d5b9 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 0x7fa3df27bcea 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 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
    #12 0x7fa3de93aeb3 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 0x7fa3de563655 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 0x7fa3de64769c 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 0x7fa3de97e928 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 0x7fa3de985bd5 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 0x7fa3de91509e 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 0x7fa3de9a1f62 in octave::tree_statement::accept(octave::tree_walker&) /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-stmt.h:125:8
    #19 0x7fa3de915d58 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 0x7fa3de372fe2 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 0x7fa3de91c556 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 0x7fa3de91eeb0 in octave::tree_evaluator::repl() /home/dima/src/dev/octave/clang_asan/../libinterp/parse-tree/pt-eval.cc:817:19
    #23 0x7fa3df2275df in octave::interpreter::main_loop() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:1336:22
    #24 0x7fa3df224377 in octave::interpreter::execute() /home/dima/src/dev/octave/clang_asan/../libinterp/corefcn/interpreter.cc:897:27
    #25 0x7fa3e258599b in octave::interpreter_qobject::execute() /home/dima/src/dev/octave/clang_asan/../libgui/src/interpreter-qobject.cc:88:32
    #26 0x7fa3e26c8e29 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (octave::interpreter_qobject::*)()>::call(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:145:13
    #27 0x7fa3e26c8c6c in void QtPrivate::FunctionPointer<void (octave::interpreter_qobject::*)()>::call<QtPrivate::List<>, void>(void (octave::interpreter_qobject::*)(), octave::interpreter_qobject*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182:13
    #28 0x7fa3e26c8b07 in QtPrivate::QCallableObject<void (octave::interpreter_qobject::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:520:21
    #29 0x7fa3e03e305f in QObject::event(QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/kernel/qobject.cpp:1437:31
    #30 0x7fa3e15c4d25 in QApplicationPrivate::notify_helper(QObject*, QEvent*) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/widgets/kernel/qapplication.cpp:3296:31

Thread T8 (QThread) created by T0 here:
    #0 0x4ad355 in pthread_create (/home/dima/src/dev/octave/clang_asan/src/.libs/octave-gui+0x4ad355) (BuildId: 618eaf7f9e00e84506cb5b1c2d27557d70b94bd2)
    #1 0x7fa3e05313f4 in QThread::start(QThread::Priority) /usr/src/debug/qt6-qtbase-6.6.2-1.el9.next.x86_64/src/corelib/thread/qthread_unix.cpp:721:30

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:
  0x51300071ca00: 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa fa
  0x51300071ca80: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x51300071cb00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x51300071cb80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x51300071cc00: fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x51300071cc80:[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x51300071cd00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x51300071cd80: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa
  0x51300071ce00: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x51300071ce80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x51300071cf00: 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
==885032==ABORTING


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 #56640:  PKG_ADD.gz added by dasergatskov (109B - 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 (Updated the item)
  • -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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-11-29 mmuetzel StatusNeed Info Ready For Test
        Planned ReleaseNone 9.3.0 (current stable)
    2024-11-28 mmuetzel Attached File- Added bug66477-path-pkgadd-hook-v4.patch, #56650
    2024-11-27 mmuetzel Attached File- Added bug66477-path-pkgadd-hook-v3.patch, #56649
    2024-11-27 mmuetzel StatusNone Need Info
    2024-11-25 mmuetzel Attached File- Added bug66477-path-pkgadd-hook-v2.patch, #56646
    2024-11-25 mmuetzel Attached File- Added bug66477-path-pkgadd-hook.patch, #56644
    2024-11-23 dasergatskov Attached File- Added PKG_ADD.gz, #56640

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code