[MDEV-21361] +d,-d may break consistent state of DEBUG_DBUG Created: 2019-12-19  Updated: 2022-09-23

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: 10.2

Type: Bug Priority: Major
Reporter: Andrei Elkin Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: dbug

Issue Links:
Relates
relates to MDEV-29613 Improve WITH_DBUG_TRACE=OFF Closed

 Description   

There're few issues around using +d,-d with the intent to increment and restore the former
state of DEBUG_DBUG variable.
In particular when +d, keyword adds the very first keyword and by thus activates the state
for the specified keyword the following -d,keyword does remove the keyword but leaves the active state for everything, including pollution of the server error log.

There a patch

ommit 0b9400d1f54f4ae9b84decf53352850171880f1e
Author: Thayumanavar <thayumanavar.x.sachithanantha@oracle.com>
Date:   Thu May 2 16:22:57 2013 +0530
 
    BUG#11765644: DEBUG 'D' LIST SHOULD STAY EMPTY AFTER SET
                  DEBUG="+D,<SYMBOL>"
    PROBLEM AND FIX:
    When the debug 'd' flag has been set to empty, then all
    DBUG_ macros are enabled. But if one then sets debug="
    +d,foo" then only foo, all others are turned off. The
    expected/intended behaviour should be to add debug for
    'symbol' in addition to whatever was enabled before.
    The fix adds keyword to the stack of active keyword list
    if debug was not enabled for all symbols. Also turn debug
    off if the last keyword is removed from the stack of
    keywords. NOTE: This shall require a change in the docs
    to reflect the changed behaviour in this bug

that addresses that and few more use cases.


Generated at Thu Feb 08 09:06:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.