Bug 1589460 - Octave aborts when exiting octave-cli with ^D
Summary: Octave aborts when exiting octave-cli with ^D
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: octave
Version: 28
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-09 20:19 UTC by Andrew Engelbrecht
Modified: 2018-11-12 00:38 UTC (History)
8 users (show)

Fixed In Version: octave-4.2.2-6.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-15 19:45:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Andrew Engelbrecht 2018-06-09 20:19:01 UTC
Description of problem:

When exiting octave-cli with ^D, the program prints an error, aborts and does not save history to .octave_hist. This is not a problem if the user types "exit" instead of ^D.

Version-Release number of selected component (if applicable):

octave-6:4.2.2-1.fc28.x86_64

How reproducible:

Always

Steps to Reproduce:
1. run: octave-cli
2. enter: A = [1,2;3,4;5,6]
3. type: ^D
4. type: echo $?
5. cat .octave_hist

Actual results:

The following error is printed to the console after typing ^D:

octave:2> /usr/include/c++/8/bits/basic_string.h:1048: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference = char&; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]: Assertion '__pos <= size()' failed.
panic: Aborted -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Aborted (core dumped)

The exit code is 134

Expected results:

graceful shutdown and saving the history to .octave_hist

Additional info:

Comment 1 Andrew Engelbrecht 2018-06-14 13:18:22 UTC
I compiled version 4.4.0 from source and it does not have this bug.

Comment 2 Susi Lehtola 2018-06-21 22:26:11 UTC
I just upgraded from Fedora 27 to Fedora 28 and I can confirm the same bug. Starting octave and exiting with Ctrl-D results in

octave:1> /usr/include/c++/8/bits/basic_string.h:1048: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference = char&; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]: Assertion '__pos <= size()' failed.
panic: Aborted -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Aborted (core dumped)

Comment 3 Susi Lehtola 2018-06-21 22:26:51 UTC
Could it be that some bug has been fixed in GCC since the F28 package was built?

Comment 4 Orion Poplawski 2018-06-22 02:50:34 UTC
Trying out a backport of a change to the code in question in 4.4.0.  Hopefully that will do the trick.  octave 4.2.2 has been rebuilt in rawhide recently and it still crashes, so I doubt it's gcc related.

Comment 5 Orion Poplawski 2018-06-23 03:33:26 UTC
I'm actually not convinced that this is fixed in 4.4.0.  We'll see when we get around to updating octave.

Comment 6 Susi Lehtola 2018-06-25 21:21:29 UTC
This could probably be fixed as simply as disabling the new -Wp,-D_GLIBCXX_ASSERTIONS default compile flag...

https://fedoraproject.org/wiki/Changes/HardeningFlags28

Comment 7 Susi Lehtola 2018-07-02 19:01:04 UTC
That is, the same fix has worked in other packages. The hardening flag in many cases makes code that runs properly crash.

Comment 8 Susi Lehtola 2018-07-11 08:46:32 UTC
Orion: could you build without the glibcxx assertions flag? It's rather annoying to get core and workspace dumps every time I do a quick command line calculation with Octave...

Comment 9 Fedora Update System 2018-07-16 13:08:17 UTC
octave-4.2.2-6.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2fce094752

Comment 10 Fedora Update System 2018-07-16 13:08:28 UTC
octave-4.2.2-6.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b97f35c5a3

Comment 11 Susi Lehtola 2018-07-16 14:11:48 UTC
Well, apparently Orion had already patched in a fix and built packages, so I just went ahead and submitted them as updates.

Comment 12 Fedora Update System 2018-07-16 18:05:54 UTC
octave-4.2.2-6.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-2fce094752

Comment 13 Fedora Update System 2018-07-16 20:30:03 UTC
octave-4.2.2-6.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-b97f35c5a3

Comment 14 Fedora Update System 2018-08-15 19:45:03 UTC
octave-4.2.2-6.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Orion Poplawski 2018-11-12 00:38:20 UTC
Upstream - https://savannah.gnu.org/bugs/index.php?55010


Note You need to log in before you can comment on or make changes to this bug.