bugGNU Octave - Bugs: bug #53704, Segfault in Octave

 
 

bug #53704: Segfault in Octave

Submitter:  Melvin Robinson <melrobin>
Submitted:  Fri 20 Apr 2018 01:07:58 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Works For Me Assigned to:  None
Originator Name:  Melvin Robinson Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 28 Apr 2018 05:04:17 AM UTC, comment #18: 

I built a newer version of Qt 5 than my package manager supported and installed on my Fedora 25 system and am no longer getting the segfault.  The version installed at the time of this report was Qt 5.7 and I upgraded to 5.10. 

This can be closed as invalid.  Thanks to all for your help.

Melvin Robinson <melrobin>
Wed 25 Apr 2018 02:43:54 AM UTC, comment #17: 


--with-blas="-L/usr/lib64/atlas -ltatlas" --with-lapack="-L/usr/lib64/atlas -ltatlas"


Sorry for the typo.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 25 Apr 2018 02:41:07 AM UTC, comment #16: 

Also this is irrelevant to the original issue, but since ~2013
(which is way before Fedora 24) Fedora started to include libtatlas (for threaded library) and libsatatlas (serial).
So there should be no libatlas and your -latals should fail
and it would build against either openblas or reference blas.
Also the library in /usr/lib64/atlas/ directory which is not in the standard path. So you need to do



--with-blas="-L/usr/lib64/atals -ltatlas" --with-lapack="-L/usr/lib64/atals -ltatlas"


the "--with-lapack" parameter may be redundant, but should not hurt.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 25 Apr 2018 01:33:38 AM UTC, comment #15: 

This is sounding more and more like a an issue that is specific to one system.  It appears to be upstream in Qt libraries.

A next thought might be to try using the non-proprietary driver for Nvidia.  It isn't a long term solution, since you need CUDA, but it would determine if the proprietary drivers are at fault.

Rik <rik5>
Group administrator
Wed 25 Apr 2018 12:29:47 AM UTC, comment #14: 

I want to upgrade to Fedora 27, but the default compiler is gcc 7 which is not supported by CUDA yet. 

Unfortunately LD_PRELOAD=/usr/lib64/libGLX_mesa.so.0 did not help with the segfault.  The segfault information makes it seems as though the rep variable was somehow corrupted, but I don't know what this variable means.

Melvin Robinson <melrobin>
Wed 25 Apr 2018 12:20:42 AM UTC, comment #13: 

Fedora 25 is actually EOL / unsupported now, you should probably update to 26 or 27.

I think several people have had problems with the proprietary Nvidia graphics drivers, and I don't really know how that interacts with OpenGL over remoted X connections or VNCs.

You might try running Octave with ​LD_PRELOAD=/usr/lib64/libGLX_mesa.so.0 in your environment.

Mike Miller <mtmiller>
Group Member
Wed 25 Apr 2018 12:11:23 AM UTC, comment #12: 

I cleared out those relics of old Octave installations that you mentioned and still get the segfault when exiting Octave.

I am building against Qt5 and ATLAS.  Here is my configure line:  ./configure --with-qt=5 --with-lapack=-latlas --with-blas=-latlas.

I have never been able to successfully build against MKL, but am willing to try it. 

My graphics drivers are the proprietary NVIDIA Linux drivers--version 390.48.  I run CUDA 9.1 and CUDNN 7.1.

I connected to my machine with a VNC connection, so it was not actually on the console, but I can get physically to the machine if you think it could help narrow things down a bit.

I have used numerous X clients: Xming, VcXsrv on the Windows side, Fedora 21 from the Linux side and XQuartz on my Macs. 

The Octave machine runs Fedora 25.  These problems only arose recently and the Qt5 libraries have not been updated due to the fact that Fedora 25 is long in the tooth.  In fact, nothing from a system level has been updated...that is sudo dnf update returns nothing.

