PS-8908: Mysqld crash when user forgets to set debug timeout #5117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://jira.percona.com/browse/PS-8908
Problem:
If 'debug_sync_timeout' parameter is not specified in my.cnf or as a command line argument, the usage of debug sync factility leads to the assertion.
Cause:
The default value of 'debug_sync_timeout' is 0, which means the debug sync factility is disabled. In such a case 'debug_sync_control' member of the THD is not initialized during THD initialization (debug_sync_init_thread()).
The callstack debug_sync_set_action => debug_sync_eval_action => debug_sync_get_action uses 'debug_sync_control' member unconditionally causing the assertion.
Solution:
There was a missing check for 'debug_sync_timeout' in the above-mentioned callstack. Similar checks are present in debug_sync_update() or debug_sync_init() functions. Added missing check.