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

Fix a SEGV when using mariadb connector #247

Closed
wants to merge 1 commit into from

Conversation

atoomic
Copy link

@atoomic atoomic commented Mar 14, 2018

When using mariadb connector 3.0.3 with DBD::mysql
we can notice a segfault on reconnection due
to the fact that the mysql extensions are not reset.

Doing the extra init as performed by DBD::mariadb
with some extra save and restore fixes the issue.

When using mariadb connector 3.0.3 with DBD::mysql
we can notice a segfault on reconnection due
to the fact that the mysql extensions are not reset.

Doing the extra init as performed by DBD::mariadb
with some extra save and restore fixes the issue.
@atoomic
Copy link
Author

atoomic commented Mar 14, 2018

note: that appveyor CI issue seems not related to the issue

Building Time-HiRes-1.9755 ... ! Installing Time::HiRes failed. See C:\Users\appveyor\.cpanm\work\1521052705.1676\build.log for details. Retry with --force to force install it.
166FAIL

@atoomic
Copy link
Author

atoomic commented Mar 14, 2018

error discussed upstream here: https://jira.mariadb.org/browse/CONC-316

@pali
Copy link
Member

pali commented Mar 16, 2018

This patch is of course incorrect/incomplete and not for production usage. I created it for DBD::MariaDB just as quick fix until I fix it properly.

@atoomic
Copy link
Author

atoomic commented Mar 17, 2018

@pali thanks for your input, I understand that this code is not optimized and might be incomplete, when trying to restore the context on a freshly created connection, but I think in most cases disconnect/reconnect should not be frequent, and clearly prefer a full reconnection rather than a segfault at this point.

What other issues do you have in mind? Any known problems with this approach outside performance?

Would you not consider using mariadb connector 3.0.3 with DBD::mysql? Would you prefer using DBD::MariaDB instead?

thanks

@pali
Copy link
Member

pali commented Mar 27, 2018

I will try to fix this problem properly without touching internal MYSQL structures... basically it is needed for proper support when compiled against new version of MariaDB Connector/C.

For production code I suggest to stick with old client libraries MySQL 5.6/5.7 or MariaDB 10.0, both are still supported by upstream.

For testing you can use DBD::MariaDB with Connector/C 3.x or MariaDB 10.3, but be aware that there can be changes in future, prior uploading version to CPAN.

@pali
Copy link
Member

pali commented Jun 7, 2018

As wrote this copied code in this pull request is wrong and should not be used.

Proper fix for this problem is now in DBD::MariaDB master branch from this pull request:
perl5-dbi/DBD-MariaDB#63

@dveeden
Copy link
Collaborator

dveeden commented Jan 7, 2019

Closing this as this is now handled in #291 ( dc32f84 ).

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 this pull request may close these issues.

3 participants