Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 2458 - Possible crash when clearing text field in Gain dialog
Possible crash when clearing text field in Gain dialog
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: User Interface
2.4.0
Per OS All
: P2 RepeatableAll
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-28 20:54 UTC by Leland Lucius
Modified: 2020-05-29 10:04 UTC (History)
3 users (show)

See Also:
Steps To Reproduce:
1) Add new mono track 2) Double click the track info Gain slider knob 3) When the dialog pops up, press the backspace key
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2020-05-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leland Lucius 2020-05-28 20:54:07 UTC
This was reported here:

https://github.com/audacity/audacity/issues/541

As you can see from that report James and I have had a heck of a time recreating the crash.  I did it once, but could not again.

However, I do know why and Marco provided the clue:

  When the requester named "Gain" come up don't click in the edit gadget but
  leave the "0" high lighted and press the backspace key. Another effect I see
  sometimes is the "-nan" string in the Gain numeric edit request.

With this information, I have been able to recreate the crash, or at least, a similar one.

I'll put an explanation in the source, but it boils down to an uninitialized variable.
Comment 1 Leland Lucius 2020-05-28 21:21:00 UTC
Fix committed in:

https://github.com/audacity/audacity/commit/8ae8e0f

This one will be nearly impossible for QA to test.  We'll have to depend on code review and/or James/Paul/Steve to try simulating it.

Gents, to do that, checkout 8ae8e0f~1 and change line 325 to:

  double value = NAN;

This will cause a crash when you delete the value in the text field because the slider tries to adjust to NAN, which it can't.

This has been a problem since:

  commit 8f09785da985677c241c8b38e947b02a88eb4bbd
  Author: llucius <llucius@47890b92-0858-11df-a26f-8b716316a5bc>
  Date:   Fri Jul 14 03:25:08 2006 +0000

      Corrects handling of values in SliderDialog
Comment 2 Steve Daulton 2020-05-29 04:42:48 UTC
(In reply to Leland Lucius from comment #1)
I'm not able to reproduce the crash prior to the fix even if I set
double value = NAN;
Though I do observe the slider jumping to the left in this case.
I also tried with
double value = std::numeric_limits<double>::infinity();
which makes the slider  jump to the right, but no crash.
These tests were with a Release build.


After the fix, if I set
double value = NAN;
then I observe that the slider behaves better (the slider does not jump).
All looks good.


This looks fixed to me, but it would be good for confidence if someone that can produce the crash could also do a quick test.
Comment 3 James Crook 2020-05-29 10:04:25 UTC
RESOLVED FIXED.
Confirmed fixed by the original reporter.
https://github.com/audacity/audacity/issues/541