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

ControlDoublePrivate: log warning before assert fails. #4236

Merged
merged 2 commits into from
Aug 21, 2021

Conversation

daschuer
Copy link
Member

Make sure the warning is printed before the assertion kills mixxx.
This should help to debug issues discussed here:

https://mixxx.zulipchat.com/#narrow/stream/247620-development-help/topic/qDebug.20messages.20with.20DEBUG_ASSERTIONS_FATAL

@daschuer
Copy link
Member Author

@ronso0: This should help to find CO issues.

@coveralls
Copy link

coveralls commented Aug 20, 2021

Pull Request Test Coverage Report for Build 1153450206

  • 3 of 11 (27.27%) changed or added relevant lines in 1 file are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.001%) to 25.962%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/control/control.cpp 3 11 27.27%
Files with Coverage Reduction New Missed Lines %
src/control/control.cpp 4 76.61%
Totals Coverage Status
Change from base Build 1152021735: 0.001%
Covered Lines: 20004
Relevant Lines: 77051

💛 - Coveralls

qWarning()
<< "ControlObject"
<< key.group << key.item
<< "already created";
DEBUG_ASSERT(false);
Copy link
Member

Choose a reason for hiding this comment

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

The condition is out of sight here. Please use something like

Suggested change
DEBUG_ASSERT(false);
DEBUG_ASSERT(!"Tried to create Control Object that already exists.");

qWarning() << "Cannot set" << m_key << "by Midi";
DEBUG_ASSERT(false);
Copy link
Member

Choose a reason for hiding this comment

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

Same here

qWarning() << "Cannot set" << m_key << "by Midi";
DEBUG_ASSERT(false);
Copy link
Member

Choose a reason for hiding this comment

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

And here

qWarning() << "Cannot get" << m_key << "by Midi";
DEBUG_ASSERT(false);
Copy link
Member

Choose a reason for hiding this comment

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

And here

@daschuer
Copy link
Member Author

Done

@ronso0
Copy link
Member

ronso0 commented Aug 21, 2021

Thanks @daschuer

btw when testing with Shade it stopped here for [Channel3], end_of_track. I can not be trigger this reliably though it happened more often when one deck was playing in the track end region earlier.

if (!flags.testFlag(ControlFlag::NoWarnIfMissing)) {
qWarning() << "ControlDoublePrivate::getControl returning NULL for ("
<< key.group << "," << key.item << ")";
DEBUG_ASSERT(flags.testFlag(ControlFlag::NoAssertIfMissing));
}

Copy link
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

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

LGTM, thank you.

@uklotzde uklotzde merged commit c9df5af into mixxxdj:main Aug 21, 2021
@daschuer daschuer deleted the assert_debug branch September 26, 2021 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants