Skip to content

2.0: PyObject_GC_Track: Assertion failed: object already tracked by the garbage collector #435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jamadden opened this issue Jul 2, 2020 · 2 comments · Fixed by #436
Closed

Comments

@jamadden
Copy link

jamadden commented Jul 2, 2020

Describe the bug

Iterating schema objects always crashes the interpreter with that exception. Occurs in CPython 3.5, 3.6, 3.7 and 3.8. Full details are in the RelStorage builds. For example, https://travis-ci.org/github/zodb/relstorage/jobs/704272334 is 3.8:

 Set up MySQL.drivers.MySQLdb in 0.000 seconds.
  Running:
    1/278 (0.4%)Modules/gcmodule.c:1934: PyObject_GC_Track: Assertion failed: object already tracked by the garbage collector
Enable tracemalloc to get the memory block allocation traceback

object  : ()
type    : tuple
refcount: 1
address : 0x3493c60
Fatal Python error: _PyObject_AssertFailed
Python runtime state: initialized

Current thread 0x00007f6ae3a36700 (most recent call first):
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/MySQLdb/cursors.py", line 335 in _fetch_row
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/MySQLdb/cursors.py", line 442 in fetchmany
  File "/home/travis/build/zodb/relstorage/src/relstorage/adapters/mysql/drivers/__init__.py", line 95 in __iter__
  File "/home/travis/build/zodb/relstorage/src/relstorage/adapters/_util.py", line 183 in _rows_as_dicts
  File "/home/travis/build/zodb/relstorage/src/relstorage/adapters/mysql/schema.py", line 120 in <dictcomp>
  File "/home/travis/build/zodb/relstorage/src/relstorage/adapters/mysql/schema.py", line 120 in __list_tables_and_engines
  File "/home/travis/build/zodb/relstorage/src/relstorage/adapters/mysql/schema.py", line 132 in __list_tables_not_innodb
  File "/home/travis/build/zodb/relstorage/src/relstorage/adapters/mysql/schema.py", line 186 in __convert_all_tables_to_innodb
  File "/home/travis/build/zodb/relstorage/src/relstorage/adapters/mysql/schema.py", line 200 in _prepare_with_connection
  File "/home/travis/build/zodb/relstorage/src/relstorage/adapters/connmanager.py", line 291 in open_and_call
  File "/home/travis/build/zodb/relstorage/src/relstorage/adapters/schema.py", line 738 in prepare
  File "/home/travis/build/zodb/relstorage/src/relstorage/storage/__init__.py", line 177 in __init__
  File "/home/travis/build/zodb/relstorage/src/relstorage/tests/__init__.py", line 216 in make_storage
  File "/home/travis/build/zodb/relstorage/src/relstorage/tests/reltestbase.py", line 1572 in _dst
  File "/home/travis/build/zodb/relstorage/src/relstorage/tests/RecoveryStorage.py", line 173 in checkPackWithGCOnDestinationAfterRestore
  File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 633 in _callTestMethod
  File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 676 in run
  File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 736 in __call__
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/zope/testrunner/runner.py", line 396 in run_tests
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/zope/testrunner/runner.py", line 473 in run_layer
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/zope/testrunner/runner.py", line 291 in run_tests
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/zope/testrunner/runner.py", line 191 in run
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/zope/testrunner/__init__.py", line 51 in run_internal
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/zope/testrunner/__init__.py", line 30 in run
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/zope/testrunner/__main__.py", line 19 in <module>
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/coverage/execfile.py", line 247 in run
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/coverage/cmdline.py", line 703 in do_run
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/coverage/cmdline.py", line 555 in command_line
  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/coverage/cmdline.py", line 827 in main
  File "/home/travis/virtualenv/python3.8.0/bin/coverage", line 8 in <module>

Environment

MySQL Server

+-------------------------+
| version()               |
+-------------------------+
| 5.7.30-0ubuntu0.16.04.1 |
+————————————+

MySQL Client

Whatever is available on Travis:

Operating System Details
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

mysql version
mysql  Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using  EditLine wrapper
jamadden added a commit to zodb/relstorage that referenced this issue Jul 2, 2020
jamadden added a commit to zodb/relstorage that referenced this issue Jul 2, 2020
jamadden added a commit to zodb/relstorage that referenced this issue Jul 2, 2020
@methane
Copy link
Member

methane commented Jul 3, 2020

Thank you for fast report. I just released v2.0.1. I think it fixes your issue.

@jamadden
Copy link
Author

jamadden commented Jul 3, 2020

Thank you for the fix. I confirm that the RelStorage tests pass with 2.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants