[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN
From: |
Dmitri A. Sergatskov |
Subject: |
[Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN |
Date: |
Tue, 1 Nov 2022 21:07:52 -0400 (EDT) |
Follow-up Comment #1, bug #63303 (project octave):
The actual crash has nothing to do with bsxfun.
octave:1> a = ones (2, 2, 2)
a =
ans(:,:,1) =
1 1
1 1
ans(:,:,2) =
1 1
1 1
octave:2> b = 2 * ones (2, 1)
b =
2
2
octave:3> a .*= b
=================================================================
==558249==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x6020003469e0 at pc 0x7f1d1df8dddf bp 0x7f1bffd39590 sp 0x7f1bffd39588
READ of size 8 at 0x6020003469e0 thread T7 (QThread)
#0 0x7f1d1df8ddde in void do_inplace_bsxfun_op<double,
double>(Array<double, std::allocator<double> >&, Array<double,
std::allocator<double> > const&, void (*)(unsigned long, double*, double
const*), void (*)(unsigned long, double*, double))
../liboctave/numeric/bsxfun-defs.cc:185
#1 0x7f1d1df8bd0d in Array<double, std::allocator<double> >&
do_mm_inplace_op<double, double>(Array<double, std::allocator<double> >&,
Array<double, std::allocator<double> > const&, void (*)(unsigned long,
double*, double const*), void (*)(unsigned long, double*, double), char
const*) ../liboctave/operators/mx-inlines.cc:552
#2 0x7f1d1df85d1b in MArray<double>& product_eq<double>(MArray<double>&,
MArray<double> const&)
(/home/dima/src/octave/gcc_asan/liboctave/.libs/liboctave.so.9+0xb85d1b)
#3 0x7f1d2171daaa in product_eq(NDArray&, NDArray const&)
(/home/dima/src/octave/gcc_asan/libinterp/.libs/liboctinterp.so.10+0xb1daaa)
#4 0x7f1d2171cd52 in oct_assignop_assign_el_mul
../libinterp/operators/op-m-m.cc:163
#5 0x7f1d21ed98c9 in octave_value::assign(octave_value::assign_op,
octave_value const&) ../libinterp/octave-value/ov.cc:1701
#6 0x7f1d220457dd in octave::stack_frame::assign(octave_value::assign_op,
octave::symbol_record const&, std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::__cxx11::list<octave_value_list, std::allocator<octave_value_list> >
const&, octave_value const&)
(/home/dima/src/octave/gcc_asan/libinterp/.libs/liboctinterp.so.10+0x14457dd)
#7 0x7f1d220438af in
octave::octave_lvalue::assign(octave_value::assign_op, octave_value const&)
../libinterp/parse-tree/oct-lvalue.cc:59
#8 0x7f1d220bfe66 in
octave::tree_simple_assignment::evaluate(octave::tree_evaluator&, int)
../libinterp/parse-tree/pt-assign.cc:116
#9 0x7f1d220fa997 in
octave::tree_evaluator::visit_statement(octave::tree_statement&)
../libinterp/parse-tree/pt-eval.cc:3940
#10 0x7f1d2215fd66 in octave::tree_statement::accept(octave::tree_walker&)
../libinterp/parse-tree/pt-stmt.h:124
#11 0x7f1d220fb4e6 in
octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&)
../libinterp/parse-tree/pt-eval.cc:4025
#12 0x7f1d21c14000 in
octave::tree_statement_list::accept(octave::tree_walker&)
../libinterp/parse-tree/pt-stmt.h:201
#13 0x7f1d220e1555 in
octave::tree_evaluator::eval(std::shared_ptr<octave::tree_statement_list>&,
bool) ../libinterp/parse-tree/pt-eval.cc:985
#14 0x7f1d220e0243 in octave::tree_evaluator::repl()
../libinterp/parse-tree/pt-eval.cc:804
#15 0x7f1d229d50e0 in octave::interpreter::main_loop()
../libinterp/corefcn/interpreter.cc:1350
#16 0x7f1d229c7b8e in octave::interpreter::execute()
../libinterp/corefcn/interpreter.cc:916
#17 0x7f1d23c5bfec in octave::interpreter_qobject::execute()
../libgui/src/interpreter-qobject.cc:89
#18 0x7f1d23f8d844 in
octave::interpreter_qobject::qt_static_metacall(QObject*, QMetaObject::Call,
int, void**) libgui/src/moc-interpreter-qobject.cc:88
#19 0x7f1d1f2d1338 in QObject::event(QEvent*)
(/lib64/libQt5Core.so.5+0x2d1338)
#20 0x7f1d1ffae442 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) (/lib64/libQt5Widgets.so.5+0x1ae442)
#21 0x7f1d23da395a in octave::octave_qapplication::notify(QObject*,
QEvent*) ../libgui/src/octave-qobject.cc:148
#22 0x7f1d1f2a6be7 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
(/lib64/libQt5Core.so.5+0x2a6be7)
#23 0x7f1d1f2aa155 in QCoreApplicationPrivate::sendPostedEvents(QObject*,
int, QThreadData*) (/lib64/libQt5Core.so.5+0x2aa155)
#24 0x7f1d1f2f84e6 in postEventSourceDispatch(_GSource*, int (*)(void*),
void*) (/lib64/libQt5Core.so.5+0x2f84e6)
#25 0x7f1d1a7280ae in g_main_context_dispatch
(/lib64/libglib-2.0.so.0+0x550ae)
#26 0x7f1d1a77d307 in g_main_context_iterate.constprop.0
(/lib64/libglib-2.0.so.0+0xaa307)
#27 0x7f1d1a7258a2 in g_main_context_iteration
(/lib64/libglib-2.0.so.0+0x528a2)
#28 0x7f1d1f2f7f87 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
(/lib64/libQt5Core.so.5+0x2f7f87)
#29 0x7f1d1f2a55f1 in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
(/lib64/libQt5Core.so.5+0x2a55f1)
#30 0x7f1d1f0e8349 in QThread::exec() (/lib64/libQt5Core.so.5+0xe8349)
#31 0x7f1d1f0e9545 in QThreadPrivate::start(void*)
(/lib64/libQt5Core.so.5+0xe9545)
#32 0x7f1d1b29f821 in start_thread (/lib64/libc.so.6+0x9f821)
#33 0x7f1d1b23f44f in clone3 (/lib64/libc.so.6+0x3f44f)
0x6020003469e0 is located 0 bytes to the right of 16-byte region
[0x6020003469d0,0x6020003469e0)
allocated by thread T7 (QThread) here:
#0 0x7f1d248b01e7 in operator new[](unsigned long)
(/lib64/libasan.so.6+0xb01e7)
#1 0x7f1d1d7eb557 in dim_vector::dim_vector(dim_vector const&)
../liboctave/array/dim-vector.h:191
#2 0x7f1d1df8d80e in void do_inplace_bsxfun_op<double,
double>(Array<double, std::allocator<double> >&, Array<double,
std::allocator<double> > const&, void (*)(unsigned long, double*, double
const*), void (*)(unsigned long, double*, double))
../liboctave/numeric/bsxfun-defs.cc:147
#3 0x7f1d1df8bd0d in Array<double, std::allocator<double> >&
do_mm_inplace_op<double, double>(Array<double, std::allocator<double> >&,
Array<double, std::allocator<double> > const&, void (*)(unsigned long,
double*, double const*), void (*)(unsigned long, double*, double), char
const*) ../liboctave/operators/mx-inlines.cc:552
#4 0x7f1d1df85d1b in MArray<double>& product_eq<double>(MArray<double>&,
MArray<double> const&)
(/home/dima/src/octave/gcc_asan/liboctave/.libs/liboctave.so.9+0xb85d1b)
#5 0x7f1d2171daaa in product_eq(NDArray&, NDArray const&)
(/home/dima/src/octave/gcc_asan/libinterp/.libs/liboctinterp.so.10+0xb1daaa)
#6 0x7f1d2171cd52 in oct_assignop_assign_el_mul
../libinterp/operators/op-m-m.cc:163
#7 0x7f1d21ed98c9 in octave_value::assign(octave_value::assign_op,
octave_value const&) ../libinterp/octave-value/ov.cc:1701
#8 0x7f1d220457dd in octave::stack_frame::assign(octave_value::assign_op,
octave::symbol_record const&, std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::__cxx11::list<octave_value_list, std::allocator<octave_value_list> >
const&, octave_value const&)
(/home/dima/src/octave/gcc_asan/libinterp/.libs/liboctinterp.so.10+0x14457dd)
#9 0x7f1d220438af in
octave::octave_lvalue::assign(octave_value::assign_op, octave_value const&)
../libinterp/parse-tree/oct-lvalue.cc:59
#10 0x7f1d220bfe66 in
octave::tree_simple_assignment::evaluate(octave::tree_evaluator&, int)
../libinterp/parse-tree/pt-assign.cc:116
#11 0x7f1d220fa997 in
octave::tree_evaluator::visit_statement(octave::tree_statement&)
../libinterp/parse-tree/pt-eval.cc:3940
#12 0x7f1d2215fd66 in octave::tree_statement::accept(octave::tree_walker&)
../libinterp/parse-tree/pt-stmt.h:124
#13 0x7f1d220fb4e6 in
octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&)
../libinterp/parse-tree/pt-eval.cc:4025
#14 0x7f1d21c14000 in
octave::tree_statement_list::accept(octave::tree_walker&)
../libinterp/parse-tree/pt-stmt.h:201
#15 0x7f1d220e1555 in
octave::tree_evaluator::eval(std::shared_ptr<octave::tree_statement_list>&,
bool) ../libinterp/parse-tree/pt-eval.cc:985
#16 0x7f1d220e0243 in octave::tree_evaluator::repl()
../libinterp/parse-tree/pt-eval.cc:804
#17 0x7f1d229d50e0 in octave::interpreter::main_loop()
../libinterp/corefcn/interpreter.cc:1350
#18 0x7f1d229c7b8e in octave::interpreter::execute()
../libinterp/corefcn/interpreter.cc:916
#19 0x7f1d23c5bfec in octave::interpreter_qobject::execute()
../libgui/src/interpreter-qobject.cc:89
#20 0x7f1d23f8d844 in
octave::interpreter_qobject::qt_static_metacall(QObject*, QMetaObject::Call,
int, void**) libgui/src/moc-interpreter-qobject.cc:88
#21 0x7f1d1f2d1338 in QObject::event(QEvent*)
(/lib64/libQt5Core.so.5+0x2d1338)
#22 0x7f1d1ffae442 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) (/lib64/libQt5Widgets.so.5+0x1ae442)
Thread T7 (QThread) created by T0 here:
#0 0x7f1d24856866 in pthread_create (/lib64/libasan.so.6+0x56866)
#1 0x7f1d1f0e8fd4 in QThread::start(QThread::Priority)
(/lib64/libQt5Core.so.5+0xe8fd4)
SUMMARY: AddressSanitizer: heap-buffer-overflow
../liboctave/numeric/bsxfun-defs.cc:185 in void do_inplace_bsxfun_op<double,
double>(Array<double, std::allocator<double> >&, Array<double,
std::allocator<double> > const&, void (*)(unsigned long, double*, double
const*), void (*)(unsigned long, double*, double))
Shadow bytes around the buggy address:
0x0c0480060ce0: fa fa 00 00 fa fa fd fd fa fa fd fd fa fa fd fd
0x0c0480060cf0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
0x0c0480060d00: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
0x0c0480060d10: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
0x0c0480060d20: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
=>0x0c0480060d30: fa fa fd fd fa fa fd fd fa fa 00 00[fa]fa 00 00
0x0c0480060d40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0480060d50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0480060d60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0480060d70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0480060d80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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
Shadow gap: cc
==558249==ABORTING
Dmitri.
--
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63303>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, Dmitri A. Sergatskov, 2022/11/01
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN,
Dmitri A. Sergatskov <=
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, Markus Mützel, 2022/11/02
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, John W. Eaton, 2022/11/02
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, Dmitri A. Sergatskov, 2022/11/02
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, Dmitri A. Sergatskov, 2022/11/02
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, Markus Mützel, 2022/11/02
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, Markus Mützel, 2022/11/02
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, Dmitri A. Sergatskov, 2022/11/02
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, Markus Mützel, 2022/11/02
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, Dmitri A. Sergatskov, 2022/11/02
- [Octave-bug-tracker] [bug #63303] test bsxfun.cc-tst coredumps with ASAN, Markus Mützel, 2022/11/03