bugGNU Octave - Bugs: bug #56143, gui hangs on osx when switching...

 
 

bug #56143: gui hangs on osx when switching between windows

Submitter:  None
Submitted:  Tue 16 Apr 2019 06:16:14 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  eflister Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 5.1.0
Operating System:  * Mac OS Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 13 May 2021 07:23:28 AM UTC, comment #18: 

No reports that this is still an issue on macOS after a few months.

Closing as fixed.

If this is still an issue, we can reopen this bug.

Markus Mützel <mmuetzel>
Group administrator
Thu 12 Nov 2020 03:44:02 PM UTC, comment #17: 

Hard to say. In my testing, I have not noticed any freeziness with the Octave 6 Release Candidate, so it may well be fixed. But I haven't spent all that much time with it yet.

Here's the Octave.app 6.0.90 Release Candidate build 1 if anyone else wants to test it out on Mac: https://github.com/octave-app/octave-app/releases/tag/v6.0.90-rc1

Andrew Janke <apjanke>
Thu 12 Nov 2020 03:40:31 PM UTC, comment #16: 

I read that the release candidate for Octave 6 is less "hang-y" on Mac.
Is this particular bug still an issue with the release candidate?

Markus Mützel <mmuetzel>
Group administrator
Fri 11 Sep 2020 03:29:09 PM UTC, comment #15: 

I built a diagnosis tool leveraging ktrace facility in Mac. The tool reports the main thread is waiting to write to ptmx after hundreds of successful writes. The parameters to all the write system call are identical(fd -> /dev/ptmx, same cbuf and nbytes = 3).

By comparison, it reports the difference on the main thread and QThread between the normal execution and the hang. Normally the main thread will be woken up by the QThread, and therefore the write syscall returns success. However, when the spinning beachball appears, the wakeup is missing.

On the Qthread side, it emits wakeup after pselect and read in normal execution. Right before the hang, it starts writing to /dev/ttys00X, and is blocked after hundreds of successful writes(parameters are identical too).

I suspect if there is a deadlock between the two threads and hope the information could provide some hints.

argus <anonymous4argus>
Fri 22 May 2020 05:32:21 PM UTC, comment #14: 

Still seeing this. Octave installed with Mac ports.


GNU Octave, version 5.2.0
Copyright (C) 2020 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.

Octave was configured for "x86_64-apple-darwin19.4.0".


Anonymous
Wed 17 Apr 2019 10:35:09 PM UTC, comment #13: 

the tabs that switch among open files in the editor also sometimes miss the mouse up.  i suspect whatever is handling mouse/keyboard events is slow and buggy.

eflister <eflister>
Wed 17 Apr 2019 05:01:54 PM UTC, comment #12: 

Oh, I forgot that we made that change.  I think it was done because the interpreter processes events when waiting for input, but only if readline is used so we decided to require it.

Hmm.

I guess maybe it is time for my plans to replace the terminal widget to become less of a long-term wish and more of a priority project...

John W. Eaton <jwe>
Group administrator
Wed 17 Apr 2019 04:12:17 PM UTC, comment #11: 


> Can the hang on startup problem still happen if you start Octave with the --no-line-editing option?


Can't do this, apparently.


$ octave --gui --no-line-editing
error: --gui and --no-line-editing are mutually exclusive options


The hang never occurs in the CLI as far as I can tell, only in the GUI, so it's not meaningful to test it without --gui here.

Andrew Janke <apjanke>
Wed 17 Apr 2019 04:01:36 PM UTC, comment #10: 

maybe a longshot, but slow event handling makes me think it is related -- mouse up events seem to be missed very frequently. when clicking the mouse to place the cursor somewhere in the editor, it often acts as if i have started a selection but not finished it, so that a bunch of unintended code is highlighted as i move the mouse away as if it never got the up click.  similarly normal mousing around frequently unintentionally selects a bunch of code and drags it elsewhere.  typing is often very laggy as the completion popup menu struggles to keep up.

eflister <eflister>
Wed 17 Apr 2019 01:44:06 PM UTC, comment #9: 

Can the hang on startup problem still happen if you start Octave with the --no-line-editing option?  Disabling readline is not a real solution, but it could tell us if the problem really is due to attempting to write to the terminal at the wrong time.

John W. Eaton <jwe>
Group administrator
Wed 17 Apr 2019 01:37:20 PM UTC, comment #8: 

I don't know whether it is causing Octave to hang, but it appears that readline has already read some character that is bound to forward-char, rl_dispatch_subseq has called the forward-char function but it can't move forward (already at EOL?) and is stopped when writing the bell character (using rl_ding) to the terminal.  If this happens on startup, then I'm not sure why.  Is Octave somehow picking up some spurious input when it doesn't expect to see anything and is then calling rl_ding at a point when writing output will block?

John W. Eaton <jwe>
Group administrator
Wed 17 Apr 2019 10:04:14 AM UTC, comment #7: 

One more spindump; this one I got myself using a Homebrew-installed Octave 5.1.0 from homebrew/core instead of Octave.app: https://github.com/octave-app/octave-app/files/3088998/octave.5.1.0.beachball.on.startup.-.brewed.-.apjanke.-.spindump.txt.zip

