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

S3 client causes Segmentation fault when used with mysql.connector #2534

Closed
chrisdlangton opened this issue Aug 5, 2020 · 1 comment
Closed
Assignees
Labels
guidance Question that needs advice or information.

Comments

@chrisdlangton
Copy link

chrisdlangton commented Aug 5, 2020

my env

boto3==1.14.28
botocore==1.17.28
mysql-connector-python==8.0.21
Python 3.8.4 [GCC 8.3.0] on docker `python:3.8-slim-buster`

Reproduce easily

import boto3
from mysql.connector import errorcode

aws_session = boto3.Session(region_name='ap-southeast-2')
sqs_client = aws_session.resource('sqs')
print('sqs')
s3_client = aws_session.client('s3')
print('s3')
print(s3_client.list_buckets())

produces

sqs
Segmentation fault (core dumped)

comment out from mysql.connector import errorcode and it produces desired results;

sqs
s3
{'ResponseMetadata': ...
... etc

Any chance we can make boto3 work with the mysql.connector considering it is needed for RDS/Aurora?

I have naively ruled out the bug being a problem with mysql.connector using process of elimination. i.e. My existing app worked flawlessly using mysql.connector, i later added boto3 session for resource('sqs') and has been working for weeks, then i added resource('s3') and encountered Segmentation fault. Therefore the replication shows how SQS works but S3 fails, leading me to believe that boto3 likely works well with mysql.connector in general, both projects are not causing the segfault as a general incompatibility, but it is narrowed down to S3 client code path being the root cause that introduced the segfault.

thanks

@chrisdlangton chrisdlangton added the needs-triage This issue or PR still needs to be triaged. label Aug 5, 2020
@swetashre swetashre self-assigned this Aug 5, 2020
@swetashre
Copy link
Contributor

@chrisdlangton - Thank you for your post. This issue is not related to boto3. I am not able to reproduce the issue. So it looks like it it only reproducible in certain environment.

You would need to enable a debugger to see what mysql is doing, so whatever the probelm is in the mysql code happens to be triggered with the s3 client. It's not specific to the s3 client though.

There's a bug in mysql connector that will cause a segmentation fault if it's not imported first. It will fail even with standard library python modules. https://bugs.mysql.com/bug.php?id=97220. Have you tried by importing mysql first ?

@swetashre swetashre added guidance Question that needs advice or information. closing-soon This issue will automatically close in 4 days unless further comments are made. and removed needs-triage This issue or PR still needs to be triaged. labels Aug 7, 2020
@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants