Bug #79710 Unable to use my_malloc() and my_free() in dynamic client plugins
Submitted: 20 Dec 2015 8:45 Modified: 30 Sep 2019 12:06
Reporter: Sergei Glushchenko (OCA) Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Server: Pluggable Authentication Severity:S3 (Non-critical)
Version:5.7.10 OS:Any
Assigned to: CPU Architecture:Any

[20 Dec 2015 8:45] Sergei Glushchenko
my_malloc() for dynamic plugins defined as mysql_malloc_service->mysql_malloc. mysql_malloc_service is global variable which value is injected by server when plugin is loaded (see plugin_dl_add in sql_plugin.c). plugin_dl_add is not invoked when plugin is loaded by client and using of my_malloc() and my_free() leads to SIGSEGV.

How to repeat:
Create dynamic client plugin using my_malloc() / my_free()

Suggested fix:
Inject mysql_malloc_service on plugin loading or make usage of my_malloc a compile time error for dynamic client plugins.
[29 Aug 2019 15:33] Sinisa Milivojevic
Hi Mr. Glushchenko,

Thank you for your bug report.

You have indicated that you are using an outdated release of your 5.7 version. Please, can you check our latest release, 5.7.27 and let us know whether your analysis still holds ground.

In the case that you think that there is still bug in our pluggable authentication, can you provide us with a code example ????

Also, my_malloc() and my_free() are contained within our C API, so linking should not be the problem.

We are waiting on your feedback.
[30 Sep 2019 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".