When I open Spyder, load one of my scripts, highlight the line "import 
my_module" and click 'execute selection', Spyder will freeze.

I used GDB to get the call stack of the thread that's hanging:

Thread 1 (python) at "0x7ffff7fd3740"

<module>     (Python IDE/bootstrap.py)

  main     (spyderlib/start_app.py)

    main     (spyderlib/spyder.py)

      run_spyder     (spyderlib/spyder.py)

        focusInEvent     (sourcecode/base.py)

          <lambda>     (plugins/externalconsole.py)

            plugin_focus_changed     (spyderlib/spyder.py)

              set_shellwidget_from_id     (plugins/variableexplorer.py)

                visibility_changed     (externalshell/namespacebrowser.py)

                  refresh_table     (externalshell/namespacebrowser.py)

                    communicate     (utils/bsdsocket.py)

                      read_packet     (utils/bsdsocket.py)

                        temp_fail_retry     (utils/bsdsocket.py)


I can tell that after I execute the import statement, Spyder is trying to 
update the variable explorer with the refresh_table() function. It sends 
the command "refresh()" to the monitor's introspection thread through a 
socket and then waits for a reply and that's where it gets stuck. It's just 
waiting forever for a response to come back through the socket from the 
monitor, but the monitor is not replying. 

I'm having a hard time figuring out if 1) the monitor crashed and the 
thread closed 2) the monitor doesn't reply because it's hung somewhere or 
3) some other socket timing issue.

There are 4 other threads running with the following call stacks (Not sure 
which one, if any, is the monitor thread):

Thread 66 (NotificationThr) at "0x7fff53a31700" in recv(...)

    run (externalshell/introspection.py)

        read_packet (utils/bsdsocket.py)

            temp_fail_retry (utils/bsdsocket.py)


-----------------------------------------------------------

Thread 64 (python) at "0x7fff8154a700" in accept(...)

    __bootstrap (python2.7/threading.py)

        __bootstrap_inner (python2.7/threading.py)

            run (externalshell/introspection.py)

                accept (python2.7/socket.py)


-----------------------------------------------------------

Thread 63 (python) at "0x7fff81d4b700" in accept(...)

__bootstrap (python2.7/threading.py)

    __bootstrap_inner (python2.7/threading.py)

        run (externalshell/introspection.py)

            accept (python2.7/socket.py)


-----------------------------------------------------------

Thread 62 (python) at "0x7fff8254c700" in accept(...)

__bootstrap (python2.7/threading.py)

    __bootstrap_inner (python2.7/threading.py)

        run (python2.7/threading.py)

            start_open_files_server (spyderlib/spyder.py)

                accept (python2.7/socket.py)


This is a really tough problem to debug. Does anyone know how I could tell 
which thread is the monitor's introspection thread? GDB gives me a thread 
ID, which as far as I can tell is a number created by GDB itself. I tried 
printing the result of id(threading.get_current_thread()) to try to match 
up the thread's address with the address supplied by GDB, but none of them 
match, so I can't tell which thread is which. I know Spyder has an 
introspection thread, a notification thread, the main console thread. 

FYI, I'm running on Linux Mint. I made a bunch of changes to the source 
code in an effort to make it more like PyScripter, so I don't want to 
report this as a bug until I find the reason it's hanging.

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to