Breakpoints not always hit in multi-threaded app

In the above code, the breakpoint on line 21 is hit almost immediately after starting the app, which is expected. If you sit there for a moment, the loop in lines 5-7, which is running in a thread started by main() eventually completes and exits and the breakpoint on 10 is reached. PyCharm switches me to that thread/breakpoint. This is all good and expected, too.

While sitting on the breakpoint on line 10, however,  if I presume the Resume button, about 1/2 the time the app exits. The other 1/2 of the time, the debugger stops on like 22. I would expect it to always stop on line 22, and never just exit the app.

Is there any explanation for this or is this a bug?

PyCharm info:

PyCharm 2021.2.2 (Professional Edition)
Build #PY-212.5284.44, built on September 14, 2021
Licensed to Michael Lovett
You have a perpetual fallback license for this version.
Subscription is active until July 31, 2022.
Runtime version: 11.0.12+7-b1504.28 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-89-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 750M
Cores: 1

Current Desktop: XFCE

0
1 comment

Hi,

Could you please submit a ticket to https://youtrack.jetbrains.com with a textual code sample (not just screenshot), and steps to reproduce the issue?

0

Please sign in to leave a comment.