bugGNU Octave - Bugs: bug #40693, GUI occasionally blocks on...

 
 

bug #40693: GUI occasionally blocks on QClipboard when exiting

Submitter:  Mike Miller <mtmiller>
Submitted:  Sun 24 Nov 2013 08:40:13 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  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

Sun 26 Jan 2014 05:52:22 PM UTC, comment #8: 

Yes, thank you. I get the exact same behavior from qtcreator in gnome-shell with some largish text copied to the clipboard.

Sorry for the noise, this is clearly not an Octave GUI bug.

Mike Miller <mtmiller>
Group Member
Sun 26 Jan 2014 08:55:45 AM UTC, comment #7: 

Things seem to be different in Unity:


$ xsel -b | wc
  16068   68647  494697
$ ./run-octave --force-gui
$ xsel -b | wc
  16068   68647  494697


and octave exists without warning message.

When I copy a little bit more (500 KB?) I can paste this without problem but executing xsel leads to


$ xsel -b | wc
      0       0       0


The clipboard is cleared by xsel and occasionally, the editor geany from which I copied the data shuts down when xsel is executed.
I can run and exit octave with a clipboard of this size (without executing xsel) without problems and the clipboard still contains the data afterwards. Obviously, there is a problem with the clipboard, too, but it does not interfere with octave.

Does the effect show up on your system with other qt-applications (qt-creator or so)?

Torsten Lilge <ttl>
Group Member
Sat 25 Jan 2014 10:20:50 PM UTC, comment #6: 

Note that all I am doing in the GUI is to hit Ctrl-D to exit immediately when the GUI comes up.

Mike Miller <mtmiller>
Group Member
Sat 25 Jan 2014 10:19:17 PM UTC, comment #5: 

Ok, good digging. I can make it happen reliably by copying a large quantity of text to the X clipboard buffer before starting the GUI.

So there's something odd going on here between Octave's GUI and the GNOME desktop environment that I work with. The gnome-settings-daemon process is the clipboard manager for the session. I also use the xsel command-line tool to interact with the X selection and clipboard buffers.

Based on your suggestion, here's what I see happening between Octave and GNOME:


$ cat /usr/share/common-licenses/GPL | xsel -b
$ xsel -b | wc
    674    5647   35162
$ ./run-octave
Warning: QClipboard: Unable to receive an event from the clipboard manager in a reasonable time
$ xsel -b | wc
      0       0       0


So not only do I see this delay when the Octave GUI exits and the Qt error message about timing out on the clipboard, but the clipboard buffer has also been cleared, either by Octave or by GNOME in response to Octave running. If I run other applications, the clipboard keeps its contents as it should.

If I do the same thing under a different window manager with a different clipboard manager, I don't see this message and the clipboard does not get cleared.

For all I know this might be a GNOME bug, until we can get confirmation under KDE or Unity or another desktop environment.

Mike Miller <mtmiller>
Group Member
Sat 25 Jan 2014 02:17:17 PM UTC, comment #4: 

Does this bug report
https://bugreports.qt-project.org/browse/QTBUG-32853
describes your issue, i.e. does the warning appear when you have copied a large amount of data to the clipboard?

Torsten Lilge <ttl>
Group Member
Sun 24 Nov 2013 09:47:06 PM UTC, comment #3: 

I managed to catch this in gdb. For what it's worth, here is what the stack looks like while it is stuck in this waiting to exit state:


#0  0x00007f5a2b10f843 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f5a2a5c6e38 in QX11Data::clipboardWaitForEvent (this=<optimized out>,
    win=win@entry=39845892, type=type@entry=31, event=event@entry=0x7fff1f1e4e50,
    timeout=timeout@entry=10000, checkManager=checkManager@entry=true)
    at kernel/qclipboard_x11.cpp:596
#2  0x00007f5a2a5c9ac0 in QClipboard::event (this=<optimized out>, e=<optimized out>)
    at kernel/qclipboard_x11.cpp:945
#3  0x00007f5a2a54b75c in QApplicationPrivate::notify_helper (this=this@entry=0x1306c00,
    receiver=receiver@entry=0x1704360, e=e@entry=0x7fff1f1e5180)
    at kernel/qapplication.cpp:4567
#4  0x00007f5a2a551dd0 in QApplication::notify (this=0x7fff1f1e5240, receiver=0x1704360,
    e=0x7fff1f1e5180) at kernel/qapplication.cpp:4353
#5  0x00007f5a29cd333d in QCoreApplication::notifyInternal (this=0x7fff1f1e5240,
    receiver=0x1704360, event=event@entry=0x7fff1f1e5180) at kernel/qcoreapplication.cpp:949
#6  0x00007f5a2a54c272 in sendEvent (event=0x7fff1f1e5180, receiver=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#7  QApplication::~QApplication (this=0x7fff1f1e5240, __in_chrg=<optimized out>)
    at kernel/qapplication.cpp:1111
#8  0x00007f5a2e38d105 in octave_start_gui (argc=8, argv=<optimized out>,
    start_gui=<optimized out>) at ../../libgui/src/octave-gui.cc:185
#9  0x00007f5a2b04f995 in __libc_start_main (main=0x400950 <main(int, char**)>, argc=8,
    ubp_av=0x7fff1f1e54e8, init=<optimized out>, fini=<optimized out>,
    rtld_fini=<optimized out>, stack_end=0x7fff1f1e54d8) at libc-start.c:260
#10 0x00000000004009df in _start ()


Of course none of this looks like any of our code is responsible for this problem, but I never saw this behavior until yesterday I think.

Mike Miller <mtmiller>
Group Member
Sun 24 Nov 2013 08:52:57 PM UTC, comment #2: 

It happens both with ./run-octave and with octave or octave-gui after running make install.

Mike Miller <mtmiller>
Group Member
Sun 24 Nov 2013 08:43:13 PM UTC, comment #1: 

Do you start octave by run-octave or by installed binaries?

Torsten Lilge <ttl>
Group Member
Sun 24 Nov 2013 08:40:13 PM UTC, original submission:  

I can't figure out how to reproduce this reliably, but occasionally I get a condition where the GUI takes several seconds to exit and return control to my shell. It doesn't matter whether I run octave or octave-gui. After about 10 seconds I get the following message


Warning: QClipboard: Unable to receive an event from the clipboard manager in a reasonable time


and the process then exits and returns to the shell.

When this happens, I can restart the GUI several times and I get the same message and the same wait time on every time I exit. Since it says something about the clipboard, I tried selecting text with my mouse and that seems to return it to a normal state of returning immediately on exit.

Mike Miller <mtmiller>
Group Member

 

(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 ttl (Posted a comment)
  • -email is unavailable- added by mtmiller (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
    2014-01-26 mtmiller StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code