bugGNU Octave - Bugs: bug #61713, uitable crashes with data...

 
 

bug #61713: uitable crashes with data containing []

Submitter:  Liang Tang <lt1234>
Submitted:  Tue 21 Dec 2021 10:35:32 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  4 - Important
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  lt1234 Open/Closed:  * Closed
Release:  * 7.0.90 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 23 Dec 2021 02:11:30 PM UTC, comment #9: 

Markus , For this particular issue, debugger is absolutely possible.  For the crash issues I ran into few months, I was hesitant at that time, mostly because of the computing constraints and the inability to identify any pattern before the crash. Without knowing a pattern, I could be goose chase quite slowly with a debugger.  

When I ran into crash situation that I could not trace, I did sense that graphics typically was actively being used, like contourf or copyobj.  But this is only a guess with no concrete demonstration.

I work around this particular issue by replacing [] with ' ' beforehand.  So a pre-release if not needed at this point.   

Thanks and happy holiday.

Liang Tang <lt1234>
Thu 23 Dec 2021 12:53:44 PM UTC, comment #8: 

@lt1234: If you are comfortable using a debugger you could attach gdb to Octave using the command `__debug_octave__` and try to reproduce the crash...

Markus Mützel <mmuetzel>
Group administrator
Thu 23 Dec 2021 12:50:25 PM UTC, comment #7: 

@1234 -- you can get pre-release build with this patch
from tomorrow (2021-12-24) at https://buildbot.octave.space/#/download

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 23 Dec 2021 11:37:11 AM UTC, comment #6: 

Thanks Markus for writing the patch and pushing. I just checked that both problematic codes from comment #0 and comment #3 now work.

Closing report as fixed.

Pantxo Diribarne <pantxo>
Group Member
Thu 23 Dec 2021 07:47:29 AM UTC, comment #5: 

Looks good to me.
@Pantxo: I pushed your proposed change with you as the author here:
https://hg.savannah.gnu.org/hgweb/octave/rev/97a3e7ba640d

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Wed 22 Dec 2021 07:48:02 PM UTC, comment #4: 

With the patch applied i cannot crash 7.0.1 with either example.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 22 Dec 2021 07:29:49 PM UTC, comment #3: 

Hi, just to make sure.  This line below also caused crash. 

gid=figure;  tbl = uitable (gid,'Data', {1, 2 ; 3, []});

In windows, I don't see trace and no core file, or I don't know where core files are at. 

Few months ago, I handled some 300 mb files within a gui I created. The gui has no compiled file or external interface, like java.  It is straight Octave and some additional functions. The gui crashed and brought down Octave together.  I could not find a way to look into the causes then.  There is no diary or similar functionalities to trace gui code execution.   Do you have any recommendation on how to set trap to catch this type of issues?

Liang Tang <lt1234>
Wed 22 Dec 2021 01:12:05 PM UTC, comment #2: 

The following simple change avoids the crash and displays an empty cell (2,2), as does ML online (sorry I can't write a proper mercurial cset ATM):


diff -r b65d423b12a6 libgui/graphics/Table.cc
--- a/libgui/graphics/Table.cc  Sun Dec 19 20:42:45 2021 +0100
+++ b/libgui/graphics/Table.cc  Wed Dec 22 14:06:17 2021 +0100
@@ -196,7 +196,12 @@
   {
     Qt::AlignmentFlag flag = Qt::AlignRight;
     QString text;
-    if (val.is_string ())
+    if (val.isempty ())
+      {
+        text = "";
+        flag = Qt::AlignLeft ;
+      }
+    else if (val.is_string ())
       {
         text = octave::Utils::fromStdString (val.string_value ());
         flag = Qt::AlignLeft ;


Pantxo Diribarne <pantxo>
Group Member
Tue 21 Dec 2021 02:56:57 PM UTC, comment #1: 

I can reproduce that on 7.0.1 (c8eb0f15fc5c (stable)) on linux


Thread 1 "lt-octave-gui" received signal SIGSEGV, Segmentation fault.
0x00007ffff77bd02e in octave::Object::slotRedraw (this=0x1770710) at ../libgui/graphics/Object.cc:138
138              redraw ();


Backtrace:

Thread 1 (Thread 0x7ffff7fa7c80 (LWP 3126484)):
#0  0x00007ffff77bd02e in octave::Object::slotRedraw() (this=0x1770710) at ../libgui/graphics/Object.cc:138
#1  0x00007ffff77aa1ba in octave::Figure::redraw() (this=0xb0e4d0) at ../libgui/graphics/Figure.cc:306
#2  0x00007ffff77bd030 in octave::Object::slotRedraw() (this=0xb0e4d0) at ../libgui/graphics/Object.cc:138
#3  0x00007ffff77bee9f in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (octave::Object::*)()>::call(void (octave::Object::*)(), octave::Object*, void**) (f=(void (octave::Object::*)(octave::Object * const)) 0x7ffff77bcf8e <octave::Object::slotRedraw()>, o=0xb0e4d0, arg=0x7fffb41f2eb8) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152
#4  0x00007ffff77bed9d in QtPrivate::FunctionPointer<void (octave::Object::*)()>::call<QtPrivate::List<>, void>(void (octave::Object::*)(), octave::Object*, void**) (f=(void (octave::Object::*)(octave::Object * const)) 0x7ffff77bcf8e <octave::Object::slotRedraw()>, o=0xb0e4d0, arg=0x7fffb41f2eb8) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185
#5  0x00007ffff77becc2 in QtPrivate::QSlotObject<void (octave::Object::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0xb4d2b0, r=0xb0e4d0, a=0x7fffb41f2eb8, ret=0x0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:418
#6  0x00007ffff34bdfd3 in QObject::event(QEvent*) () at /lib64/libQt5Core.so.5
#7  0x00007ffff43201e2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#8  0x00007ffff4326f90 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#9  0x00007ffff78c8a79 in octave::octave_qapplication::notify(QObject*, QEvent*) (this=0x71cd10, receiver=0xb0e4d0, ev=0x7fffb41f2e70) at ../libgui/src/octave-qobject.cc:146
#10 0x00007ffff34916f2 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#11 0x00007ffff34944e1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib64/libQt5Core.so.5
#12 0x00007ffff34e5eb7 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQt5Core.so.5
#13 0x00007fffe564f9b6 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#14 0x00007fffe564fd78 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#15 0x00007fffe564fe10 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#16 0x00007ffff34e5c64 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#17 0x00007ffff34903eb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#18 0x00007ffff3498844 in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#19 0x00007ffff78ca554 in octave::base_qobject::exec() (this=0x7fffffffc4e0) at ../libgui/src/octave-qobject.cc:430
#20 0x00007ffff78e1085 in octave::qt_application::execute() (this=0x7fffffffc6f0) at ../libgui/src/qt-application.cc:73
#21 0x000000000040199d in main(int, char**) (argc=8, argv=0x7fffffffca38) at ../src/main-gui.cc:132


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 21 Dec 2021 10:35:32 AM UTC, original submission:  

I can cause Octave to crash with the line below:

gid=figure;  tbl = uitable (gid,'Data', {'a' 'b'; 'c', []});

In 5.2.0, Octave would issue an error message which I don't understand what it means.

Liang Tang <lt1234>

 

(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 mmuetzel (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by lt1234 (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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-23 pantxo StatusPatch Submitted Fixed
    2021-12-23 pantxo StatusReady For Test Patch Submitted
        Open/ClosedOpen Closed
    2021-12-23 mmuetzel StatusIn Progress Ready For Test
        Release6.3.0 7.0.90
    2021-12-22 pantxo CategoryOctave Function Plotting with OpenGL
        Severity3 - Normal 4 - Important
        StatusNone In Progress
        Operating SystemMicrosoft Windows Any

    Back to the top

    Powered by Savane 3.13-f14d.
    Corresponding source code