Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
egorse opened this issue Sep 6, 2018 · 14 comments
Closed
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority

Comments

@egorse
Copy link

egorse commented Sep 6, 2018

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()
@brettcannon brettcannon added bug Issue identified by VS Code Team member as probable bug needs verification area-debugging labels Sep 6, 2018
@brettcannon
Copy link
Member

Please verify if this is a bug, @d3r3kk .

@primes2h
Copy link

primes2h commented Sep 7, 2018

It seems to be a regression in ms-python extension.

I downgraded to 2018.7.1 version and it works as expected.

Similar issues #2520 and #2521

@DonJayamanne
Copy link

cc @karthiknadig. FYI - we're yet to verify this issue.

@karthiknadig
Copy link
Member

This is microsoft/ptvsd#777

@DonJayamanne
Copy link

DonJayamanne commented Sep 8, 2018

@karthiknadig @brettcannon

  • Thanks, I guess this means we'll need a new release of PTVSD for this fix.
  • We'll need a new release of the extension as well.

@DonJayamanne DonJayamanne added P0 important Issue identified as high-priority and removed needs verification labels Sep 8, 2018
@DonJayamanne
Copy link

Changing the status to P1, as this is something that can be resolved in the next release with a new version of PTVSD.

@egorse
Copy link
Author

egorse commented 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

@MandarJKulkarni

This comment has been minimized.

@veuncent

This comment has been minimized.

@DonJayamanne

This comment has been minimized.

@DonJayamanne
Copy link

DonJayamanne commented Sep 25, 2018

@egorse
Please could you download our latest development version of the extension and let us know whether this fixes your issue? Instructions are simple and can be found here. Basically just download our dev version of the vsix file and install it.

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Sep 25, 2018
@egorse
Copy link
Author

egorse commented Sep 26, 2018

@DonJayamanne tried with 1.27.2 and the fresh dev plugin. There is no more switches to "paused on pause" threads and debugger keep "focus" at proper thread. So debugging experience is back to normal.
Minor cosmetic note - the stack for last thread in list always get expanded - even if you explicitly collapse it and break is on one of previous thread.

@MandarJKulkarni
Copy link

@DonJayamanne @veuncent
Raised #2698.

@DonJayamanne
Copy link

@egorse
Thanks, I'll close this issue as it has been resolved and you've been kind enough to validate it.
Please do create a separate GitHub issue for the cosmetic issue you encountered

@DonJayamanne DonJayamanne removed the info-needed Issue requires more information from poster label Sep 26, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority
Projects
None yet
Development

No branches or pull requests

8 participants