| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
(cherry picked from commit bde808ad6ba5eee8a6201983cf071449d7ce7e39)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-135109) (GH-135128)
(cherry picked from commit 5b3865418ceb1448bfbf15cddf52c900cd5882a3)
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
|
| |
|
|
|
|
|
| |
The `getlogin` function is not thread-safe: replace with `getlogin_r` where
available.
(cherry picked from commit 1ffe913c2017b44804aca18befd45689df06c069)
Co-authored-by: Duane Griffin <duaneg@dghda.com>
|
| |
|
|
|
| |
gh-118201: Simplify conv_confname (#126089)
(cherry picked from commit c5c9286804e38c95fe717f22ce1bf2f18eee5b17)
|
| |
|
| |
Previously, the macro would be redefined when the header was included.
|
| |
|
|
|
|
| |
gh-58689: Fix os.kill() error handling on Windows (GH-128932)
(cherry picked from commit 939df0f9f6a76e0916b3ba53841e1413ab90952e)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
|
|
|
|
| |
(#128598)
(cherry picked from commit e08b28235a863323ca3a7e444776bb7803e77caf)
PR #14868 replaced the ttyname() call with ttyname_r(), but the old
check remained.
|
| |
|
|
|
|
|
|
| |
(#127630)
gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (GH-127593)
(cherry picked from commit fcbe6ecdb6ed4dd93b2ee144f89a73af755e2634)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
|
|
|
|
|
| |
The PyMutex implementation supports unlocking after fork because we
clear the list of waiters in parking_lot.c. This doesn't work as well
for _PyRecursiveMutex because on some systems, such as SerenityOS, the
thread id is not preserved across fork().
(cherry picked from commit 5610860840aa71b186fc5639211dd268b817d65f)
Co-authored-by: Sam Gross <colesbury@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-126336) (GH-126423)
(cherry picked from commit d3840503b0f590ee574fbdf3c96626ff8b3c45f6)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
(GH-124918) (#125332)
(cherry picked from commit cc2938a18967c9d462ebb18bc09f73e4364aa7d2)
|
| |
|
|
|
|
|
| |
to `p` (GH-124097) (#124919)
(cherry picked from commit 3b6bfa77aa4da2ce1f3a15e39831f8b85882698c)
Co-authored-by: sobolevn <mail@sobolevn.me>
|
| |
|
|
|
|
|
|
| |
(GH-123806) (#124270)
gh-123797: Check for runtime availability of `ptsname_r` on macos (GH-123806)
(cherry picked from commit 3e36e5aef18e326f5d1081d73ee8d8fefa1d82f8)
Co-authored-by: sobolevn <mail@sobolevn.me>
|
| |
|
|
|
|
|
| |
(#124543)
gh-123014: Disable pidfd API on older Android versions (#124458)
(cherry picked from commit c58c572a65eb5b93d054e779df289e975a0b9864)
|
| |
|
|
|
| |
point" (GH-121907) (GH-122012)
(cherry picked from commit 1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356)
|
| |
|
|
|
|
|
|
| |
(GH-120588) (#120616)
gh-120586: Fix several "unused function" warnings in `posixmodule.c` (GH-120588)
(cherry picked from commit 3df2022931f77c5cadb3f51b371be6ae17587ede)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
|
|
|
|
|
| |
This adds a `_PyRecursiveMutex` type based on `PyMutex` and uses that
for the import lock. This fixes some data races in the free-threaded
build and generally simplifies the import lock code.
(cherry picked from commit e21057b99967eb5323320e6d1121955e0cd2985e)
Co-authored-by: Sam Gross <colesbury@gmail.com>
|
| |
|
|
|
|
|
| |
(cherry picked from commit d9095194dde27eaabfc0b86a11989cdb9a2acfe1)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Michael Droettboom <mdboom@gmail.com>
|
| |
|
|
|
|
|
|
| |
Fix os.major(), os.minor() and os.makedev().
Support device numbers larger than 2**63-1.
Support non-existent device number (NODEV).
(cherry picked from commit 7111d9605f9db7aa0b095bb8ece7ccc0b8115c3f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
| |
posixmodule (GH-118355)
(cherry picked from commit 96b392df303b2cfaea823afcb462c0b455704ce8)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-118755)
(cherry picked from commit b64182550f73e556344bd754d32e3be5d22a74e1)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 94591dca510c796c7d40e9b4167ea56f2fdf28ca)
Co-authored-by: Steve Dower <steve.dower@python.org>
|
| |
|
|
|
|
|
| |
(GH-118800)
(cherry picked from commit 8af84b503d0b62a3db0d806d39f42c1e08746079)
Co-authored-by: Steve Dower <steve.dower@python.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR adds the ability to enable the GIL if it was disabled at
interpreter startup, and modifies the multi-phase module initialization
path to enable the GIL when loading a module, unless that module's spec
includes a slot indicating it can run safely without the GIL.
PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went
with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148.
A warning will be issued up to once per interpreter for the first
GIL-using module that is loaded. If `-v` is given, a shorter message
will be printed to stderr every time a GIL-using module is loaded
(including the first one that issues a warning).
|
| |
|
|
| |
of CURRENT_USER (GH-118515)
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
during deprecation period (GH-117354)
|
| |
|
|
|
|
|
|
|
| |
(#117481)
On Linux >= 2.6.36 with glibc < 2.27, `getcwd()` can return a relative
pathname starting with '(unreachable)'. We detect this and fail with
ENOENT, matching new glibc behaviour.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Split `_PyThreadState_DeleteExcept` into two functions:
- `_PyThreadState_RemoveExcept` removes all thread states other than one
passed as an argument. It returns the removed thread states as a
linked list.
- `_PyThreadState_DeleteList` deletes those dead thread states. It may
call destructors, so we want to "start the world" before calling
`_PyThreadState_DeleteList` to avoid potential deadlocks.
|
| |
|
|
|
| |
I missed this in gh-109921.
We also update Py_Exit() to call _PyInterpreterState_SetNotRunningMain(), if necessary.
|
| |
|
|
|
|
|
|
|
|
|
| |
This changes the free-threaded build to perform a stop-the-world pause
before deleting other thread states when forking and during shutdown.
This fixes some crashes when using multiprocessing and during shutdown
when running with `PYTHON_GIL=0`.
This also changes `PyOS_BeforeFork` to acquire the runtime lock
(i.e., `HEAD_LOCK(&_PyRuntime)`) before forking to ensure that data
protected by the runtime lock (and not just the GIL or stop-the-world)
is in a consistent state before forking.
|
| |
|
|
|
|
|
|
|
|
| |
Starting in Python 3.12, we prevented calling fork() and starting new threads
during interpreter finalization (shutdown). This has led to a number of
regressions and flaky tests. We should not prevent starting new threads
(or `fork()`) until all non-daemon threads exit and finalization starts in
earnest.
This changes the checks to use `_PyInterpreterState_GetFinalizing(interp)`,
which is set immediately before terminating non-daemon threads.
|
| |
|
|
|
| |
Use the NtQueryInformationProcess system call to efficiently retrieve the parent process ID in a single step, rather than using the process snapshots API which retrieves large amounts of unnecessary information and is more prone to failure (since it makes heap allocations).
Includes a fallback to the original win32_getppid implementation in case the unstable API appears to return strange results.
|
| | |
|
| |
|
|
|
|
|
|
| |
Return 0 on success. Set an exception and return -1 on error.
Fix os.timerfd_settime(): properly report exceptions on
_PyTime_FromSecondsDouble() failure.
No longer export _PyTime_FromSecondsDouble().
|
| |
|
|
| |
`posixmodule` (#116521)
|
| | |
|
| |
|
|
| |
(#116449)
|
| | |
|
| |
|
|
|
| |
<pycore_time.h> include is no longer needed to get the PyTime_t type
in internal header files. This type is now provided by <Python.h>
include. Add <pycore_time.h> includes to C files instead.
|
| |
|
|
|
| |
Run command:
sed -i -e 's!\<_PyTime_t\>!PyTime_t!g' $(find -name "*.c" -o -name "*.h")
|
| |
|
|
|
|
| |
This adds a safe memory reclamation scheme based on FreeBSD's "GUS" and
quiescent state based reclamation (QSBR). The API provides a mechanism
for callers to detect when it is safe to free memory that may be
concurrently accessed by readers.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add PythonFinalizationError exception. This exception derived from
RuntimeError is raised when an operation is blocked during the Python
finalization.
The following functions now raise PythonFinalizationError, instead of
RuntimeError:
* _thread.start_new_thread()
* subprocess.Popen
* os.fork()
* os.fork1()
* os.forkpty()
Morever, _winapi.Overlapped finalizer now logs an unraisable
PythonFinalizationError, instead of an unraisable RuntimeError.
|
| |
|
|
|
| |
(#115335)
It was the macro expansion! Sorry!
|
| |
|
|
| |
(#115236)
|
| |
|
|
|
|
|
|
|
|
| |
On macOS the statvfs interface returns block counts as
32-bit integers, and that results in bad reporting for
larger disks.
Therefore reimplement statvfs in terms of statfs, which
does use 64-bit integers for block counts.
Tested using a sparse filesystem image of 100TB.
|
| |
|
|
|
|
|
|
|
| |
Biased reference counting maintains two refcount fields in each object:
`ob_ref_local` and `ob_ref_shared`. The true refcount is the sum of these two
fields. In some cases, when refcounting operations are split across threads,
the ob_ref_shared field can be negative (although the total refcount must be
at least zero). In this case, the thread that decremented the refcount
requests that the owning thread give up ownership and merge the refcount
fields.
|
| |
|
|
|
| |
This changes a number of internal usages of `PyDict_SetDefault` to use `PyDict_SetDefaultRef`.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|