Melvin Robinson <melrobin>
Tue 24 Apr 2018 11:37:52 PM UTC, comment #11: 

You mentioned Fedora earlier, which version of Fedora are you compiling Octave on, how are you configuring it, and are you using any additional third-party libraries with Octave (cuda, mkl, Intel compiler, etc)? What graphics device and driver does this system have? Are you building with Qt 5 or Qt 4?

In a previous bug report (bug #53285) you had a problem with leftover cruft from a previous install. Have you tried deleting '/usr/local/bin/mkoct*', '/usr/local/bin/octave*', /usr/local/include/octave-*', /usr/local/lib/octave', '/usr/local/libexec/octave', '/usr/local/share/octave' and 'make install' again?

Yes, the correct way to start the GUI is to run 'octave --gui', this is mentioned in the NEWS file for version 4.4 (etc/NEWS.4 in the development repository).

Mike Miller <mtmiller>
Group Member
Tue 24 Apr 2018 11:33:48 PM UTC, comment #10: 

It's confirmatory.  The library where the segfault is originating is being linked in indirectly through Qt.  The CLI version of Octave doesn't link against Qt and avoids the problem.

When you say you ran Octave on the console, does that mean you went to the remote machine and ran a console on it and it failed?

Rik <rik5>
Group administrator
Tue 24 Apr 2018 11:13:09 PM UTC, comment #9: 

I ran Octave on the console and it did segfault...even with the --norc option.  The CLI version does not fail.  Should the GUI start upon invoking Octave?  The only way to get a GUI is to run octave --gui

The default behavior a few months ago was to start up in the GUI.

Melvin Robinson <melrobin>
Tue 24 Apr 2018 06:46:48 PM UTC, comment #8: 

If this is a remote machine that you access through ssh, can you physically go to the machine and see whether Octave fails?

The -X and -Y options both involve X11 libraries.  It may be a problem with X forwarding over ssh, rather than a true Octave problem.  Certainly, if it works on the actual machine (test above), and it works with regular ssh, then I would be suspicious.

Is there any difference if you run with the "--norc" option?  This would disable reading all initialization files.

What happens if you run the CLI version of Octave which doesn't have Qt libraries linked in?  Try /usr/local/bin/octave-cli-5.0.0.


Rik <rik5>
Group administrator
Mon 23 Apr 2018 10:01:15 PM UTC, comment #7: 

Have some new information...this segfault occurs when connecting to the machine using ssh -Y or ssh -X.  It does not fail when using plain ssh.

Melvin Robinson <melrobin>
Fri 20 Apr 2018 01:39:28 PM UTC, comment #6: 

I do have some packages that I use, but as you mentioned I can simply start octave and then quit.  See the session below with the --no-init-file option.  I also ran with the --no-gui option and get the same crash.

Reading symbols from octave...done.
(gdb) run --no-init-file
Starting program: /usr/local/bin/octave --no-init-file
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
process 6818 is executing new program: /usr/local/libexec/octave/5.0.0/exec/x86_64-pc-linux-gnu/octave-gui
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffd6acd700 (LWP 6827)]
[New Thread 0x7fffd5ca0700 (LWP 6837)]
[New Thread 0x7fffd549f700 (LWP 6838)]
[New Thread 0x7fffd4b9c700 (LWP 6839)]
GNU Octave, version 5.0.0
Copyright (C) 2018 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> quit
[Thread 0x7fffd5ca0700 (LWP 6837) exited]
[Thread 0x7fffd6acd700 (LWP 6827) exited]
[Thread 0x7fffd549f700 (LWP 6838) exited]

Thread 1 "octave-gui" received signal SIGSEGV, Segmentation fault.
Array<int>::~Array (
    this=0x7fffec1655e0 <lucene::index::SegmentTermPositionVector::EMPTY_TERM_POS>, __in_chrg=<optimized out>) at ./liboctave/array/Array.h:307
