FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

MacOSX: TkAgg backend sluggishness in combination with ipython interactive · Issue #9077 · matplotlib/matplotlib · GitHub

Repository navigation

MacOSX: TkAgg backend sluggishness in combination with ipython interactive #9077

Closed as not planned

Description

Bug report

Bug summary

If I plot any relatively large figure, execute my script with ipython -i, when I fall at the interactive prompt my whole system becomes unresponsive. Alt-tabbing gets slow, typing, etc. When I exit with Ctrl-D, I get an error stack printed which seems pretty long (abnormally long? can't tell).

Code for reproduction

import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import numpy as np

test_image = np.random.sample((100, 100))

plt.imshow(test_image)
plt.show()

and execute it with ipython3 -i.

Actual outcome

Whole OS starts becoming unresponsive. Upon exiting the prompt, following error stack gets printed.

Do you really want to exit ([y]/n)? 2017-08-23 10:02:10.978 Python[5180:141513] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_presentFunctionRowItemTextInputViewWithEndpoint:reply:) block performed very slowly (5.22 secs).
2017-08-23 10:02:10.980 Python[5180:141513] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_presentFunctionRowItemTextInputViewWithEndpoint:reply:) block performed very slowly (2.75 secs).
2017-08-23 10:02:10.988 Python[5180:141513] *** Assertion failure in -[NSRemoteView informAuxServiceOfSelf], /Library/Caches/com.apple.xbs/Sources/ViewBridge/ViewBridge-283/NSRemoteView.m:3207
2017-08-23 10:02:10.990 Python[5180:141513] IMKInputSession presentFunctionRowItemTextInputViewWithEndpoint:completionHandler: : [self textInputContext]=0x0 *NO* NSRemoteViewController to client, NSError=Error Domain=com.apple.ViewBridge Code=8 "(null)" UserInfo={com.apple.ViewBridge.error.hint=__38-[NSRemoteView _advanceToConfigPhase:]_block_invoke.2466 caught NSInternalInconsistencyException '<NSRemoteView: 0x7faa7fbd1a70> failed to rendezvous via aux service' with backtrace (
	0   CoreFoundation                      0x00007fffac8842cb __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fffc169448d objc_exception_throw + 48
	2   CoreFoundation                      0x00007fffac889042 +[NSException raise:format:arguments:] + 98
	3   Foundation                          0x00007fffae2d1be0 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
	4   ViewBridge                          0x00007fffc00e9b34 -[NSRemoteView informAuxServiceOfSelf] + 345
	5   ViewBridge                          0x00007fffc00ea47e -[NSRemoteView _finishAdvanceToConfigPhaseWithContextID:andServiceViewSize:andOffset:] + 685
	6   ViewBridge                          0x00007fffc00fe298 __38-[NSRemoteView _advanceToConfigPhase:]_block_invoke.2466 + 103
	7   CoreFoundation                      0x00007fffac7f7b8c __invoking___ + 140
	8   CoreFoundation                      0x00007fffac7f7a11 -[NSInvocation invoke] + 289
	9   ViewBridge                          0x00007fffc0125579 withHintInProgress + 487
	10  ViewBridge                          0x00007fffc01252b0 __deferNSXPCInvocationOntoMainThread_block_invoke_2 + 233
	11  ViewBridge                          0x00007fffc00a9459 +[NSViewServiceApplication withHostPID:invoke:] + 46
	12  ViewBridge                          0x00007fffc0125173 __deferNSXPCInvocationOntoMainThread_block_invoke + 179
	13  ViewBridge                          0x00007fffc0124d67 __deferBlockOntoMainThread_block_invoke_2 + 544
	14  CoreFoundation                      0x00007fffac81a17c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
	15  CoreFoundation                      0x00007fffac7faf84 __CFRunLoopDoBlocks + 356
	16  CoreFoundation                      0x00007fffac7fa705 __CFRunLoopRun + 917
	17  CoreFoundation                      0x00007fffac7fa114 CFRunLoopRunSpecific + 420
	18  HIToolbox                           0x00007fffabd5aebc RunCurrentEventLoopInMode + 240
	19  HIToolbox                           0x00007fffabd5abf9 ReceiveNextEventCommon + 184
	20  HIToolbox                           0x00007fffabd5ab26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
	21  AppKit                              0x00007fffaa2f3a54 _DPSNextEvent + 1120
	22  AppKit                              0x00007fffaaa6f7ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
	23  Tk                                  0x000000010396c8a1 TkGenerateButtonEvent + 494
	24  Tk                                  0x000000010396cd3b Tk_MacOSXSetupTkNotifier + 861
	25  Tcl                                 0x0000000103841c38 Tcl_DoOneEvent + 317
	26  _tkinter.cpython-36m-darwin.so      0x00000001037b8886 EventHook + 185
	27  Python                              0x0000000100186fc3 my_fgets + 34
	28  Python                              0x0000000100186ec9 PyOS_StdioReadline + 109
	29  Python                              0x0000000100187109 PyOS_Readline + 180
	30  Python                              0x000000010021f45b builtin_input + 1111
	31  Python                              0x00000001001c4f19 _PyCFunction_FastCallDict + 166
	32  Python                              0x00000001002297d7 call_function + 489
	33  Python                              0x00000001002225ca _PyEval_EvalFrameDefault + 5000
	34  Python                              0x0000000100229fa7 _PyEval_EvalCodeWithName + 1829
	35  Python                              0x000000010022a693 fast_function + 227
	36  Python                              0x00000001002297ae call_function + 448
	37  Python                              0x00000001002225ca _PyEval_EvalFrameDefault + 5000
	38  Python                              0x0000000100229fa7 _PyEval_EvalCodeWithName + 1829
	39  Python                              0x000000010022a693 fast_function + 227
	40  Python                              0x00000001002297ae call_function + 448
	41  Python                              0x00000001002225ca _PyEval_EvalFrameDefault + 5000
	42  Python                              0x0000000100229fa7 _PyEval_EvalCodeWithName + 1829
	43  Python                              0x000000010022a693 fast_function + 227
	44  Python                              0x00000001002297ae call_function + 448
	45  Python                              0x00000001002225ca _PyEval_EvalFrameDefault + 5000
	46  Python                              0x0000000100229fa7 _PyEval_EvalCodeWithName + 1829
	47  Python                              0x000000010022a693 fast_function + 227
	48  Python                              0x00000001002297ae call_function + 448
	49  Python                              0x00000001002225ca _PyEval_EvalFrameDefault + 5000
	50  Python                              0x0000000100229fa7 _PyEval_EvalCodeWithName + 1829
	51  Python                              0x000000010022a693 fast_function + 227
	52  Python                              0x00000001002297ae call_function + 448
	53  Python                              0x00000001002225ca _PyEval_EvalFrameDefault + 5000
	54  Python                              0x000000010022a92e _PyFunction_FastCall + 121
	55  Python                              0x00000001002297ae call_function + 448
	56  Python                              0x00000001002225ca _PyEval_EvalFrameDefault + 5000
	57  Python                              0x0000000100229fa7 _PyEval_EvalCodeWithName + 1829
	58  Python                              0x000000010022a85e _PyFunction_FastCallDict + 444
	59  Python                              0x000000010018d4d9 _PyObject_FastCallDict + 196
	60  Python                              0x000000010018d5fc _PyObject_Call_Prepend + 156
	61  Python                              0x000000010018d35a PyObject_Call + 101
	62  Python                              0x0000000100222825 _PyEval_EvalFrameDefault + 5603
	63  Python                              0x0000000100229fa7 _PyEval_EvalCodeWithName + 1829
	64  Python                              0x000000010022a693 fast_function + 227
	65  Python                              0x00000001002297ae call_function + 448
	66  Python                              0x00000001002225ca _PyEval_EvalFrameDefault + 5000
	67  Python                              0x0000000100229fa7 _PyEval_EvalCodeWithName + 1829
	68  Python                              0x00000001002211cd PyEval_EvalCode + 43
	69  Python                              0x0000000100248896 run_mod + 54
	70  Python                              0x0000000100248b76 PyRun_FileExFlags + 180
	71  Python                              0x0000000100248103 PyRun_SimpleFileExFlags + 280
	72  Python                              0x000000010025bd40 Py_Main + 3268
	73  Python                              0x0000000100180e1d Python + 7709
	74  libdyld.dylib                       0x00007fffc1f7a235 start + 1
	75  ???                                 0x0000000000000004 0x0 + 4
), com.apple.ViewBridge.error.description=NSViewBridgeExceptionError}, com.apple.inputmethod.EmojiFunctionRowItem

Expected outcome

I expect my OS to not die because of an idle application.

Matplotlib version

  • Operating System: mac OS 10.12.6
  • Matplotlib Version: 2.0.2
  • Python Version: 3.6.1
  • Other Libraries: ipython 6.1.0 and its dependencies updated from pip as of this morning

Note that I switched to TkAgg because the MacOsx backend silently ignores Ctrl-C signal and I needed it for my work. This behaviour does not happen on the MacOsx backend.

Activity

  1. WeatherGod commented on Aug 23, 2017

    Member
  2. jclevesque commented on Aug 23, 2017

    ContributorAuthor

    No, the bug happens only with ipython+matplotlib.

  3. asaxton commented on Aug 31, 2017

    I have this problem too:

    Backend is TkAgg because I work on many projects at the same time and need virtual environments.
    Using ipython.

    macOS 10.12.6 MacBook Pro 2017 with two hdmi attached monitors.
    Graphics: Radeon Pro 555 2048 MB
    Intel HD Graphics 630 1536 MB
    pip list,
    appnope (0.1.0)
    backports.shutil-get-terminal-size (1.0.0)
    cycler (0.10.0)
    decorator (4.1.2)
    enum34 (1.1.6)
    functools32 (3.2.3.post2)
    ipython (5.4.1)
    ipython-genutils (0.2.0)
    isc-orm (1.0, /Users/saxton/Development/ncsa-isc-orm)
    matplotlib (2.0.2)
    MySQL-python (1.2.5)
    numpy (1.13.1)
    pandas (0.20.3)
    pathlib2 (2.3.0)
    pexpect (4.2.1)
    pickleshare (0.7.4)
    pip (9.0.1)
    prompt-toolkit (1.0.15)
    ptyprocess (0.5.2)
    Pygments (2.2.0)
    pyparsing (2.2.0)
    python-dateutil (2.6.1)
    pytz (2017.2)
    scandir (1.5)
    setuptools (36.2.7)
    simplegeneric (0.8.1)
    six (1.10.0)
    SQLAlchemy (1.1.13)
    subprocess32 (3.2.7)
    tqdm (4.15.0)
    traitlets (4.3.2)
    wcwidth (0.1.7)
    wheel (0.29.0)

  4. tacaswell commented on Aug 31, 2017

    Member

    attn @Carreau This is likely an issue with the input hook for tk. Who should be pinged about that?

  5. added this to the milestone on Aug 31, 2017
  6. modified the milestones: , on Oct 9, 2017
  7. mikewojnowicz commented on Oct 29, 2018

    @mattip I am having the same issue as @jclevesque. Would you say that the merged bugfix from Dec 8, 2017 solves the problem? If so, is there a particular version you'd recommend pip installing? Thank you for your time.

  8. mattip commented on Oct 29, 2018

    Contributor

    Sorry, I don't have a Mac. The test code works fine for me on Linux. Is the problem only apparent after closing the window? #9956 was meant to help with cleanup.

  9. jclevesque commented on Oct 29, 2018

    ContributorAuthor

    Cannot reproduce issue with updated matplotlib (3.0.1) and ipython (7.1.1).

  10. mikewojnowicz commented on Oct 29, 2018

    @jclevesque Thanks, good to know. I was wondering if there was some known solution that would work for python2.7, or if the answer was simply "you need python3."

  11. tacaswell commented on Oct 29, 2018

    Member

    @mikewojnowicz What version of Matplotlib have you tried? Given that we do not really understand the source of this issue, it is hard to know what a know-good version is.

    Can you also include your OSX version, python version, and how you installed python?

  12. mikewojnowicz commented on Oct 30, 2018

    @tacaswell

    Thank you for asking.

    matplotlib==2.2.3
    OSX==10.12.6
    python==2.7.14

    I believe this is the version of python that shipped with OSX.

  13. tacaswell commented on Oct 30, 2018

    Member

    I should have included the tk version (and how you installed it) and ipython version as well, sorry for the drip of questions!

  14. mikewojnowicz commented on Oct 30, 2018

    No problem.
    Tkinter==8.5
    ipython==5.8.0
    Afraid I don't remember how I installed Tkinter. :(

  15. mikewojnowicz commented on Apr 10, 2020

    This is still a problem for me

    python==3.6.5
    ipython==7.13.0
    matplotlib==3.2.1
    OSX==10.12.6
    Tkinter==8.5

    Any advice? Would you consider the easiest solution to update OSX?

  16. mikewojnowicz commented on Apr 10, 2020

    @jclevesque Have you come up with a solution or good workaround?

  17. tacaswell commented on Apr 10, 2020

    Member

    @mikewojnowicz I do not think we have made any progress tracking down what is going on here. With other tk + osx related issues we have seen that it can depend on the patch version of tk and who built the libraries.

  18. github-actions commented on Apr 16, 2023

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  19. added
    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.
    on May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Actionthird-party integration

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL