[New-bugs-announce] [issue37395] Core interpreter should be linked with libgcc_s.so on Linux

Zack Weinberg report at bugs.python.org
Mon Jun 24 21:09:57 EDT 2019


New submission from Zack Weinberg <zackw at panix.com>:

There are several existing issues (e.g. #18748 and #35866) where at least part of the problem is that GNU libc tried to dlopen() `libgcc_s.so` at a moment when that's not safe, e.g. during thread or process shutdown.  This converts a recoverable error into a deadlock or crash.

This is arguably a bug in glibc, but Python can easily work around it by linking the core interpreter (the `python` executable and/or `libpython.so`) with libgcc_s at build time (`-lgcc_s`) on Linux.  It will then be loaded already if and when it's needed, and glibc won't try to load it on demand.

In order for this to be 100% reliable, it needs to be at least theoretically possible for code within the interpreter to call a function defined in libgcc_s.so. `_Unwind_Backtrace` is probably the most practical option.  (See https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/baselib--unwind-backtrace.html .)

----------
components: Interpreter Core
messages: 346468
nosy: zwol
priority: normal
severity: normal
status: open
title: Core interpreter should be linked with libgcc_s.so on Linux
type: crash

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37395>
_______________________________________


More information about the New-bugs-announce mailing list