After upgrading from UV 11.3.3 to 11.3.4 I am having an issue causing Universe to crash. I am using the Pymysql library to read/write to a remote MariaDB Database, the same code worked fine before the update and is now crashing on run. What I have figured out so far:
- The issue is caused within the pymysql's connect() function. After adding some fault handling and looking at the trace (attached pythoncrash program.txt) sends me on a rabbit hole that ends in pymysql's _auth.py file. the scramble_native_password function on line 29. Specifically on line 34 when Hashlib runs the digest() function. I can recreate the issue with the functions directly from hashlib (pythoncrash TCL.txt) and I get the same issue.
- As a test I try to run a simple script that builds a hash and runs a digest....I crash when running from TCL, but I run successfully when calling from shell, telling me this is an issue somehow localized to Universe, and the changes in the 11.3.3 > 11.3.4 upgrade.
- /usr/uv/python/bin/python3 mytest.py
- Hashlib allows you to choose other hash methods than SHA1, I have tried with SHA256, MD5 and still have the issue.
- I have verified that I can connect to the MariaDB from shell with a mysql command
- I did try the REINIT.PYTHON OFF/ON commands with no change to my results.
I notice in the attached files that the issue appears to be coming from the libpython3.9.so files telling me there might be something broken in the way that Universe Python is using the C libraries, specifically around password/auth hashing.
Minimum working code example below:
def main():
psswd = "test1234".encode('utf-8')
import hashlib
test_hash = hashlib.new('sha256', psswd)
test_digest= test_hash.digest()
I would also love to know if anyone else can replicate this issue. Hashlib is part of the standard Python library, right now my issue is when I use pymysql, but my understanding is that many other libraries (requests library comes to mind) also use hashlib in the underlying logic.
Thanks for any assistance people can offer, I will keep updating this thread as I play around more.
------------------------------
Nic Davidson
Developer
Combined Transport Inc
Medford OR United States
------------------------------