question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After upgrade to 1.27.0 multitheaded debugging brakes on "paused on pause"

See original GitHub issue

Environment data

  • VS Code version: 1.27.0
  • Extension version: 2018.8.0
  • OS and version: Ubuntu 14.04.5 LTS (Ubuntu 16.04.5 LTS)
  • Python version: 2.7.6 (2.7.12)
  • Type of virtual environment used: N/A
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

When debugging multi-threaded app, the placing breakpoint in some thread cause break there, but very soon it breaks in different threads, jumps to the place and expand thread’s stack which has “Paused on pause” status.

Expected behavior

After stopping at breakpoint stay there - not to switch to others threads nor expand stack on “paused on pause”.

Steps to reproduce:

Run under debugger next app with break at print 'th1'. Watch break position is jumping to “paused on pause” threads.

import threading
import time

class RunThread(threading.Thread):
    kind = 'Thread'
    def __init__(self, name, fn, args = ()):
        threading.Thread.__init__(self)
        self.name = name
        self.fn   = fn
        self.args = args
        self.start()
    def run(self):
        self.fn(*(self.args))

def th1():
    while True:
        print 'th1'
        time.sleep(5)

def th2():
    while True:
        print 'th2'
        time.sleep(10)

def th3():
    while True:
        print 'th3'
        time.sleep(15)

def main():
    threads = []
    threads.append(RunThread("aaa", th1))
    threads.append(RunThread("bbb", th2))
    threads.append(RunThread("ccc", th3))

    for t in threads:
        t.join()

if __name__ == '__main__':
    main()

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
egorsecommented, Sep 10, 2018

As @primes2h said - previous version https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/python/2018.7.1/vspackage works just fine.

Just for those who looks for fast solution curl -O -J -L https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/python/2018.7.1/vspackage && code --install-extension ms-python.python-2018.7.1.vsix

1reaction
MandarJKulkarnicommented, Sep 25, 2018

After upgrading ptvsd to 4.1.2, unable to debug anything, neither flask nor ‘current file’ debugging is working.

Getting error “C:\Python27\python.exe: No module named ptvsd.main; ‘ptvsd’ is a package and cannot be directly executed”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Learn to debug multithreaded applications - Visual Studio ...
The pause icon goes away on this row, indicating that the thread is no longer frozen. Switch to the code editor and press...
Read more >
Android Studio threaded debugging - Stack Overflow
This is on a per-breakpoint basis (i.e. some breakpoints can suspend all threads, while others only suspend the current thread). Right-click on ...
Read more >
JetBrains Rider - Debug multithreaded applications
JetBrains Rider provides the following functionality to simplify the debugging of multithreaded applications:.
Read more >
Make the debugger stick to the current thread instead of ...
Debugging multithreaded applications is hard enough as it is, without having to manhandle the ... After you hit the break point, try stepping...
Read more >
3.6. Debugging Multithreaded Programs with GDB
Other threads executing at the point in the code where the breakpoint is set will not trigger the breakpoint to pause the program...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found