◐ Shell
reader mode source ↗
Skip to content

[3.10] bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758)#26824

Merged
vstinner merged 1 commit into
python:3.10from
miss-islington:backport-45a78f9-3.10
Jun 21, 2021
Merged

[3.10] bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758)#26824
vstinner merged 1 commit into
python:3.10from
miss-islington:backport-45a78f9-3.10

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 21, 2021

Copy link
Copy Markdown
Contributor

_thread.start_new_thread() no longer calls PyThread_exit_thread()
explicitly at the thread exit, the call was redundant.

On Linux with the glibc, pthread_cancel() loads dynamically the
libgcc_s.so.1 library. dlopen() can fail if there is no more
available file descriptor to open the file. In this case, the process
aborts with the error message:

"libgcc_s.so.1 must be installed for pthread_cancel to work"

pthread_cancel() unwinds back to the thread's wrapping function that
calls the thread entry point.

The unwind function is dynamically loaded from the libgcc_s library
since it is tightly coupled to the C compiler (GCC). The unwinder
depends on DWARF, the compiler generates DWARF, so the unwinder
belongs to the compiler.

Thanks Florian Weimer and Carlos O'Donell for their help on
investigating this issue.
(cherry picked from commit 45a78f9)

Co-authored-by: Victor Stinner vstinner@python.org

https://bugs.python.org/issue44434

_thread.start_new_thread() no longer calls PyThread_exit_thread()
explicitly at the thread exit, the call was redundant.

On Linux with the glibc, pthread_cancel() loads dynamically the
libgcc_s.so.1 library. dlopen() can fail if there is no more
available file descriptor to open the file. In this case, the process
aborts with the error message:

"libgcc_s.so.1 must be installed for pthread_cancel to work"

pthread_cancel() unwinds back to the thread's wrapping function that
calls the thread entry point.

The unwind function is dynamically loaded from the libgcc_s library
since it is tightly coupled to the C compiler (GCC). The unwinder
depends on DWARF, the compiler generates DWARF, so the unwinder
belongs to the compiler.

Thanks Florian Weimer and Carlos O'Donell for their help on
investigating this issue.
(cherry picked from commit 45a78f9)

Co-authored-by: Victor Stinner <vstinner@python.org>
@miss-islington

Copy link
Copy Markdown
Contributor Author

@vstinner: Status check is done, and it's a success ✅ .

@miss-islington

Copy link
Copy Markdown
Contributor Author

@vstinner: Status check is done, and it's a success ✅ .

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

LGTM, good bot.

@vstinner vstinner merged commit 6614eac into python:3.10 Jun 21, 2021
@miss-islington miss-islington deleted the backport-45a78f9-3.10 branch June 21, 2021 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants