This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Michael.Felt
Recipients BTaskaya, David.Edelsohn, Michael.Felt, pablogsal, vstinner
Date 2020-04-14.12:53:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <369df245-35e0-134f-32d4-368ae75ef0be@felt.demon.nl>
In-reply-to <1586816309.41.0.344299340093.issue40244@roundup.psfhosted.org>
Content
Also tried this:

         ./python -E -S -m sysconfig --generate-posix-vars ; if test $?
-ne 0 ; then  echo "generate-posix-vars failed" ;  rm -f
./pybuilddir.txt ;  exit 1 ;  fi
Objects/genobject.c:127: _PyObject_GC_TRACK: Assertion "!(((PyGC_Head
*)(op)-1)->_gc_next != 0)" failed: object already tracked by the garbage
collector
Enable tracemalloc to get the memory block allocation traceback

object address  : 30084150
object refcount : 0
object type     : 20013718
object type name: generator
object repr     : <refcnt 0 at 30084150>

Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: core initialized

Current thread 0x00000001 (most recent call first):
  File "<frozen importlib._bootstrap_external>", line 1593 in _setup
  File "<frozen importlib._bootstrap_external>", line 1634 in _install
  File "<frozen importlib._bootstrap>", line 1189 in
_install_external_importers
/bin/sh: 17302202 IOT/Abort trap(coredump)
make: 1254-004 The error code from the last command is 134.

Stop.
$ git diff
diff --git a/Objects/genobject.c b/Objects/genobject.c
index d3455f8..e783636 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -119,7 +119,7 @@ gen_dealloc(PyGenObject *gen)
 {
     PyObject *self = (PyObject *) gen;

-    _PyObject_GC_UNTRACK(gen);
+    _PyObject_GC_UNTRACK(self);

     if (gen->gi_weakreflist != NULL)
         PyObject_ClearWeakRefs(self);
$

On 14/04/2020 00:18, Batuhan Taskaya wrote:
> Batuhan Taskaya <batuhanosmantaskaya@gmail.com> added the comment:
>
> By the noticed something that looks kind of weird, not sure if it is intentional or not but shouldn't this be self instead of gen
>
> static void
> gen_dealloc(PyGenObject *gen)
> {
>     PyObject *self = (PyObject *) gen;
> <<<<
> _PyObject_GC_UNTRACK(gen);
> <<<<
>     if (gen->gi_weakreflist != NULL)
>         PyObject_ClearWeakRefs(self);
>     _PyObject_GC_TRACK(self);
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue40244>
> _______________________________________
>
History
Date User Action Args
2020-04-14 12:53:04Michael.Feltsetrecipients: + Michael.Felt, vstinner, David.Edelsohn, pablogsal, BTaskaya
2020-04-14 12:53:04Michael.Feltlinkissue40244 messages
2020-04-14 12:53:03Michael.Feltcreate