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

fix assertion in Lp1839669 #2235

Merged
merged 7 commits into from
Dec 9, 2019
Merged

fix assertion in Lp1839669 #2235

merged 7 commits into from
Dec 9, 2019

Conversation

daschuer
Copy link
Member

This should fix a https://bugs.launchpad.net/mixxx/+bug/1839669.
Unfortunately I can't reproduce the bug by loading a first track only.

Copy link
Member

@ywwg ywwg left a comment

Choose a reason for hiding this comment

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

Fix looks good, just a few comment nits for typos. Thanks!

double ratio = m_tempo_ratio_old;
if (ratio == 0.0) {
// In case the track is slowed done to zero we will have INF relaining seconds
// We jump back to a rate of 1.0 to show a useful time.
Copy link
Member

Choose a reason for hiding this comment

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

inconsistent tabbing in this block

Copy link
Member

Choose a reason for hiding this comment

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

fix typo: "In case the track is slowed done to zero we will have INF remaining seconds.
// We jump back to a rate of 1.0 to show a useful time."

Copy link
Contributor

Choose a reason for hiding this comment

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

@daschuer Ping

Copy link
Member Author

Choose a reason for hiding this comment

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

Also fixed

// no track loaded, function not called in this case
return;
if (!m_trackSampleRateOld) {
// this happens if Deck Passthrough is active but no track is loaded
Copy link
Member

Choose a reason for hiding this comment

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

punctuation: "This happens if Deck Passthrough is active but no track is loaded. We skip indicator updates."

Copy link
Contributor

Choose a reason for hiding this comment

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

@daschuer Ping

Copy link
Member Author

Choose a reason for hiding this comment

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

This should also be fixed.

if (dSeconds < 0.0) {
// negative durations are not supported
if (dSeconds < 0.0 || !isfinite(dSeconds)) {
// negative durations and isnane high values are not supported
Copy link
Member

Choose a reason for hiding this comment

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

isnane -> isNaN

Copy link
Contributor

Choose a reason for hiding this comment

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

@daschuer typo still not fixed

Copy link
Member Author

Choose a reason for hiding this comment

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

I cannot find this anymore.

@daschuer
Copy link
Member Author

Done, thank you for review.

src/util/duration.cpp Outdated Show resolved Hide resolved
@uklotzde uklotzde added the engine label Sep 1, 2019
@uklotzde uklotzde added this to the 2.3.0 milestone Sep 1, 2019
Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

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

Test fails because the special case "?" is not handled.

@uklotzde
Copy link
Contributor

uklotzde commented Sep 9, 2019

@daschuer Ping

@uklotzde
Copy link
Contributor

@daschuer Ping again

@daschuer
Copy link
Member Author

Thank you for the remainder. Done!

@uklotzde
Copy link
Contributor

Please merge master and push again. I still see test failures in the AppVeyor Windows build.

@uklotzde
Copy link
Contributor

@daschuer Ping

@uklotzde
Copy link
Contributor

I'm experiencing another debug assertion. Not sure it is a follow-up error that will be fixed by this PR:

Critical [CachingReaderWorker 2]: DEBUG ASSERT: "even(static_cast<int>(currentClosestBeat))" in function void QuantizeControl::updateClosestBeat(double) at /tmp/mixxx/src/engine/controls/quantizecontrol.cpp:122
Critical [Engine]: DEBUG ASSERT: "m_trackSampleRateOld && m_tempo_ratio_old" in function void EngineBuffer::updateIndicators(double, int) at /tmp/mixxx/src/engine/enginebuffer.cpp:1205

#0  0x00007ffff63e8af5 in raise () at /lib64/libpthread.so.0
#1  0x000000000065a519 in mixxx::(anonymous namespace)::MessageHandler(QtMsgType, QMessageLogContext const&, QString const&) (type=<optimized out>, input=...)
    at /tmp/mixxx/src/util/logging.cpp:133
#2  0x00007ffff41e6321 in qt_message_print(QtMsgType, QMessageLogContext const&, QString const&) () at /lib64/libQt5Core.so.5
#3  0x00007ffff41e6439 in qt_message(QtMsgType, QMessageLogContext const&, char const*, __va_list_tag*) () at /lib64/libQt5Core.so.5
#4  0x00007ffff41b8712 in QMessageLogger::critical(char const*, ...) const () at /lib64/libQt5Core.so.5
#5  0x00000000004e59da in mixxx_debug_assert(char const*, char const*, int, char const*)
    (function=0x109d348 "void QuantizeControl::updateClosestBeat(double)", line=122, file=0x109d310 "/tmp/mixxx/src/engine/controls/quantizecontrol.cpp", assertion=0x109d378 "even(static_cast<int>(currentClosestBeat))") at /usr/include/qt5/QtCore/qlogging.h:91
#6  0x00000000004e59da in mixxx_maybe_debug_assert_return_true(char const*, char const*, int, char const*)
    (function=0x109d348 "void QuantizeControl::updateClosestBeat(double)", line=122, file=0x109d310 "/tmp/mixxx/src/engine/controls/quantizecontrol.cpp", assertion=0x109d378 "even(static_cast<int>(currentClosestBeat))") at /tmp/mixxx/src/util/assert.h:16
#7  0x00000000004e59da in QuantizeControl::updateClosestBeat(double) (this=0x2b424e0, dCurrentSample=<optimized out>) at /tmp/mixxx/src/engine/controls/quantizecontrol.cpp:122
#8  0x00000000010b72d2 in  ()
#9  0x00007fff31bcc0f0 in  ()
#10 0x000000000096aeef in QuantizeControl::trackLoaded(std::shared_ptr<Track>) (this=0x2b424e0, pNewTrack=...) at /tmp/mixxx/src/engine/controls/quantizecontrol.cpp:49
#11 0x000000000097ec3b in EngineBuffer::notifyTrackLoaded(std::shared_ptr<Track>, std::shared_ptr<Track>) (this=0x21b2320, pNewTrack=
    std::shared_ptr<Track> (use count 29, weak count 1) = {...}, pOldTrack=std::shared_ptr<Track> (empty) = {...}) at /usr/include/c++/9/ext/atomicity.h:96
#12 0x000000000097f181 in EngineBuffer::slotTrackLoaded(std::shared_ptr<Track>, int, int) (this=0x21b2320, pTrack=..., iTrackSampleRate=44100, iTrackNumSamples=15213218)

The actual values upon loading a new track:

Debug [CachingReaderWorker 2]: dCurrentSample 0 prevBeat -8703.79 nextBeat 26112 closestBeat -1 currentClosestBeat -8703.79

Looks like uninitialized or bogus values.

@uklotzde
Copy link
Contributor

I didn't notice those issues recently, because debug assertions were unintentionally disabled.

@uklotzde
Copy link
Contributor

uklotzde commented Oct 27, 2019

It happens for various files, different formats, at different positions. I will revert back from a CMake build to an SCons build and test again. Update: Issues are independent of the build system.

@uklotzde
Copy link
Contributor

Caused by #2196

@daschuer
Copy link
Member Author

Fix was merged in #2334
Merge after CI has passed?

@uklotzde
Copy link
Contributor

Still test failures

@daschuer
Copy link
Member Author

On my system the test runs without any issues.

Strange the first works the second not.
EXPECT_EQ(false, isfinite(std::numeric_limits::infinity()));
EXPECT_EQ(false, __builtin_isfinite(std::numeric_limits::infinity()));

Anyway I need to guard for qint64 max es well. Hopefully the test go though then.

@daschuer
Copy link
Member Author

Finally all tests succeed @ywwg @uklotzde anything else?

@Holzhaus
Copy link
Member

Builds, all tests pass and the debug assertion no longer occurs when trying to load a track into a deck with passthrough enabled. LGTM.

A bit OT: We should really try to improve the passthough UX. I had this issue a while back when the "CH 1 INPUT" hardware switch on my controller was accidently set to "LINE" (which enables passthrough for that deck). I didn't realize that at first and wondered for ~15 minutes why I can load a track into that deck but Mixxx refuses to play it. Can we disable the deck completely (no track loading, grey out all play/pause/cue buttons, replace waveform with a) a live waveform from the input stream or b) a overlay that says "Passthrough")?

@uklotzde
Copy link
Contributor

LGTM

Ping @ywwg

Copy link
Member Author

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

This should be ready to merged, or did I miss a comment?

@uklotzde
Copy link
Contributor

uklotzde commented Dec 9, 2019

No veto on ping, so let's merge this now!

@uklotzde uklotzde merged commit 80ec75a into mixxxdj:master Dec 9, 2019
@daschuer daschuer deleted the lp1839669 branch September 26, 2021 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants