Skip to content

Freeze by unittest.mock.call?? #10578

Open

Description

@chenl

I can consistently make my Ubuntu 14.04 host freeze with this recipe:

On Python 3.6.1 installed via pyenv (https://github.com/pyenv/pyenv), and IPython 6.0.0 installed via pip run:

>>> from unittest.mock import call
>>> call??

Observe the entire host stop responding, as if all the CPU and/or memory are consumed by IPython.

Activity

  1. takluyver commented on May 22, 2017

    @takluyver
    Member

    I cheerfully tried to reproduce this and then had to reboot my computer. That will teach me ;-)

    My guess is that our introspection machinery clashes with the highly dynamic nature of mock objects. I'll look into it.

  2. takluyver commented on May 22, 2017

    @takluyver
    Member

    Gah, it's in Python itself. inspect.getsourcelines(unittest.mock.call) is enough to trigger it. I'll file an upstream bug.

  3. takluyver commented on May 23, 2017

    @takluyver
    Member

    It's been fixed in Python now, so it should be safe from Python 3.7, 3.6.2 and 3.5.4. I don't think we can easily work around it in IPython, but I'll leave this open and if more people run into it, we can look at monkeypatching inspect.

  4. added this to the not ipython milestone on May 23, 2017
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions