bugGNU Octave - Bugs: bug #52244, fftw test failure crashes Octave...

 
 

bug #52244: fftw test failure crashes Octave when built with Intel compiler

Submitter:  None
Submitted:  Tue 17 Oct 2017 09:39:00 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  3 - Low Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Edward Anderson Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 01 Feb 2018 01:19:31 AM UTC, comment #8: 

I pushed a change on the default branch to report an error to avoid this crash https://hg.savannah.gnu.org/hgweb/octave/rev/02989d7d68dc

Mike Miller <mtmiller>
Group Member
Fri 20 Oct 2017 06:07:31 PM UTC, comment #7: 

I think it would be preferable for Octave to raise an error if the function returns a null pointer. This would at least avoid the crash, but would continue to indicate that the function is not behaving the way it's supposed to.

Mike Miller <mtmiller>
Group Member
Fri 20 Oct 2017 06:03:25 PM UTC, comment #6: 

It appears that Intel MKL contains a wrapper routine called fftw_export_wisdom_to_string that returns NULL because this functionality is not supported in MKL. So NULL is a value that should be expected if linking with MKL is allowed.

Edward Anderson <eca>
Fri 20 Oct 2017 04:26:51 PM UTC, comment #5: 

Should it be an error if fftw_export_wisdom_to_string returns nullptr, or should we just silently return ""?  I agree with Mike that it appears that the only way this can happen is if malloc fails.  Is that actually what's happening on your system?  If so, then why?  How large is the block of memory that it is trying to allocate?  Maybe this indicates some other bug like an uninitialized value?

John W. Eaton <jwe>
Group administrator
Wed 18 Oct 2017 05:19:58 PM UTC, comment #4: 

The error still occurs with run-octave -cli or run-octave --no-gui-libs.

jwe's suggested fix resolves the problem. Thanks for the quick response.

Edward Anderson <eca>
Tue 17 Oct 2017 10:52:46 PM UTC, comment #3: 

From inspection, that function can only return a null pointer if malloc fails.

https://github.com/FFTW/fftw3/blob/master/api/export-wisdom-to-string.c

So if the return value is a null pointer, that's probably not something we should silently ignore.

Mike Miller <mtmiller>
Group Member
Tue 17 Oct 2017 10:40:05 PM UTC, comment #2: 

If Mike is right, then the attached change should fix it.

But should that function ever return nullptr?  Is that an error or an expected result?

In any case, it's probably not a bad idea to check that the result is valid before passing it to the std::string constructor.

(file #42186)

John W. Eaton <jwe>
Group administrator
Tue 17 Oct 2017 10:11:28 PM UTC, comment #1: 

Thanks for reporting this bug. Can you provide a backtrace showing where the error occurs? Can you verify that it also occurs when the Qt library is not loaded at all by running "run-octave -cli" or "run-octave --no-gui-libs"?

If I had to take a wild guess it may be that the function fftw_export_wisdom_to_string is returning a null pointer instead of a valid character array.

Mike Miller <mtmiller>
Group Member
Tue 17 Oct 2017 09:39:00 PM UTC, original submission:  

The fftw test in my build of Octave fails with signal 6 from the GUI, or as follows from the CLI:


% run-octave --no-gui
GNU Octave, version 4.2.1
etc.
octave:1> test fftw
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid
panic: Aborted -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Abort


I used Intel 17 on a RedHat 7 system and took the kitchen sink approach to building Octave, including every possible option. My configure line was

./configure --prefix=/usr/local/apps/octave-4.2.1/intel-17.0 --with-amd-includedir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/include --with-amd-libdir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/lib --with-arpack-includedir=/usr/local/apps/ARPACK/intel-17.0/include --with-arpack-libdir=/usr/local/apps/ARPACK/intel-17.0/lib --with-camd-includedir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/include --with-camdlibdir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/lib --with-ccolamd-includedir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/include --with-ccolamd-libdir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/lib --with-cholmod-includedir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/include --with-cholmod-libdir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/lib --with-colamd-includedir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/include --with-colamd-libdir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/lib --with-cxsparse-includedir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/include --with-cxsparse-libdir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/lib --with-fftw3-includedir=/usr/local/apps/fftw-3.3.6/intel-17.0/include --with-fftw3-libdir=/usr/local/apps/fftw-3.3.6/intel-17.0/lib --with-fltk-prefix=/usr/local/apps/fltk-1.3.4 --with-glpk-includedir=/usr/local/apps/glpk-4.62/include --with-glpk-libdir=/usr/local/apps/glpk-4.62/lib --with-hdf5-includedir=/usr/local/apps/hdf5-1.8.18/intel-17.0/include --with-hdf5-libdir=/usr/local/apps/hdf5-1.8.18/intel-17.0/lib --with-qhull-includedir=/usr/local/apps/qhull/include --with-qhull-libdir=/usr/local/apps/qhull/lib --with-qrupdate-libdir=/usr/local/apps/qrupdate-1.1.2/intel-17.0/lib --with-umfpack-includedir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/include --with-umfpack-libdir=/usr/local/apps/SuiteSparse-4.5.5/intel-17.0/lib --with-blas=-mkl=sequential --with-lapack=-mkl=sequential

FFTW was built from source with the configure line

 ./configure --prefix=/usr/local/apps/fftw-3.3.6/intel-17.0 --with-pic --enable-avx2

FFTW passed its checks before installation, and Octave built successfully. I see the same error in the Octave FFTW test with similar configure lines going back to Octave 4.0.2.


Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #42186:  diffs.txt added by jwe (1KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by eca (Posted a comment)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by None (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
    2018-02-11 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-02-01 mtmiller StatusWorks For Me Ready For Test
    2017-10-17 jwe Attached File- Added diffs.txt, #42186
        CategoryTest Suite Octave Function
    2017-10-17 mtmiller Priority5 - Normal 3 - Low
        StatusNone Works For Me
        Summaryfftw test failure fftw test failure crashes Octave when built with Intel compiler

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code