Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

concurrent.interpreters - buggy code leads to a crash during finalization #136568

Closed as duplicate of#128639
Labels
type-crashA hard crash of the interpreter, possibly with a core dump
@bluetech

Description

@bluetech

Crash report

What happened?

I experimented a bit withconcurrent.interpreters using Python 3.14.0b4 (uv installed version). The code is both wrong in the usage, and contains a typo - the linemv[0] = 1 refers to an unbound variable. But it crashes with a "Fatal Python error" which I think is something that should not be possible even for buggy programs (correct me if I'm wrong).

importtimefromconcurrentimportinterpretersdefsub(mv:memoryview):time.sleep(1)print(mv[0])defmain():buf=bytearray(1)interp=interpreters.create()t=interp.call_in_thread(sub,memoryview(buf))mv[0]=1t.join()main()

Output:

Traceback (most recent call last):  File "/home/ran/test.py", line 15, in <module>    main()    ~~~~^^  File "/home/ran/test.py", line 12, in main    mv[0] = 1    ^^NameError: name 'mv' is not definedException in thread Thread-1 (_call):Exception: AttributeError: module '__main__' has no attribute 'sub'The above exception was the direct cause of the following exception:concurrent.interpreters.NotShareableError: object could not be unpickledThe above exception was the direct cause of the following exception:Traceback (most recent call last):  File "/home/ran/.local/share/uv/python/cpython-3.14.0b4-linux-x86_64-gnu/lib/python3.14/threading.py", line 1081, in _bootstrap_inner    self._context.run(self.run)    ~~~~~~~~~~~~~~~~~^^^^^^^^^^  File "/home/ran/.local/share/uv/python/cpython-3.14.0b4-linux-x86_64-gnu/lib/python3.14/threading.py", line 1023, in run    self._target(*self._args, **self._kwargs)    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/home/ran/.local/share/uv/python/cpython-3.14.0b4-linux-x86_64-gnu/lib/python3.14/concurrent/interpreters/__init__.py", line 215, in _call    res, excinfo = _interpreters.call(self._id, callable, args, kwargs, restrict=True)                   ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^concurrent.interpreters.NotShareableError: func not shareableException ignored while joining a thread in _thread._shutdown():Traceback (most recent call last):  File "/home/ran/.local/share/uv/python/cpython-3.14.0b4-linux-x86_64-gnu/lib/python3.14/threading.py", line 1582, in _shutdown    _thread_shutdown()PythonFinalizationError: cannot join thread at interpreter shutdownFatal Python error: Py_EndInterpreter: not the last threadPython runtime state: finalizing (tstate=0x0000000001b40a48)Current thread 0x00007f27ee43d780 [python3.14] (most recent call first):  <no Python frame>Thread 0x00007f27ecd8b6c0 [Thread-1 (_call] (most recent call first):  File "/home/ran/.local/share/uv/python/cpython-3.14.0b4-linux-x86_64-gnu/lib/python3.14/concurrent/interpreters/__init__.py", line 215 in _call  File "/home/ran/.local/share/uv/python/cpython-3.14.0b4-linux-x86_64-gnu/lib/python3.14/threading.py", line 1023 in run  File "/home/ran/.local/share/uv/python/cpython-3.14.0b4-linux-x86_64-gnu/lib/python3.14/threading.py", line 1081 in _bootstrap_inner  File "/home/ran/.local/share/uv/python/cpython-3.14.0b4-linux-x86_64-gnu/lib/python3.14/threading.py", line 1043 in _bootstrapAborted (core dumped)

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.14.0b4 (main, Jul 8 2025, 21:00:06) [Clang 20.1.4 ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp