Skip to content
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

Memory corruption in mysql_real_query #97

Closed
2 tasks done
Vercantez opened this issue Nov 13, 2024 · 0 comments · Fixed by #98
Closed
2 tasks done

Memory corruption in mysql_real_query #97

Vercantez opened this issue Nov 13, 2024 · 0 comments · Fixed by #98

Comments

@Vercantez
Copy link
Contributor

What happens?

When scanning my very small MySQL server I consistently get a SIGABRT in mysql_real_query. It looks like it's due to mysql_real_query not being protected by a lock as it should be according to the libmysql docs

In particular, you must ensure that between calls to mysql_real_query() or mysql_query() and mysql_store_result() in one thread, no other thread uses the same connection.

macOS crash report attached. Two threads are clearly simultaneously in mysql_real_query().
Python-2024-11-12-142406.ips.zip

To Reproduce

Different on macOS vs Amazon linux.

        db = duckdb.connect(":memory:")
        db.execute("INSTALL MYSQL;")
        db.execute(f"ATTACH 'database={database_connection_info['database']} user={database_connection_info['user']} password={database_connection_info['password']} host={database_connection_info['host']} port={database_connection_info['port']}' AS mysqldb (TYPE MYSQL, READ_ONLY);")
        db.execute(f"USE mysqldb.{database_connection_info['database']};")
        db.execute("SET enable_external_access = false;")
        db.execute("SHOW;")

OS:

macOS 15.1 and Amazon Linux 2023

MySQL Version:

8.0.35

DuckDB Version:

v1.1.2 f680b7d08f

DuckDB Client:

Python

Full Name:

Miguel Angel Salinas

Affiliation:

camelAI

Have you tried this on the latest main branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree
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.

1 participant