When Python is built with the intel control-flow protection flags,
-mcet -fcf-protection, gdb is not able to read the stack without
actually jumping inside the function. This means an extra
'next' command is required to make the $pc (program counter)
enter the function and make the stack of the function exposed to gdb.
Co-Authored-By: Marcel Plch <gmarcel.plch@gmail.com>
(cherry picked from commit 9b7c74ca32)
(cherry picked from commit 79d21331e6)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
Let .chm document display non-ASCII characters properly
Escape the `body` part of .chm source file to 7-bit ASCII, to fix visual effect on some MBCS Windows systems.
(cherry picked from commit 6261ae9b01)
Co-authored-by: animalize <animalize@users.noreply.github.com>
bpo-6721: When os.fork() was called while another thread holds a logging lock, the child process may deadlock when it tries to log. This fixes that by acquiring all logging locks before fork and releasing them afterwards.
A regression test that fails before this change is included.
Within the new unittest itself: There is a small _potential_ due to mixing of fork and a thread in the child process if the parent's thread happened to hold a non-reentrant library call lock (malloc?) when the os.fork() happens. buildbots and time will tell if this actually manifests itself in this test or not. :/ A functionality test that avoids that would be a challenge.
An alternate test that isn't trying to produce the deadlock itself but just checking that the release and acquire calls are made would be the next best alternative if so.
(cherry picked from commit 19003841e9)
Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
The docs were ambiguous about whether you pass in a coroutine function
or a coroutine object, e.g. is it:
aestack.push_async_exit(some_async_func)
or
aestack.push_async_exit(some_async_func())
(It's the first one.)
(cherry picked from commit a3c88ef12c)
Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.
(cherry picked from commit 7bb9cd0a67)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
The C implementation of asyncio.Task currently fails to perform the
cancellation cleanup correctly in the following scenario.
async def task1():
async def task2():
await task3 # task3 is never cancelled
asyncio.current_task().cancel()
await asyncio.create_task(task2())
The actuall error is a hardcoded call to `future_cancel()` instead of
calling the `cancel()` method of a future-like object.
Thanks to Vladimir Matveev for noticing the code discrepancy and to
Yury Selivanov for coming up with a pathological scenario..
(cherry picked from commit 548ce9dedd)
Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
https://bugs.python.org/issue34872
formatfloat() was not checking if PyBytes_FromStringAndSize()
failed, which could lead to a null pointer dereference in
_PyBytes_FormatEx().
(cherry picked from commit 96c5932794)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly.
(cherry picked from commit 97bfe8d3eb)
Co-authored-by: tzickel <tzickel@users.noreply.github.com>
* Compiling a string annotation containing a lambda with keyword-only
argument without default value caused a crash.
* Remove the final "*" (it is incorrect syntax) in the representation of
lambda without *args and keyword-only arguments when compile from AST.
* Improve the representation of lambda without arguments.
(cherry picked from commit 2a2940e5c3)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Switch "list" with "iterable" to match with the implementation.
(cherry picked from commit e45473e3ca)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
_pickle.Unpickler.__init__() should return -1 if Pdata_New() fails, not 1.
(cherry picked from commit 4b430e5f69)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_multiprocessing_spawn and after examining
similar failures in test_socket, some errors in the calculation of
ancillary data buffers were found in multiprocessing.reduction.
CMSG_LEN() can often be used as the buffer size for recvmsg() to
receive a single item of ancillary data, but RFC 3542 requires portable
applications to use CMSG_SPACE() and thus include space for padding,
even when the item will be the last in the buffer.
The failures we experience are due to the usage of CMSG_LEN() instead of
CMSG_SPACE().
(cherry picked from commit 077061a7b2)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Improvements:
1. Include the number of valid data characters in the error message.
2. Mention "number of data characters" rather than "length".
https://bugs.python.org/issue34736
(cherry picked from commit 1fba2ffc37)
Co-authored-by: Tal Einat <taleinat+github@gmail.com>
After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_socket that are using
testFDPassSeparateMinSpace(), FreeBDS revision 337423 was pointed
out to be the reason the test started to fail.
A close examination of the manpage for cmsg_space(3) reveals that
the number of file descriptors needs to be taken into account when
using CMSG_LEN().
This commit fixes tests in test_socket to use correctly CMSG_LEN, taking
into account the number of FDs.
(cherry picked from commit 7291108d88)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Use a monotonic clock to compute timeouts in :meth:`Executor.map` and :func:`as_completed`, in order to prevent timeouts from deviating when the system clock is adjusted.
This may not be sufficient on all systems. On POSIX for example, the actual waiting (e.g. in ``sem_timedwait``) is specified to rely on the CLOCK_REALTIME clock.
(cherry picked from commit a94ee12c26)
Co-authored-by: orlnub123 <orlnub123@gmail.com>
Currently, the docs state that when doing `Type[X]`, X is only allowed to
be a class, a union of classes, and Any. This pull request amends
that sentence to clarify X may also be a typevar (or a union involving
classes, Any, and TypeVars).
(cherry picked from commit 130717fe58)
Co-authored-by: Michael Lee <michael.lee.0x2a@gmail.com>
Fix the following warning:
Python/pystrtod.c: In function 'format_float_short':
Python/pystrtod.c:1007:13: warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
strncpy(p, "ERR", 3);
(cherry picked from commit 9fb8415759)
Also make docs for NEWFALSE and NEWTRUE more consistent
with docs for other opcodes.
(cherry picked from commit 488cfb78c8)
Co-authored-by: Krzysztof Wroblewski <krzysiek.wr@gmail.com>
Have macOS 10.9+ installer builds for 3.7.1rc and 3.6.7rc use a development
snapshot of Tk 8.6 (post-8.6.8) to mitigate certain scroller issues seen
with IDLE and tkinter apps.