spyder: Spyder crashes when pressing ctrl-g in editor to go to definition

Description of your problem

About half the times when pressing ctrl-g in the Spyder editor to go to definition, spyder/python crashes.
What steps will reproduce the problem?

  1. Open a python file in the Spyder editor
  2. Move the caret to a function or any other object defined in another file
  3. Press CTRL-G (or right click and select go to definition in the pop-up menu)

What is the expected output? What do you see instead? Program crashes

Please provide any additional information below

Versions and main components

  • Spyder Version: 3.0.2
  • Python Version: Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)]
  • Operating system: Windows 10

Dependencies

Please go to the menu entry Help > Optional Dependencies (or Help > Dependencies), press the button Copy to clipboard and paste the contents below: jedi >=0.8.1 : 0.9.0 (OK) matplotlib >=1.0 : 1.5.3 (OK) nbconvert >=4.0 : 4.2.0 (OK) numpy >=1.7 : 1.11.1 (OK) pandas >=0.13.1 : 0.18.1 (OK) pep8 >=0.6 : 1.7.0 (OK) pyflakes >=0.6.0 : 1.3.0 (OK) pygments >=2.0 : 2.1.3 (OK) pylint >=0.25 : 1.5.4 (OK) qtconsole >=4.2.0: 4.2.1 (OK) rope >=0.9.4 : 0.9.4-1 (OK) sphinx >=0.6.6 : 1.4.6 (OK) sympy >=0.7.3 : 1.0 (OK)

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 5
  • Comments: 27 (21 by maintainers)

Most upvoted comments

@ccordoba12 @goanpeca The problem occurs in the PluginManager where response from rope and jedi for a same request are sometimes allowed to pass through to the IntrospectionManager, resulting in almost two simulatenous command to open the same file when it is not already opened in Spyder and a crash.

Could you please try to switch line #146 with line #147 in the PluginManager and tell me if it is still crashing on your end. For me, it seemed to have fixed completely the problem.

    def _finalize(self, response):
        self.waiting = False
        self.pending = None
        if self.info:
            delta = time.time() - self._start_time
            debug_print('%s request from %s finished: "%s" in %.1f sec'
                % (self.info.name, response['name'],
                   str(response['result'])[:100], delta))
            response['info'] = self.info
            self.info = None
            self.introspection_complete.emit(response)            
        if self.pending_request:
            info = self.pending_request
            self.pending_request = None
            self.send_request(info)

I tried to apply the fix, and it made the crash never occur on my environment (Windows 10 64 bit, python 3.6.1, Spyder 3.1.3) Thank you @jnsebgosselin.

jedi =0.9.0 : 0.9.0 (OK) matplotlib >=1.0 : 2.0.2 (OK) nbconvert >=4.0 : 4.2.0 (OK) numpy >=1.7 : 1.13.0 (OK) pandas >=0.13.1 : 0.19.2 (OK) pep8 >=0.6 : 1.5.7 (OK) pyflakes >=0.6.0 : 1.5.0 (OK) pygments >=2.0 : 2.1.3 (OK) pylint >=0.25 : 1.6.4 (OK) qtconsole >=4.2.0: 4.2.1 (OK) rope >=0.9.4 : 0.9.4-1 (OK) sphinx >=0.6.6 : 1.5.6 (OK) sympy >=0.7.3 : 1.0 (OK)

@ronekko, thanks for helping us to test @jnsebgosselin fix.

@jnsebgosselin, you’re our hero!! I’ve also seen this problem on Linux and was wondering what was causing it. However, it doesn’t generate a crash there.

Unfortunately neither @goanpeca nor me use Windows, so could you create a PR so that @andfoy (who was able to reproduce this problem on his end) can test it?

Again, thanks a lot for helping us with this one!!

Ok, good, thanks for doing it.

Could you update qt and pyqt with this command

conda update qt pyqt

and try again?

Note: The warning you reported is harmless. I’ve seen it too.