Skip to content

When pydevd encounters a frame with line number of None, it cannot handle it. #319

@0oFebruaryo0

Description

@0oFebruaryo0

I'm trying to use pydev to do Spark executor debug. I added a pydevd.settrace in my executor's function.
pydevd shows below logs.
Stack: ./out.zip/mepy_algo/pyspark_test.py, executor_func, 76
Stack: /tmp/spark-7e5e382e-4365-485f-9160-08798b43ca75/out.zip/mepy_algo/pyspark_test.py, <lambda>, None
Stack: /opt/spark/python/lib/pyspark.zip/pyspark/util.py, wrapper, 73
because the path "/tmp/spark-7e5e382e-4365-485f-9160-08798b43ca75/out.zip/mepy_algo/pyspark_test.py" is my driver file path, so it can not be found in my executor with line number None

And pydevd send below command to my ide debug server as well.
sending cmd (quoted-line) --> CMD_THREAD_SUSPEND <xml><thread id="pid_300_id_140663942087248" stop_reason="111" message="" suspend_type="trace"><frame id="140663860877472" name="executor_func" file="/local1/pexes/venvs/3/4d654bb149373a964e489741382aa470aa1225bd/cba9b10390762edd539c75c9f4b40c564335d72d/lib/python3.10/site-packages/out.zip/mepy_algo/pyspark_test.py" line="76"></frame><frame id="140663941864512" name="&lt;lambda&gt;" file="/tmp/spark-7e5e382e-4365-485f-9160-08798b43ca75/out.zip/mepy_algo/pyspark_test.py" line="None"></frame><frame id="140663940397168" name="wrapper" file="/opt/spark/python/lib/pyspark.zip/pyspark/util.py" line="73"></frame><frame id="140663926075072" name="dump_stream" file="/opt/spark/python/lib/pyspark.zip/pyspark/serializers.py" line="259"></frame><frame id="140663846572608" name="process" file="/opt/spark/python/lib/pyspark.zip/pyspark/worker.py" line="596"></frame><frame id="94204823446240" name="main" file="/opt/spark/python/lib/pyspark.zip/pyspark/worker.py" line="604"></frame><frame id="94204827496960" name="worker" file="/opt/spark/python/lib/pyspark.zip/pyspark/daemon.py" line="74"></frame><frame id="94204826568096" name="manager" file="/opt/spark/python/lib/pyspark.zip/pyspark/daemon.py" line="186"></frame><frame id="140663926074576" name="&lt;module&gt;" file="/opt/spark/python/lib/pyspark.zip/pyspark/daemon.py" line="211"></frame><frame id="94204832459296" name="_run_code" file="/usr/local/lib/python3.10/runpy.py" line="86"></frame><frame id="94204826237392" name="_run_module_code" file="/usr/local/lib/python3.10/runpy.py" line="96"></frame><frame id="140663946017856" name="run_module" file="/usr/local/lib/python3.10/runpy.py" line="224"></frame><frame id="94204819918800" name="boot" file="/local1/pexes/venvs/3/4d654bb149373a964e489741382aa470aa1225bd/cba9b10390762edd539c75c9f4b40c564335d72d/pex" line="355"></frame><frame id="140663946011616" name="&lt;module&gt;" file="/local1/pexes/venvs/3/4d654bb149373a964e489741382aa470aa1225bd/cba9b10390762edd539c75c9f4b40c564335d72d/pex" line="380"></frame></thread></xml>

When IDE do decode about above command, it would say unable to decode None
2026-01-21 16:15:29,553 [12312758] SEVERE - #c.j.p.d.p.RemoteDebugger - Unable to decode None: For input string: "None" com.jetbrains.python.debugger.PyDebuggerException: Unable to decode None: For input string: "None" at com.jetbrains.python.debugger.pydev.ProtocolParser.readInt(ProtocolParser.java:449) at com.jetbrains.python.debugger.pydev.ProtocolParser.parseFrame(ProtocolParser.java:219) at com.jetbrains.python.debugger.pydev.ProtocolParser.parseThread(ProtocolParser.java:199) at com.jetbrains.python.debugger.pydev.RemoteDebugger.parseThreadEvent(RemoteDebugger.java:690) at com.jetbrains.python.debugger.pydev.RemoteDebugger.processThreadEvent(RemoteDebugger.java:632) at com.jetbrains.python.debugger.pydev.RemoteDebugger.processResponse(RemoteDebugger.java:571) at com.jetbrains.python.debugger.pydev.transport.BaseDebuggerReader.onTextAvailable(BaseDebuggerReader.java:100) at com.intellij.util.io.BaseOutputReader.sendText(BaseOutputReader.java:220) at com.intellij.util.io.BaseOutputReader.processInput(BaseOutputReader.java:204) at com.intellij.util.io.BaseOutputReader.readAvailableBlocking(BaseOutputReader.java:151) at com.jetbrains.python.debugger.pydev.transport.BaseDebuggerReader.doRun(BaseDebuggerReader.java:39) at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:249) at com.intellij.util.io.BaseDataReader.lambda$start$0(BaseDataReader.java:48) at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:334) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at com.intellij.util.concurrency.ContextCallable.lambda$call$1(ContextCallable.java:86) at com.intellij.concurrency.ThreadContext.installThreadContext(threadContext.kt:305) at com.intellij.util.concurrency.ContextCallable.lambda$call$2(ContextCallable.java:83) at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:96) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167) at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167) at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:173) at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:167) at com.intellij.util.concurrency.ContextRunnable.lambda$run$0(ContextRunnable.java:26) at com.intellij.concurrency.ThreadContext.resetThreadContext(threadContext.kt:294) at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:25) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732) at java.base/java.lang.Thread.run(Thread.java:1583)
We tested that this issue would not appear in Python 3.7 but would appear in Python 3.10. And our pydevd version is 3.4.1
Maybe pydevd can be compatible with the lineno None frame.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions