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:
I compiled version 4.4.0 from source and it does not have this bug.
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)
Could it be that some bug has been fixed in GCC since the F28 package was built?
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.
I'm actually not convinced that this is fixed in 4.4.0. We'll see when we get around to updating octave.
This could probably be fixed as simply as disabling the new -Wp,-D_GLIBCXX_ASSERTIONS default compile flag... https://fedoraproject.org/wiki/Changes/HardeningFlags28
That is, the same fix has worked in other packages. The hardening flag in many cases makes code that runs properly crash.
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...
octave-4.2.2-6.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2fce094752
octave-4.2.2-6.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b97f35c5a3
Well, apparently Orion had already patched in a fix and built packages, so I just went ahead and submitted them as updates.
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
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
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.
Upstream - https://savannah.gnu.org/bugs/index.php?55010