| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
00147 #
Add a sys._debugmallocstats() function
Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198
Sent upstream as http://bugs.python.org/issue14785
|
|
|
|
| |
(GH-17081)
|
| |
|
|
|
|
|
|
|
| |
(GH-13860) (GH-13898)
(cherry picked from commit dc2476500d91082f0c907772c83a044bf49af279)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
| |
Fix possible overflow in wrap_lenfunc() when
sizeof(long) < sizeof(Py_ssize_t) (e.g., 64-bit Windows).
(cherry picked from commit 05f16416d99dc9fc76fef11e56f16593e7a5955e)
|
|
|
|
|
|
|
| |
typeobject.c. (GH-13403)
(cherry picked from commit 53d378c81286644138415cb56da52a7351e1a477)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
| |
(cherry picked from commit f0be4bbb9b3cee876249c23f2ae6f38f43fa7495)
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
(GH-11276) (GH-11534)
Format character "%s" in PyString_FromFormat() no longer read memory
past the limit if precision is specified.
(cherry picked from commit d586ccb04f79863c819b212ec5b9d873964078e4)
|
|
|
|
| |
(GH-11515)
|
|
|
|
|
| |
(GH-11175) (GH-11249)
(cherry picked from commit 842acaab1376c5c84fd5966bb6070e289880e1ca)
|
|
|
|
|
|
|
|
|
| |
When Python is compiled in debug mode, PyMem_Malloc() uses debug
hooks, but it also uses pymalloc allocator instead of malloc().
Problem: pymalloc is not thread-safe, whereas PyMem_Malloc() is
thread-safe in release mode (it's a thin wrapper to malloc() in this
case).
Modify the debug hook to use malloc() for PyMem_Malloc().
|
|
|
|
|
|
|
|
|
|
| |
(GH-10538)
Discovered using clang's MemorySanitizer.
A msan build will fail by simply executing: ./python -c 'u"\N"'
(cherry picked from commit 746b2d3)
Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google LLC]
|
|
|
|
|
|
|
| |
(GH-9885)
The bytearray constructor converted unexpected exceptions
(e.g. MemoryError and KeyboardInterrupt) to TypeError.
(cherry picked from commit e890421e334ccf0c000c6b29c4a521d86cd12f47)
|
|
|
| |
It was accidentally added in 107f3cc791d223dc06b7c80f0de672e88ae6a8d1.
|
|
|
|
|
|
|
| |
Many type object initializations labeled a field "tp_size" in the
comment, but the name of that field is tp_basicsize..
(cherry picked from commit 0e0bc4e221f592f305d335faf5f8046484eb9238)
Co-authored-by: Peter Eisentraut <peter@eisentraut.org>
|
|
|
|
|
|
| |
When calling tp_descr_get(self, obj, type), make sure that
we own a strong reference to "self".
(cherry picked from commit 8f735485acf2e35a75d2fa019feb8f905598c4e5)
|
|
|
|
|
|
|
|
| |
type_init() (GH-8876)
Reported by Svace static analyzer.
(cherry picked from commit f6247aac08c1a79d0479145a405718bb76dba434)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix compilation warning in _ctypes module on Window
(cherry picked from commit 20f11fe43c47b68c8b9dd6539d2d40b66c9957f9)
* Fix compilation warnings on Windows 64-bit
(cherry picked from commit 725e4212229bf68f87d4f66c1815d444ddfc7aa5)
* Fix compiler warning in unicodeobject.c
Explicitly case to Py_UNICODE to fix the warning:
Objects\unicodeobject.c(4225): warning C4244: '=' :
conversion from 'long' to 'Py_UNICODE', possible loss of data
The downcast cannot overflow since we check that value <= 0x10ffff.
|
| |
|
|
|
|
| |
int in PySlice_GetIndices (GH-8480)
|
|
|
|
| |
Fixes incorrect error text for int('1', base=1000)
and long('1', base=1000).
|
|
|
|
|
| |
(cherry picked from commit 491bbedc209fea314a04cb3015da68fb0aa63238)
Co-authored-by: lekma <lekmalek@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 0301c9bdd1ebd788d1334cf3fe06c48f35bab0dc)
Co-authored-by: Stefano Taschini <taschini@users.noreply.github.com>
|
|
|
|
|
| |
(GH-6111)
(cherry picked from commit e32bbaf376a09c149fa7c7f2919d7c9ce4e2a055)
|
|
|
|
|
|
|
|
|
| |
(GH-6026). (GH-6074) (GH-6076)
(cherry picked from commit 26c9f565d016db21257a60d29ab2c99383dd5ac7)
(cherry picked from commit 04aadf23eac51fec2e436c5960c1362bbb7d03de)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
| |
(cherry picked from commit d7773d92bd11640a8c950d6c36a9cef1cee36f96)
|
|
|
|
|
|
|
|
|
| |
(GH-4570) (#5493)
instead of crashing due to a stack overflow.
This perhaps will fix similar problems in other extension types.
(cherry picked from commit 1fb72d2ad243c965d4432b4e93884064001a2607)
|
|
|
| |
830daae1c82ed33deef0086b7b6323e5be0b0cc8 added some new GIL-releasing to new_buffersize. This is fine, but it's better to avoid reacquiring the GIL for as long as possible. Also, it should use FILE_(BEGIN|END)_ALLOW_THREADS to avoid having the file closed from under it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Multiple threads iterating over a file can corrupt the file's internal readahead
buffer resulting in crashes. To fix this, cache buffer state thread-locally for
the duration of a file_iternext call and only update the file's internal state
after reading completes.
No attempt is made to define or provide "reasonable" semantics for iterating
over a file on multiple threads. (Non-crashing) races are still
present. Duplicated, corrupt, and missing data will happen.
This was originally fixed by 6401e5671781eb217ee1afb4603cc0d1b0367ae6, which
raised an exception from seek() and next() when concurrent operations were
detected. Alas, this simpler solution breaks legitimate use cases such as
capturing the standard streams when multiple threads are logging.
|
|
|
|
|
|
|
|
| |
In fileio, there were 3 fstat() calls and one lseek() call that did not
release the GIL during the call. This can cause all threads to hang for
unlimited time when using io.FileIO with inaccessible NFS server.
Same issue seen in fileio exists also in fileobject, fixed in the same
way.
|
|
|
|
|
|
|
|
| |
_PyObject_DebugReallocApi() now calls Py_FatalError() if realloc()
fails to shrink a memory block.
Call Py_FatalError() because _PyObject_DebugReallocApi() erased freed
bytes *before* realloc(), expecting that realloc() *cannot* fail to
shrink a memory block.
|
|
|
|
| |
threads. (#3672)
|
|
|
|
|
|
|
|
|
| |
Document the following functions:
* PyObject_Malloc()
* PyObject_Realloc()
* PyObject_Free()
Document also the pymalloc allocator.
|
|
|
|
|
|
| |
rejecting (GH-4158) (#4163)
separators that are not bytes-like objects..
(cherry picked from commit a2314283ff87c65e1745a42c2f2b716b1a209128)
|
|
|
|
|
| |
(GH-3753). (#3761)
(cherry picked from commit 0e950dd22b075b4809c84afda8aede02b76ac0fa)
|
|
|
| |
This no-op change makes 2.7 more consistent with 3.x to ease comparison and backports.
|
|
|
| |
(cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
|
|
|
|
|
|
| |
some builtin and extension objects that don't support pickling
explicitly and are pickled incorrectly by default (like memoryview or
staticmethod).
|
|
|
|
| |
(#2174)
|
|
|
|
|
| |
Based on patches by Duane Griffin and Tim Mitchell.
(cherry picked from commit 753bca3934a7618a4fa96e107ad1c5c18633a683)
|
|
|
|
|
|
| |
attribute names. (GH-1652) (#1675)
Based on patch by Eryk Sun.
(cherry picked from commit d896985bb2de49046f9b6879e906d1e4db255e23)
|
| |
|
|
|
|
|
|
| |
In PySlice_IndicesEx, clip the step to [-PY_SSIZE_T_MAX,
PY_SSIZE_T_MAX] rather than [PY_SSIZE_T_MIN, PY_SSIZE_T_MAX].
(cherry picked from commit e6fc7401a92c7b51a80782d8095819b9909a0322)
|
|
|
|
| |
PySlice_GetIndicesEx in _ctypes.c.
|
|
|
|
| |
(cherry picked from commit b879fe8)
|
|
|
|
|
|
|
| |
(#887) (#907) (#910)
when pass indices of wrong type.
(cherry picked from commit d4edfc9abffca965e76ebc5957a92031a4d6c4d4)
(cherry picked from commit bf4bb2e43030661e568d5d4b046e8b9351cc164c)
|
|
|
|
|
|
| |
* bpo-29602: fix signed zero handling in complex constructor
* Add missing have_getformat definition; remove use of unittest subtests.
|
|
|
|
| |
weakref objects (#128) (#187)
|