Andrew Janke <apjanke>
Wed 17 Apr 2019 07:12:56 AM UTC, comment #6: 


> do i get that from running `port installed`?


Yep, that's what I was interested in.

Here's "octave 5.1.0 hang on launch spindumps - 2019-04-16.zip" which contains spindumps from eflister and another user who reported Octave.app 5.1.0 hangs. https://github.com/octave-app/octave-app/files/3088267/octave.5.1.0.hang.on.launch.spindumps.-.2019-04-16.zip (Too big to attach on Savannah.) Maybe these will help in the diagnosis. I've edited the files down to just the Octave-related processes, for readability.

Both of these spindumps are from when a hang occurred on program launch. They seem superficially similar. In both, in octave-gui, the DispatchThread seems to be wedged in the keypress handler for the terminal emulation in octgui, which I believe is the Command Window. SelfListener and QFileInfoGatherer both appear to be waiting on a QMutex, and QThread is stopped in a system call inside readline getting some input for the command window. I don't know Qt programming or the Octave codebase well enough to know what that means.

Downstream bug report is here: https://github.com/octave-app/octave-app/issues/24

Andrew Janke <apjanke>
Wed 17 Apr 2019 12:16:16 AM UTC, comment #5: 

do i get that from running `port installed`?  if so, the answer is:
  qt5-qtbase @5.12.2_0+openssl (active)
  qt5-qtdeclarative @5.12.2_0 (active)
  qt5-qtmacextras @5.12.2_0 (active)
  qt5-qtsvg @5.12.2_0 (active)
  qt5-qttools @5.12.2_0 (active)
  qt5-sqlite-plugin @5.12.2_0 (active)

yes this bug report refers to octave 5.1.0, i indicated that in the "release" field.

beta3 hung on launch: github.com/octave-app/octave-app/issues/24#issuecomment-483873826

4.4.1 hung after editing file while in debugger and hitting "save and run" without manually stopping the debugger: github.com/octave-app/octave-app/issues/24#issuecomment-483889052

would there be any value to trying the non-qt backends?
wiki.octave.org/FAQ#Graphics:_backends_and_toolkits

eflister <eflister>
Tue 16 Apr 2019 10:06:08 PM UTC, comment #4: 

@eflister: Also, can you confirm what version of Qt your MacPorts Octave installation is using?

Andrew Janke <apjanke>
Tue 16 Apr 2019 10:00:39 PM UTC, comment #3: 

on IRC apjanke  Andrew Janke  wrote:

Matlab Octave /Octave.app maintainer here. I'm seeing the same thing: frequent beachball hangs, especially when using the debugger and switching between widgets, regardless of whether editor is undocked.

No known cause yet. But it may be related to the Qt version: we originally built against the current Qt 5.12.x series, and got lots of beachballs. We recently tried building against Qt 5.11.x, and stability seems to be better there.

If you want to try our build using Qt 5.11, you can download Octave.app 5.1.0 beta 3 from http://octave-app.org/Developer-Downloads.html. (That way you don't have to wrangle Qt versions yourself; it has all its dependencies bundled in the .app file.)

eflister <eflister>
Tue 16 Apr 2019 10:00:31 PM UTC, comment #2: 

Schoeps and I are also seeing this behavior with our Octave.app builds. It seems to be new with Octave 5.1.0: 4.4.1 froze much less often.

@eflister: is this Octave version 5.1.0 you're referring to?

This may be related to the version of Qt that Octave is built against. Our 4.4.1 was built against Qt 5.11.x. With 5.1.0, we built against the current Qt 5.12.x. We've recently made a new "5.1.0 beta 3" build that is built against Qt 5.11.x, and it's too soon to tell, but it sure seems to freeze less often.

Our earlier 5.1.0 builds were made on macOS 10.13, and the new 5.1.0 beta 3 build with Qt 5.11 made on macOS 10.12, which conceivably affect the behavior too, but I doubt it.

@eflister: Would you mind downloading Octave.app 5.1.0 beta 3 from http://octave-app.org/Developer-Downloads.html and seeing if that works better for you? You can also try our 4.4.1 (vs Qt 5.11) from http://octave-app.org/Download.html and see how that behaves. It would be useful to have an additional user testing it here.

Andrew Janke <apjanke>
Tue 16 Apr 2019 09:03:39 PM UTC, comment #1: 

OP here, well it still happens even without ever undocking the editor.  it makes octave basically unusable for me.  please let me know if there's anything i can do to try to figure out the cause!

eflister <eflister>
Tue 16 Apr 2019 06:16:14 PM UTC, original submission:  

installed from macports on osx 10.14.4 configured for x86_64-apple-darwin18.2.0.  i use the gui+debugger, typically via "keyboard," and the gui is constantly beachball hanging when i switch between windows - i typically use the editor undocked.  is this a known problem?  any workarounds i should try?

Anonymous

 

(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 anonymous4argus (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by apjanke (Posted a comment)
  • -email is unavailable- added by eflister (Posted a comment)
  • -email is unavailable- added by None (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-05-13 mmuetzel StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2020-11-12 mmuetzel StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code