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

PS-8908: Mysqld crash when user forgets to set debug timeout #5117

Open
wants to merge 1 commit into
base: 8.0
Choose a base branch
from

Conversation

kamil-holubicki
Copy link
Contributor

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.

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.
@@ -1975,6 +1975,11 @@ bool debug_sync_set_action(THD *thd, const char *action_str, size_t len) {
assert(thd);
assert(action_str);

// A zero value keeps the facility disabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess MTR framework always has debug sync enabled? Is it possible to use different cnf or start mysqld without debug sync enabled and execute testcase provided in the bug report?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, probably MTR framework always sets debug_sync_timeout, so the problem is not visible. The problem is visible if you start the server standalone without specifying it and execute debug sync queries manually like it is in the bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants