GithubHelp home page GithubHelp logo

Comments (34)

brunetton avatar brunetton commented on August 15, 2024 1

I've the feeling that it happens when I hit "F10" too fast. Like if the thread that displays debug spied variables have no time to compute display outputs and don't like to get interrupted during that job.
(I'm totally aware my contribution is far from being scientific ;) but it's a path to explore)

from vscode-python.

avilay avatar avilay commented on August 15, 2024 1

Consistently happens when I am watching a variable (in my case a dict) that is being updated. I am on

  • Ubuntu 16.04
  • VS Code 1.19.1
  • Python Extension 0.9.1

Doesn't seem to be related to speed. I tried hitting F5/F10 really fast when there were no watch variables and there was no repro.

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

From @peringz on September 10, 2016 0:6

This is what I see in the console.

File "/Users/<user>/.vscode/extensions/donjayamanne.python-0.3.22/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1246, in run_on_thread
  self.schedule_work(lambda : self.run_locally(text, cur_frame, execution_id, frame_kind, repr_kind))
File "/Users/<user>/.vscode/extensions/donjayamanne.python-0.3.22/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1238, in schedule_work
  self.unblock()
File "/Users/<user>/.vscode/extensions/donjayamanne.python-0.3.22/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1234, in unblock
  self._block_lock.release()
RuntimeError: release unlocked lock

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

@peringz, thanks for the immediate feedback.

  • Please could you ensure you have updated the python extension to the latest version 0.3.22 (released yesterday)
  • What is your OS?
  • Please could you provide a sample program (or instructions) for me to replicate this at my end?
  • What version of Python are you using?

Thanks

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

From @peringz on September 10, 2016 0:37

@DonJayamanne I'm using extension version 0.3.22 on OS X and using Python 3.5.2 (tried 2.7.10 and got the same results)

A simple program like the one below will often throw this exception at a random interval. An error is thrown only when the first line of code or a breakpoint is hit.

def next_id(arr):
    nextid = 0
    while nextid in arr:
        nextid += 1
    return nextid

print(next_id([0, 1, 2, 3, 4, 12, 11, 8, 9]))

My launch configuration looks like this