307         if (--rep->count == 0)
(gdb)

Melvin Robinson <melrobin>
Fri 20 Apr 2018 01:15:41 PM UTC, comment #5: 

What provokes the crash?  Simply starting Octave and exiting with "quit"?

Do you load any external packages?  If so, which ones?

What happens if you start Octave with the --no-init-file option?

John W. Eaton <jwe>
Group administrator
Fri 20 Apr 2018 11:16:49 AM UTC, comment #4: 

I deleted /lib64/libclucene.so.3 and tried to rebuild.  This failed with error messages similar to the following:
/usr/lib64/libQt5CLucene.so.5: undefined reference to `lucene::index::IndexReader::setNorm(int, wchar_t const*, float)'


Melvin Robinson <melrobin>
Fri 20 Apr 2018 11:10:56 AM UTC, comment #3: 

I tried to remove the clucene package in Fedora and rebuild, but still get the same backtrace.

Melvin Robinson <melrobin>
Fri 20 Apr 2018 04:49:03 AM UTC, comment #2: 

I can't reproduce this with Octave 5 rev affd44707573. Is something actually pulling in libclucene.so.3? That seems wrong, among other things.

Mike Miller <mtmiller>
Group Member
Fri 20 Apr 2018 01:36:17 AM UTC, comment #1: 

Here is a backtrace of the segfault:
(gdb) bt
#0  0x00007ffff6d67b5b in Array<int>::~Array() (this=0x7fffec1655e0 <lucene::index::SegmentTermPositionVector::EMPTY_TERM_POS>, __in_chrg=<optimized out>)
    at ./liboctave/array/Array.h:307
#1  0x00007fffecab774a in __cxa_finalize (d=0x7fffec15b0f0)
    at cxa_finalize.c:56
#2  0x00007fffebeca133 in __do_global_dtors_aux () at /lib64/libclucene.so.3
#3  0x00007fffffffdff0 in  ()
#4  0x00007ffff7de84ea in _dl_fini () at dl-fini.c:235
(gdb)

Melvin Robinson <melrobin>
Fri 20 Apr 2018 01:07:58 AM UTC, original submission:  

While troubleshooting a problem with building Octave which I have narrowed down to build of documentation I came across a segfault when running the latest development version.  The gdb session is shown below.  This does not seem like a valid value for slice_len, but other elements such as rep may be corrupted.  The same sort of error in Array.h occurs when building the documentation as well.

Starting program: /usr/local/libexec/octave/5.0.0/exec/x86_64-pc-linux-gnu/octave-gui
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffd6acc700 (LWP 27020)]
[New Thread 0x7fffd5c9f700 (LWP 27021)]
[New Thread 0x7fffd549e700 (LWP 27022)]
[New Thread 0x7fffd4b9b700 (LWP 27023)]
GNU Octave, version 5.0.0
Copyright (C) 2018 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> quit
[Thread 0x7fffd5c9f700 (LWP 27021) exited]
[Thread 0x7fffd6acc700 (LWP 27020) exited]
[Thread 0x7fffd549e700 (LWP 27022) exited]

Thread 1 "octave-gui" received signal SIGSEGV, Segmentation fault.
Array<int>::~Array (
    this=0x7fffec1655e0 <lucene::index::SegmentTermPositionVector::EMPTY_TERM_POS>, __in_chrg=<optimized out>) at ./liboctave/array/Array.h:307
307         if (--rep->count == 0)
(gdb) p *this
$2 = {_vptr.Array = 0x7ffff7826938 <vtable for Array<int>+16>, dimensions = {
    rep = 0x1}, rep = 0x0, slice_data = 0x0, slice_len = 140737154241192}

Melvin Robinson <melrobin>

 

(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 dasergatskov (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by melrobin (Submitted the item)
  •  

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

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-28 rik5 Open/ClosedOpen Closed
    2018-04-20 mtmiller StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code