diff options
author | Dima Panov <fluffy@FreeBSD.org> | 2020-06-23 17:26:07 +0000 |
---|---|---|
committer | Dima Panov <fluffy@FreeBSD.org> | 2020-06-23 17:26:07 +0000 |
commit | 119d50b142519f558192cb03ee95b836efd6b9b6 (patch) | |
tree | 0ac0e13f041ba99dee1aef5a881483507055c66a | |
parent | 034e1ea32c363742ad4c5b1c0f82fe372424310c (diff) | |
download | ports-119d50b142519f558192cb03ee95b836efd6b9b6.tar.gz ports-119d50b142519f558192cb03ee95b836efd6b9b6.zip |
MFH: r539884
databases/py-mysqlclient: revert gc threaded patch
It caused python sigabort with a "GC object already tracked" message in singlethreaded app.
This happens only with a fetchmany() on a streaming cursor, MySQLdb.cursors.SSCursor.
PR: 246313
Reported by: Jeroen Pulles <jeroen.pulles@gmail.com>
Approved by: ports-secteam (joneum)
Notes
Notes:
svn path=/branches/2020Q2/; revision=539988
-rw-r--r-- | databases/py-mysqlclient/Makefile | 2 | ||||
-rw-r--r-- | databases/py-mysqlclient/files/patch-gitc67dbd41f | 32 |
2 files changed, 1 insertions, 33 deletions
diff --git a/databases/py-mysqlclient/Makefile b/databases/py-mysqlclient/Makefile index c5e26736fb89..306ed017e2b3 100644 --- a/databases/py-mysqlclient/Makefile +++ b/databases/py-mysqlclient/Makefile @@ -2,7 +2,7 @@ PORTNAME= mysqlclient DISTVERSION= 1.4.6 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= databases python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/databases/py-mysqlclient/files/patch-gitc67dbd41f b/databases/py-mysqlclient/files/patch-gitc67dbd41f deleted file mode 100644 index bc534e2654e3..000000000000 --- a/databases/py-mysqlclient/files/patch-gitc67dbd41f +++ /dev/null @@ -1,32 +0,0 @@ -From c67dbd41f13f5302120ad40fee94ea6c7ffc2bfc Mon Sep 17 00:00:00 2001 -From: Jason Fried <me@jasonfried.info> -Date: Wed, 5 Feb 2020 03:38:25 -0800 -Subject: [PATCH] Add some gc safety around _mysql__fetch_row (#348) - -Users of gc.get_referrers() could cause a SystemError to be raised if this function is running in a different python thread. ---- - MySQLdb/_mysql.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/MySQLdb/_mysql.c b/MySQLdb/_mysql.c -index 13280ac..1556fda 100644 ---- MySQLdb/_mysql.c -+++ MySQLdb/_mysql.c -@@ -1373,9 +1373,15 @@ _mysql_ResultObject_fetch_row( - convert_row = row_converters[how]; - if (maxrows) { - if (!(r = PyTuple_New(maxrows))) goto error; -- rowsadded = _mysql__fetch_row(self, &r, skiprows, maxrows, -- convert_row); -+ -+ // see: https://docs.python.org/3/library/gc.html#gc.get_referrers -+ // This function can get a reference to the tuple r, and if that -+ // code is preempted while holding a ref to r, the _PyTuple_Resize -+ // will raise a SystemError because the ref count is 2. -+ PyObject_GC_UnTrack(r); -+ rowsadded = _mysql__fetch_row(self, &r, skiprows, maxrows, convert_row); - if (rowsadded == -1) goto error; -+ PyObject_GC_Track(r); - } else { - if (self->use) { - maxrows = 1000; |