-
Notifications
You must be signed in to change notification settings - Fork 451
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
Tribler main
does not run on Python 3.10
#7728
Comments
It works for me if I run Tribler from the commit you specified. OS: macOS. Also, all checks on GitHub seem to work correctly with the latest main: https://github.com/Tribler/tribler/actions/workflows/!main.yml |
This sounds pretty severe. More info: cannot reproduce on |
I can't reproduce this either (Windows 10 + Python 3.8). |
I can consistently reproduce the issue both on my office PC and home PC, both Ubuntu 22.04. Here is a screen recording of it. Here are the exact steps to reproduce:
On a fresh state directory, there is no issue so it is consistent with GitHub Actions success run since those actions likely run on fresh state directory. The issue lies on the second run onwards and is likely related to the upgrading process which requires further investigation. Note: Python version used is |
The issue can also be reproduced using the binary built using GitHub actions - Ubuntu build with Python 3.10 Checking the coredump, here is the stack trace top Here is the thread stacktrace
This is likely the underlying issue? |
On further investigation, it seems Here are two minimal reproducible examples for Python3.10 # example1.py
from pathlib import Path
from PyQt5.QtCore import QThread
from tribler.core.upgrade.tribler_db.migration_chain import TriblerDatabaseMigrationChain
STATE_DIR = '/home/user/.Tribler/7.13'
class WorkerThread(QThread):
def run(self):
print("Thread Starting")
migration_chain = TriblerDatabaseMigrationChain(Path(STATE_DIR))
migration_chain.execute() # <-- This is where segfault is triggered when the thread finishes
print("Thread Finished")
if __name__ == "__main__":
thread = WorkerThread()
thread.start()
thread.wait()
print("Main Thread Finished") # example2.py
from PyQt5.QtCore import QThread
from tribler.core.components.database.db.tribler_database import TriblerDatabase
from tribler.core.upgrade.tribler_db.scheme_migrations.scheme_migration_0 import scheme_migration_0
STATE_DIR = '/home/user/.Tribler/7.13'
DB_PATH = f'{STATE_DIR}/sqlite/tribler.db'
class WorkerThread(QThread):
def run(self):
print("Thread Starting")
db = TriblerDatabase(DB_PATH, check_tables=False)
scheme_migration_0(db, state_dir=STATE_DIR) # <-- This is where segfault is triggered when the thread finishes
print("Thread Finished")
if __name__ == "__main__":
thread = WorkerThread()
thread.start()
thread.wait()
print("Main Thread Finished") Running these example codes result in: Thread Starting
Thread Finished
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) |
main
does not run from sourcemain
does not run on Python 3.10
I was able to reproduce and fix the issue; I need a bit more time to check the details. As @xoriole found, the problem is indeed sqlite-related, and to fix it, we need to properly close the database connection when we stop using some thread. I'll try to implement a generic solution at the |
Running Tribler
main
from the source does not work. It crashes with the following stack trace.Commit: c09b5b5
Windows 10, Python 3.10
Ubuntu 22.04, Python 3.10
The text was updated successfully, but these errors were encountered: