Commit Graph

11320 Commits

Author SHA1 Message Date
Miss Islington (bot) 0e4a5e96f0
[3.8] bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
This fixes a possible memory leak in the C implementation of
asyncio.Task.
(cherry picked from commit d2c349b190)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
2020-05-08 04:28:38 -07:00
Victor Stinner b07350901c
bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654)
Fix the Windows implementation of os.waitpid() for exit code
larger than "INT_MAX >> 8". The exit status is now interpreted as an
unsigned number.
2020-04-22 17:57:59 +02:00
Serhiy Storchaka bfda4db0d2
[3.8] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19583)
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
(cherry picked from commit 12446e6a60)
2020-04-18 19:11:48 +03:00
Miss Islington (bot) 6b0ca0aeab
bpo-40294: Fix _asyncio when module is loaded/unloaded multiple times (GH-19542)
(cherry picked from commit a75e730075)

Co-authored-by: Jeffrey Quesnelle <jquesnelle@gmail.com>
2020-04-16 19:29:50 -07:00
Miss Islington (bot) c496e29c2b
closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against old OpenSSL. (GH-19506)
(cherry picked from commit 584a3cfda4)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-04-13 20:31:18 -07:00
Miss Islington (bot) f35e7d3bb0
closes bpo-39953: Generate ifdefs around library code definitions. (GH-19490)
(cherry picked from commit 909b87d2bb)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-04-12 12:17:34 -07:00
Miss Islington (bot) 61511488cf
bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19485)
(cherry picked from commit 402e1cdb13)
2020-04-12 17:18:57 +02:00
Miss Islington (bot) 2714c907df
closes bpo-39953: Update OpenSSL error codes table. (GH-19082)
I updated the error codes using the OpenSSL 1.1.1f source tree.
(cherry picked from commit 3e0dd3730b)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-04-11 13:53:00 -07:00
Miss Islington (bot) 572ef74769
bpo-39689: Do not use native packing for format "?" with standard size (GH-18969)
(cherry picked from commit 472fc843ca)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-03-31 05:26:05 -07:00
Miss Islington (bot) 6a0ee60db4
bpo-40121: Fixes audit event raised on creating a new socket (GH-19238)
(cherry picked from commit 63ba5cccf4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-31 04:57:06 -07:00
Miss Islington (bot) af6fd1faa6
bpo-40014: Fix os.getgrouplist() (GH-19126)
Fix os.getgrouplist(): if getgrouplist() function fails because the
group list is too small, retry with a larger group list.

On failure, the glibc implementation of getgrouplist() sets ngroups
to the total number of groups. For other implementations, double the
group list size.
(cherry picked from commit f5c7cabb2b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-24 10:40:31 -07:00
Miss Islington (bot) 21bee0bd71
bpo-40014: Fix os.getgrouplist() on macOS (GH-19118)
On macOS, getgrouplist() returns a non-zero value without setting
errno if the group list is too small. Double the list size and call
it again in this case.
(cherry picked from commit 8ec7370c89)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-23 12:18:41 -07:00
Miss Islington (bot) 687f5921a4
bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942)
(cherry picked from commit b146568dfc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-03-21 07:32:25 -07:00
Miss Islington (bot) 9644702936
bpo-39582: ossaudiodev module update helpers signature for ioctl calls. (GH-18412)
(cherry picked from commit b81f40f0ad)

Co-authored-by: David CARLIER <devnexen@gmail.com>
2020-03-14 07:43:53 -07:00
Mark Dickinson e634a8ac1f
[3.8] bpo-39871: Fix possible SystemError in atan2, copysign and remainder (GH-18806) (GH-18989)
In math_2(), the first PyFloat_AsDouble() call should be checked
for failure before the second call.

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>.
(cherry picked from commit 5208b4b379)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-03-14 11:38:52 +00:00
Serhiy Storchaka ab9c729121
[3.8] bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863). (GH-18954)
(cherry picked from commit e5ccc94bbb)
2020-03-12 09:30:56 +02:00
Miss Islington (bot) 97bbdb28b4
bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850)
(cherry picked from commit 88944a44aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-03-09 05:55:17 -07:00
Serhiy Storchaka a7b8a969eb
[3.8] bpo-38913: Fix segfault in Py_BuildValue("(sGH-O)", ...) if entered with exception raised. (GH-18656). (GH-18732)
(cherry picked from commit 28d0bcac8b)
2020-03-02 09:54:43 +02:00
Miss Islington (bot) 5f2ade20a5
bpo-39378: partial of PickleState struct should be traversed. (GH-18046)
(cherry picked from commit 1f577ce363)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2020-03-01 22:47:23 -08:00
Stefan Krah fec6681f7a
[3.8] Explicitly initialize like the surrounding code (GH-18717) 2020-02-29 23:08:04 +01:00
Stefan Krah 4d7012410c
[3.8] bpo-39794: Add --without-decimal-contextvar (GH-18702)
(cherry picked from commit 815280eb16)
2020-02-29 22:16:32 +01:00
Miss Islington (bot) b19f7ecfa3
bpo-39681: Fix C pickle regression with minimal file-like objects (GH-18592) (#18630)
Fix a regression where the C pickle module wouldn't allow unpickling from a
file-like object that doesn't expose a readinto() method.
(cherry picked from commit 9f37872e30)

Co-authored-by: Antoine Pitrou <antoine@python.org>

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2020-02-23 23:53:24 +01:00
Miss Islington (bot) b6271025c6
bpo-39576: Prevent memory error for overly optimistic precisions (GH-18581) (#18584)
(cherry picked from commit 90930e6545)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-02-21 02:16:42 +01:00
Miss Islington (bot) 9c87fbe54e
Valgrind no longer supports --db-attach=yes. (GH-18568) (#18576)
(cherry picked from commit c0cb8beb38)

Co-authored-by: Stefan Krah <skrah@bytereef.org>

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-02-20 19:38:19 +01:00
Miss Islington (bot) 0721f7afb0
Use the new recommended number of repetitions in the refleak tests. (GH-18569) (#18574)
(cherry picked from commit 1246d89203)

Co-authored-by: Stefan Krah <skrah@bytereef.org>

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-02-20 19:31:39 +01:00
Miss Islington (bot) 471d2b9ce0
Update runall.bat to the latest Windows build system. (GH-18571) (#18573)
(cherry picked from commit 9b833e00e4)

Co-authored-by: Stefan Krah <skrah@bytereef.org>

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-02-20 19:31:11 +01:00
Steve Dower a00b5be5f7
bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, `resource`, `shutil`, `signal`, `syslog` (GH-18407)
Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2020-02-13 08:30:27 +00:00
Miss Islington (bot) 669981b3b1
closes bpo-39621: Make buf arg to md5_compress be const. (GH-18497)
(cherry picked from commit 597ebed748)

Co-authored-by: Andy Lester <andy@petdance.com>
2020-02-12 21:12:53 -08:00
Miss Islington (bot) 190433d815
closes bpo-39605: Fix some casts to not cast away const. (GH-18453)
gcc -Wcast-qual turns up a number of instances of casting away constness of pointers. Some of these can be safely modified, by either:

Adding the const to the type cast, as in:

-    return _PyUnicode_FromUCS1((unsigned char*)s, size);
+    return _PyUnicode_FromUCS1((const unsigned char*)s, size);

or, Removing the cast entirely, because it's not necessary (but probably was at one time), as in:

-    PyDTrace_FUNCTION_ENTRY((char *)filename, (char *)funcname, lineno);
+    PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno);

These changes will not change code, but they will make it much easier to check for errors in consts
(cherry picked from commit e6be9b59a9)

Co-authored-by: Andy Lester <andy@petdance.com>
2020-02-11 18:47:20 -08:00
Miss Islington (bot) dc56f5f488 bpo-39590: make deque.__contains__ and deque.count hold strong references (GH-18421) (GH-18423)
(cherry picked from commit c6dedde160)

Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>

Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>
2020-02-09 00:39:28 -08:00
Miss Islington (bot) 3498ac55bc
bpo-39184: Add audit events to command execution functions in os and pty modules (GH-17824)
(cherry picked from commit 95f6001021)

Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2020-02-04 16:32:32 -08:00
Miss Islington (bot) 30e769382d
closes bpo-39510: Fix use-after-free in BufferedReader.readinto() (GH-18295)
When called on a closed object, readinto() segfaults on account
of a write to a freed buffer:

    ==220553== Process terminating with default action of signal 11 (SIGSEGV): dumping core
    ==220553==  Access not within mapped region at address 0x2A
    ==220553==    at 0x48408A0: memmove (vg_replace_strmem.c:1272)
    ==220553==    by 0x58DB0C: _buffered_readinto_generic (bufferedio.c:972)
    ==220553==    by 0x58DCBA: _io__Buffered_readinto_impl (bufferedio.c:1053)
    ==220553==    by 0x58DCBA: _io__Buffered_readinto (bufferedio.c.h:253)

Reproducer:

    reader = open ("/dev/zero", "rb")
    _void  = reader.read (42)
    reader.close ()
    reader.readinto (bytearray (42)) GH-GH-GH- BANG!

The problem exists since 2012 when commit dc469454ec added code
to free the read buffer on close().

Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
(cherry picked from commit cb1c0746f2)

Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
2020-02-04 13:41:55 -08:00
Antoine Pitrou 1723687339
[3.8] bpo-39492: Fix a reference cycle between reducer_override and a Pickler instance (GH-18266) (#18316)
https://bugs.python.org/issue39492

Automerge-Triggered-By: @pitrou
(cherry picked from commit 0f2f35e)

Co-authored-by: Pierre Glaser <pierreglaser@msn.com>
2020-02-02 21:22:57 +01:00
Miss Islington (bot) 46735c7e10
bpo-39393: Misleading error message on dependent DLL resolution failure (GH-18093)
(cherry picked from commit 13c1c3556f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-28 02:00:16 -08:00
Miss Islington (bot) a46728a570
bpo-39426: Fix outdated default and highest protocols in docs (GH-18154)
Some portions of the pickle documentation hadn't been updated for the pickle protocol changes in Python 3.8 (new protocol 5, default protocol 4). This PR fixes those docs.

https://bugs.python.org/issue39426
(cherry picked from commit e9652e8d58)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2020-01-24 02:20:35 -08:00
Miss Islington (bot) 993811ffe7
bpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118)
* bpo-39421: Fix posible crash in heapq with custom comparison operators

* fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators

* fixup! fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators
(cherry picked from commit 79f89e6e5a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-01-23 07:22:25 -08:00
Miss Islington (bot) eb9ba2f66d bpo-16575: Disabled checks for union types being passed by value. (GH-17960) (GH-17964)
Although the underlying libffi issue remains open, adding these
checks have caused problems in third-party projects which are in
widespread use. See the issue for examples.

The corresponding tests have also been skipped.

(cherry picked from commit c12440c371)
2020-01-12 11:41:07 +00:00
Miss Islington (bot) 45e5750a01
closes bpo-39262: Use specific out-of-memory message in _sharedexception_bind. (GH-17908)
(cherry picked from commit 5cae042f68)

Co-authored-by: Alex Henrie <alexhenrie24@gmail.com>
2020-01-08 19:07:38 -08:00
Miss Islington (bot) aa3efea9c5 bpo-38532: Add missing decrefs in PyCFuncPtr_FromDll() (GH-17811)
(cherry picked from commit e02ab59fdf)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-03 13:50:11 +01:00
Miss Islington (bot) 9d3cacd590
[3.8] bpo-38820: OpenSSL 3.0.0 compatibility. (GH-17190) (GH-17499)
test_openssl_version now accepts version 3.0.0.

getpeercert() no longer returns IPv6 addresses with a trailing new line.

Signed-off-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38820
(cherry picked from commit 2b7de6696b)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38820



Automerge-Triggered-By: @tiran
2019-12-07 09:20:27 -08:00
Miss Islington (bot) ce0a2a8620
Make repr of C accelerated TaskWakeupMethWrapper the same as of pure Python version (GH-17484)
(cherry picked from commit 969ae7aca8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-12-07 03:41:41 -08:00
Miss Islington (bot) 836cf31a3c
bpo-37931: Fix crash on OSX re-initializing os.environ (GH-15428)
On most platforms, the `environ` symbol is accessible everywhere.

In a dylib on OSX, it's not easily accessible, you need to find it with
_NSGetEnviron.

The code was caching the *value* of environ. But a setenv() can change the value,
leaving garbage at the old value. Fix: don't cache the value of environ, just
read it every time.
(cherry picked from commit 723f71abf7)

Co-authored-by: Benoit Hudson <benoit@imgspc.com>
2019-12-06 11:32:33 -08:00
Miss Islington (bot) f4a21d3b23
bpo-38965: Fix faulthandler._stack_overflow() on GCC 10 (GH-17467)
Use the "volatile" keyword to prevent tail call optimization
on any compiler, rather than relying on compiler specific pragma.
(cherry picked from commit 8b787964e0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-04 12:30:31 -08:00
Miss Islington (bot) 68669ef788
bpo-38634: Allow non-apple build to cope with libedit (GH-16986)
The readline module now detects if Python is linked to libedit at runtime
on all platforms.  Previously, the check was only done on macOS.

If Python is used as a library by a binary linking to libedit, the linker
resolves the rl_initialize symbol required by the readline module against
libedit instead of libreadline, which leads to a segfault.

Take advantage of the existing supporting code to have readline module being
compatible with both situations.
(cherry picked from commit 7105319ada)

Co-authored-by: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
2019-12-04 08:21:16 -08:00
Victor Stinner 84c36c152a
bpo-36854: Fix reference counter in PyInit__testcapi() (GH-17338)
Increment properly Py_True/Py_False reference counter for
_testcapi.WITH_PYMALLOC variable.
2019-11-22 13:39:36 +01:00
Miss Islington (bot) daf7a082b2
bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235)
(cherry picked from commit d51a363a43)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-20 02:26:48 -08:00
Miss Islington (bot) a5ed2fe0ee
bpo-38823: Fix refleaks in faulthandler init error path on Windows (GH-17250)
(cherry picked from commit ac2235432c)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-19 15:31:08 -08:00
Miss Islington (bot) bec7015dcc
bpo-38622: Ensure ctypes.PyObj_FromPtr audit event passes tuples as a single argument (GH-17243)
(cherry picked from commit dcf1f83de8)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-11-18 13:59:51 -08:00
Miss Islington (bot) 47db7439dd
bpo-38622: Add missing audit events for ctypes module (GH-17158)
(cherry picked from commit 00923c6399)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-11-18 11:53:34 -08:00
Miss Islington (bot) 42a4359390
bpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206)
https://bugs.python.org/issue38823
(cherry picked from commit 289cf0fbf7)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-18 07:10:31 -08:00