Closed laurynas-biveinis closed 1 year ago
@sunshine-Chun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
Is this change data dictionary related?
It is a pre-existing regression that is visible on one of the DD-related testcases
If early plugin initialization fails, the plugin is unloaded with its entry remaining in plugin_array with PLUGIN_IS_FREED. The unloading of plugin will call dlclose, potentially unmapping its memory, including the plugin name constant. This may cause a crash in plugin_init_initialize_and_reap in the code which delays the raft plugin initialization by comparing its name. The crash is seen on macOS, MTR test perfschema.table_plugin_early_load, on a sanitizer-less build (enabling sanitizers disables the dlclose call).
Fix by moving plugin name check after the plugin state check, which excludes the PLUGIN_IS_FREED entries.
Squash with 0cf9341ab0a9751a8895dd073fc6ae9f3aa0bd89