Encountering "Fatal Python error: Segmentation fault" error in python script

Recently my system got upgraded from ubuntu18.04.1 to ubuntu22.04.2 and as a result of which the following got upgraded as below:
python 3.7.5 to python 3.10.6
Mysql 5.7.38 to Mysql 8.0.31

I see, segmentation faults occurring in irregular intervals with no repeated stack traces.
The issue was not seen prior to upgrade and no code changes have been made during and after upgrade.
None of default setting/configurations have been modified.
I am using pymysql(1.0.2) to connect to Mysql.

  1. Does ubuntu22.04.2 version along with above upgrades consume additional memory space, if so any suggestions on how much this could be approximately?
  2. Are any default system configurations modified from ubuntu18.04.1 to ubuntu22.04.2, that needs to be changed?
  3. Are there any known defects from this upgarde that can be pointed to (python modules associated with python3.10.6 etc)?
  4. Does python3.10.6 has any memory limitations, if so where to check those values?

How did you install pymysql? Was that from Ubuntu’s repositories, a third-party apt repository, or with pip? Do you use a virtual environment?

My guess is that something needs to be updated to match the Python update, or possibly the MySQL update (but less likely).

I have installed pymysql and other packages with pip only.

Okay, cool. Did you freshly install them under Python 3.10? Do you do global, user, or venv installations? Whichever way, it may be worth doing a quick update (run the same pip install command that got it for you the first time, and add the -U parameter) to see if there’s a new version - or to see if there are any error messages.