bugGNU Octave - Bugs: bug #61415, Debug build causes build failure...

 
 

bug #61415: Debug build causes build failure from memory leaks

Submitter:  None
Submitted:  Tue 02 Nov 2021 01:12:13 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 27 Jan 2022 11:47:02 PM UTC, comment #5: 

It looks to me this change overwrites user supplied ASAN_OPTIONS.
E.g.:


ASAN_OPTIONS="help=1:verbosity=10" ./run-octave
...
octave:1> system("echo $ASAN_OPTIONS")
symbolize=1
ans = 0


Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Wed 10 Nov 2021 04:58:04 PM UTC, comment #4: 

I pushed the following changeset.  Works for me.

http://hg.savannah.gnu.org/hgweb/octave/rev/f816a8c44924

Closing report as fixed.

John W. Eaton <jwe>
Group administrator
Wed 10 Nov 2021 02:17:09 PM UTC, comment #3: 

Maybe we could set the appropriate ASAN_OPTIONS to suppress output and allow Octave to exit successfully when the build system runs it to generate figures?

John W. Eaton <jwe>
Group administrator
Sat 06 Nov 2021 04:44:51 PM UTC, comment #2: 

Those are known. You need to setup leak_check_at_exit=0
See https://wiki.octave.org/Finding_Memory_Leaks for details.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sat 06 Nov 2021 02:20:58 PM UTC, comment #1: 

The debug build still builds except for the documentation. If we start ./run-octave and type exit at the Octave prompt, many AddressSanitizer errors are printed like


Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7f081e980ca1 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x7f081c0e584a in octave::type_info::register_type(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&, octave_value const&, bool) ../libinterp/octave-value/ov-typeinfo.cc:156
    #2 0x7f081be0cf14 in octave_bool_matrix::register_type(octave::type_info&) ../libinterp/octave-value/ov-bool-mat.cc:70
    #3 0x7f081c13392a in install_types(octave::type_info&) ../libinterp/octave-value/ov.cc:3298
    #4 0x7f081c0e450f in octave::type_info::type_info(int) ../libinterp/octave-value/ov-typeinfo.cc:84
    #5 0x7f081cc0664d in octave::interpreter::interpreter(octave::application*) ../libinterp/corefcn/interpreter.cc:463
    #6 0x7f081b32b3db in octave::application::create_interpreter() ../libinterp/octave.cc:346
    #7 0x7f081deac573 in octave::interpreter_qobject::execute() ../libgui/src/interpreter-qobject.cc:51
    #8 0x7f081e1d5d72 in octave::interpreter_qobject::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) libgui/src/moc-interpreter-qobject.cc:88
    #9 0x7f0819638056 in QObject::event(QEvent*) (/usr/lib/libQt5Core.so.5+0x2f1056)
    #10 0x7f081a0eeff5 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/lib/libQt5Widgets.so.5+0x15aff5)


The sequence is like

1. An interpreter object is created at line 51 in libgui/src/interpreter-qobject.cc inside the function execute().

2. The interpreter object is shut down in line 97 but not deleted in that function. There is a comment block in lines 99-108 explaining that the GUI should delete it, so that the GUI can process pending events first.

3. It looks like the interpreter object is never formally deleted by the GUI even though it is not used after it has been shut down, so it looks to AddressSanitizer like it has leaked 8 bytes.

Anonymous
Tue 02 Nov 2021 01:12:13 PM UTC, original submission:  

Dear Octave maintainers,

I used the instructions at https://wiki.octave.org/Debugging_Octave and made a debug build like this.


mkdir build-dbg
cd build-dbg

CFLAGS="-g -ggdb" CXXFLAGS="-g -ggdb" FFLAGS="-g -ggdb" ../configure --enable-address-sanitizer-flags

make -j4 all


It goes up to "CXXLD src/octave-gui" and then generates many errors like "ERROR: LeakSanitizer: detected memory leaks" and the build stops.

Adding "--disable-docs" to the configure command prevents the build errors.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 dasergatskov (Posted a comment)
  •  

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

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-10 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-6965.
    Corresponding source code