"configurations": [
    {
        "name": "Python",
        "type": "python",
        "request": "launch",
        "stopOnEntry": true,
        "program": "${file}",
        "pythonPath": "/usr/local/bin/python3",
        "debugOptions": [
            "WaitOnAbnormalExit",
            "WaitOnNormalExit",
            "RedirectOutput"
        ]
    },

To replicate, put a breakpoint in line number 4, go to debug and click the Run button selecting Python configuration. Keep pressing F5 to iterate through the loop until Extension throws the error. You may want to repeat this debugging few times to see the error.

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

@peringz, one last question. Do you have any watch variables? Thanks

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

From @peringz on September 10, 2016 1:32

@DonJayamanne I had three, removed them and did some quick testing. Not able to reproduce the error any longer.

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

@peringz
Oh no, do you remember what variables you had. Please could you add them back. And try again.

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

From @peringz on September 10, 2016 2:31

@DonJayamanne I don't know the variable names. But I was able to replicate the problem by adding two invalid watch variables (foo and bar)
vscode_python

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

Great thanks, will check this out tonight.

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

@peringz , i'm unable o replicate this issue at my end. Will keep trying.
However there's a ray of hope, I have fixed an issue that may be related to this (#292). Will release a build soon.

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

@peringz , will close this as the fix for #292 should have resolve this issue. If not , please re-open the issue.

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

From @staffann on January 30, 2017 13:4

I get the same problem with version 0.5.6:
Traceback (most recent call last):
File "/home/sni1lud/.vscode/extensions/donjayamanne.python-0.5.6/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1725, in loop
cmd()
File "/home/sni1lud/.vscode/extensions/donjayamanne.python-0.5.6/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 2022, in command_enum_children
thread.enum_child_on_thread(text, cur_frame, eid, frame_kind)
File "/home/sni1lud/.vscode/extensions/donjayamanne.python-0.5.6/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1345, in enum_child_on_thread
self.schedule_work(lambda : self.enum_child_locally(text, cur_frame, execution_id, frame_kind))
File "/home/sni1lud/.vscode/extensions/donjayamanne.python-0.5.6/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1316, in schedule_work
self.unblock()
File "/home/sni1lud/.vscode/extensions/donjayamanne.python-0.5.6/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1312, in unblock
self._block_lock.release()
RuntimeError: release unlocked lock

Using python 3. Have some different watch variables. The problem occurs when I step inside the code.

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

From @ngawangtrinley on February 6, 2017 5:13

I'm on Linux and I get the same problem when I "step into" the code in a fast sequence. If I wait half a second or a second between each time I hit F11 I don't have the problem. I didn't have the problem in Windows.

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

From @guiambros on February 12, 2017 6:8

Likewise; I can now reproduce in a very consistent manner. If I wait 0.2s before I press F10/F11, it works well. If I hold the F10 key pressed, it will execute for 3-4 iterations and then cause the error and lock up the session. I have to then stop debugger and start again.

Not a huge issue, but a bit annoying when you want to advance a long for-loop without stepping out or setting a breakpoint.

Version 0.5.8 (3 February 2017)

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

From @mostafaeweda on June 15, 2017 22:21

I keep hitting this issue - I'm willing to help fix it, but need guidance where to start.

from vscode-python.

dinglioutlook avatar dinglioutlook commented on August 15, 2024

I agree with @brunetton . It's quite random, in debug mode, if i choose to run till some code, then it sometimes deadlock, but if i slowly step by step to the breakpoint, nothing happened.

from vscode-python.

mmyoungman avatar mmyoungman commented on August 15, 2024

I'm getting the same problem.

VS Code details:
Version 1.19.1
Commit 0759f77bb8d86658bc935a10a64f6182c5a1eeba
Date 2017-12-19T09:41:01.414Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

(Edit: I just upgraded to 1.91.2, and I get the exact same problem)

  • Manjaro
  • Ms-python.python 0.9.1

While debugging, I don't have any problem until I add some expressions to watch variables. With a few expressions added, if I step through quickly, the debugger crashes:
Traceback (most recent call last): File "/home/mark/.vscode/extensions/ms-python.python-0.9.1/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1729, in loop cmd() File "/home/mark/.vscode/extensions/ms-python.python-0.9.1/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1747, in command_step_into self.command_resume_all() File "/home/mark/.vscode/extensions/ms-python.python-0.9.1/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1908, in command_resume_all thread.unblock() File "/home/mark/.vscode/extensions/ms-python.python-0.9.1/pythonFiles/PythonTools/visualstudio_py_debugger.py", line 1315, in unblock self._block_lock.release() RuntimeError: release unlocked lock

from vscode-python.

thesilican avatar thesilican commented on August 15, 2024

I have the same issue, I'm using

  • VS Code
    • Version 1.19.3
    • Commit 7c4205b5c6e52a53b81c69d2b2dc8a627abaa0ba
    • Date 2018-01-25T10:36:34.867Z
    • Shell 1.7.9
    • Renderer 58.0.3029.110
    • Node 7.9.0
    • Architecture x64
  • Windows 10 Home
  • ms-python.python 2018.1
  File "C:\Users\Bryan C\.vscode\extensions\ms-python.python-2018.1.0\pythonFiles\PythonTools\visualstudio_py_debugger.py", line 2026, in command_enum_children
    thread.enum_child_on_thread(text, cur_frame, eid, frame_kind)
  File "C:\Users\Bryan C\.vscode\extensions\ms-python.python-2018.1.0\pythonFiles\PythonTools\visualstudio_py_debugger.py", line 1348, in enum_child_on_thread
    self.schedule_work(lambda : self.enum_child_locally(text, cur_frame, execution_id, frame_kind))
  File "C:\Users\Bryan C\.vscode\extensions\ms-python.python-2018.1.0\pythonFiles\PythonTools\visualstudio_py_debugger.py", line 1319, in schedule_work
    self.unblock()
  File "C:\Users\Bryan C\.vscode\extensions\ms-python.python-2018.1.0\pythonFiles\PythonTools\visualstudio_py_debugger.py", line 1315, in unblock
    self._block_lock.release()
RuntimeError: release unlocked lock

EDIT: I'm getting another error by spamming F10 and F11 keys at the same time

Traceback (most recent call last):
  File "C:\Users\Bryan C\.vscode\extensions\ms-python.python-2018.1.0\pythonFiles\PythonTools\visualstudio_py_debugger.py", line 1729, in loop
    cmd()
  File "C:\Users\Bryan C\.vscode\extensions\ms-python.python-2018.1.0\pythonFiles\PythonTools\visualstudio_py_debugger.py", line 1762, in command_step_over
    assert thread._is_blocked
AssertionError

Try running any python code, and mash both F10 and F11 at the same time

from vscode-python.

Kongsea avatar Kongsea commented on August 15, 2024

Has this debug been resolved?
I still encounter it sometimes when I press F10 quickly to debug my program.

from vscode-python.

brettcannon avatar brettcannon commented on August 15, 2024

Does this happen for people when using our experimental debugger?

from vscode-python.

Kongsea avatar Kongsea commented on August 15, 2024

I use VSCode 1.21.1 and ms-python.python extension 2018.3.1 version.
I did not use the experimental debuger.
I encountered the error just when I just debug a program and I didn't watch any variables.

from vscode-python.

valleygtc avatar valleygtc commented on August 15, 2024

I encontered this problem too.
It happened sometimes. I don't kown why. It frustrates me.
Can somebody help to fix it.

from vscode-python.

brettcannon avatar brettcannon commented on August 15, 2024

The debugger team is focusing on the new experimental debugger, so verifying if this issue shows up there would be helpful.

from vscode-python.

fab35 avatar fab35 commented on August 15, 2024

The problems occurs (including in the latest versions) as soon as you debug hitting "FX" (where FX can be F5, F10...) keyboard too fast (or keeping the F10 down...). Annoying for debug...

from vscode-python.

adocampo avatar adocampo commented on August 15, 2024

I did suffered this as well, removing evaluation expression that I wasn't evaluating at that moment solved the issue.

from vscode-python.

osvalban avatar osvalban commented on August 15, 2024

I am running into this problem when I 'Step Over' quickly and have watched variables set in the debugger. It's kind of annoying because variables in the 'Variables' window get collapsed after they're modified by the code, hence why I started using the 'Watch' window. Is there a work-around to keep variables expanded under 'Variables'?

Environment:

  • Ubuntu 18.04 LTS
  • VS Code Version 1.23.1 @ Commit d0182c3417d225529c6d5ad24b7572815d0de9ac
  • Python VS Code extension version 2018.4.0 (2 May 2018)

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

@fab35 @adocampo @osvalban
As suggested in a previous comment, have you managed to test this issue out with the new experimental Python debugger?

  • Go into .vscode/launch.json file in your project/workspace folder
  • Change the setting "type":"python" to "type":"pythonExperimental"

from vscode-python.

osvalban avatar osvalban commented on August 15, 2024

@DonJayamanne the exception "RuntimeError: release unlocked lock" is gone, but now I see this stack trace thrown sporadically when hitting F10 repeatedly:

Traceback (most recent call last): File "/home/osvaldo/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/wrapper.py", line 796, in done fut.result() File "/home/osvaldo/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/futures.py", line 40, in result reraise(self._exc_info) File "/home/osvaldo/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/reraise3.py", line 8, in reraise raise exc_info[1].with_traceback(exc_info[2]) File "/home/osvaldo/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/futures.py", line 149, in callback x = next(it) File "/home/osvaldo/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/wrapper.py", line 1386, in on_evaluate pyd_tid, pyd_fid = self.frame_map.to_pydevd(vsc_fid) File "/home/osvaldo/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/wrapper.py", line 215, in to_pydevd return self._vscode_to_pydevd[vscode_id] KeyError: 1177

from vscode-python.

hyphenrf avatar hyphenrf commented on August 15, 2024

Seconding @osvalban

I followed this thread to see if the issue was acknowledged or if it was just a problem on my side of things. So hitting F10 repeatedly did return the runtime error on the python debugger, but not the experimental. The experimental complained without kicking me out:

Traceback (most recent call last): File "/home/user/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/wrapper.py", line 796, in done fut.result() File "/home/user/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/futures.py", line 40, in result reraise(self._exc_info) File "/home/user/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/reraise3.py", line8, in reraise raise exc_info[1].with_traceback(exc_info[2]) File "/home/user/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/futures.py", line 149, in callback x = next(it) File "/home/user/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/wrapper.py", line 1386, in on_evaluate pyd_tid, pyd_fid = self.frame_map.to_pydevd(vsc_fid) File "/home/user/.vscode/extensions/ms-python.python-2018.4.0/pythonFiles/experimental/ptvsd/ptvsd/wrapper.py", line 215, in to_pydevd return self._vscode_to_pydevd[vscode_id] KeyError: 426

Info about my system:

  • OS: Debian 9(testing)
  • CPU: Intel Pentium N3540 (4) @ 2.665GHz
  • Memory: 3830MiB
  • VSCode:
    • Version 1.23.1
    • Commit d0182c3417d225529c6d5ad24b7572815d0de9ac
    • Date 2018-05-10T16:04:33.747Z
    • Shell 1.7.12
    • Renderer 58.0.3029.110
    • Node 7.9.0
    • Architecture x64
  • VSCode was installed using dpkg v1.19.0.5(amd64)

I will attach the code that produced the issue and all the relevant files in the next comment

here's a scrot
2018-06-05-162516_1314x315_scrot

from vscode-python.

hyphenrf avatar hyphenrf commented on August 15, 2024

The script:

fil = open('rofi/mytheme.rasi','a+')

fil.seek(0)
lines=set(fil.readlines())
badlines=set()
for line in lines:
	if 'rgba' not in line:
		badlines.add(line)
lines=lines.difference(badlines)
newset=set()
for line in lines:
	percentage=line[line.rfind(',')+1:line.rfind('%')].strip()
	newpercentage=str(eval(percentage)/100)
	line=line.strip().replace(' ','').replace('%','')
	line=line.replace(percentage,newpercentage)
	newset.add(line)

fil.seek(0)
newbuffer=""
for line in fil:
	lineprop = line[:line.find(':')].strip()
	if 'rgba' in line:
		for item in newset:
			prop = item[:item.find(':')]
			print(prop)
			if prop == lineprop:
				line= "{} --> {}".format(line,item)
	newbuffer+=line

print(prop)
print(newbuffer)
fil.close()

and the file sample (the whole thing is a bit too large):

* {
    selected-normal-foreground:  rgba ( 129, 147, 150, 100 % );
    foreground:                  rgba ( 129, 147, 150, 100 % );
    normal-foreground:           @foreground;
    alternate-normal-background: rgba ( 0, 43, 55, 100 % );
    red:                         rgba ( 220, 50, 47, 100 % );
    selected-urgent-foreground:  rgba ( 218, 66, 129, 100 % );
    blue:                        rgba ( 38, 139, 210, 100 % );
    selected-normal-background:  rgba ( 0, 54, 66, 100 % );
    border-color:                @foreground;
    spacing:                     2;
}
#window {
    background-color: @background;
    border:           0;
    padding:          5;
}
textbox-prompt-colon {
    expand:     false;
    str:        ":";
    margin:     0px 0.3em 0em 0em ;
    text-color: @normal-foreground;
}

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

@osvalban @ZyptosKid

  • Please could you download the latest development build of the Python extension and try this out once again. Thanks. The development build contains a number of fixes related to the debugger (to be released this week).
  • I've tested this at my end and it works as expected.

from vscode-python.

no-response avatar no-response commented on August 15, 2024

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

from vscode-python.

DonJayamanne avatar DonJayamanne commented on August 15, 2024

@brettcannon any reason why this was reopened?

from vscode-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.