Frames not available in non-suspended state

已回答

I am trying to debug a pytest script that hangs.  There are threads that use paramiko to execute remote commands.  
The hang involves those threads failing to sense that the remote  command has completed.

If I run with the debugger (running on a remote server),  I can pause it.

The problem is that the threads I care about only give me "frames not available in non-suspended state."

Any ideas how to get past this?

1

Hi Adam, could you please switch the suspend policy for a breakpoint to All instead of Thread in Run | View Breakpoints?

Has it helped?

-2

Hi, I have the same problem.

I have changed the breakpoint default (and it's current state) to suspend 'All', but the problem remains.

My code is the following:

from threading import Thread, Event
from time import sleep
import os
import multiprocessing
def foo(process_name, event=None):
if event:
print(f'{process_name} waiting')
event.wait()
print(process_name, os.getpid(), 'finish')


if __name__ == '__main__':
e1 = multiprocessing.Event()
e2 = multiprocessing.Event()

t1 = Thread(target=foo, args=('t1', e1), name='t1')
t2 = multiprocessing.Process(target=foo, args=('t2', e2,), name='t2')

t1.start()
t2.start()

while True:
sleep(0.5)

So when i run on debug mode and am waiting on the sleep(0.5), i get that i can't reach the running thread t1.

Using python 3.7.5, pycharm 2020.1 Pro, win10

1

Same issue here. I get a mutex lock somewhere, but when I pause it I just get a thread that "works" and is fine but I have no idea which other thread is broken... setting breakpints/enabling all threads is not working as I dont know where it fails. This is useless. Why is there no global checkbox that tells it to monitor all threads?!

1

Same issue and useless help comment with PyCharm 2022.2

0
# Simpler reproducing code, intellij ultimate 2024.2.2 : 

import concurrent.futures
import time


def threaded_function():
    print("Frames not available in non-suspended state ?")  # Breakpoint here


def thread_two():
    c = False  # It should be possible to inspect this variable from the breakpoint, but it doesn't work.
    time.sleep(10)
    return c


with concurrent.futures.ThreadPoolExecutor() as executor:
    a = executor.submit(thread_two)
    executor.submit(threaded_function)

There's a very specific workaround : 

1. Add to the evaluated expressions in the debugger something (for example “c” in this repro). 
2. Turn on/off the debugger setting “show variable values in editor”. The thread which you couldn't inspect is now inspectable

So definitely looks like a bad bug in intellij.

0

请先登录再写评论。