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

Audacity Bugzilla



Bug 497 - Audacity crashes if Nyquist returns an array of one sound
Audacity crashes if Nyquist returns an array of one sound
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Nyquist
2.0.0
Per OS All
: P4 Repeatable
Assigned To: Default Assignee for New Bugs
: nyquist, patch, patch_ready
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-28 12:48 UTC by Steve Daulton
Modified: 2018-08-20 11:51 UTC (History)
7 users (show)

See Also:
Steps To Reproduce:
Apply this code in the Nyquist Prompt effect to a selection: (vector (osc 60))
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00


Attachments
throws error on single audio channel in vector (1.07 KB, patch)
2012-04-29 08:24 UTC, Steve Daulton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Daulton 2012-04-28 12:48:10 UTC
If Nyquist returns an array with one element that is a sound, Audacity crashes (segmentation fault).

Example:
The one line code below creates an array (vector) containing a sine wave at MIDI pitch 60 (osc 60):

(vector (osc 60))

Only tested on Linux but probably applies to all platforms.
Comment 1 Gale Andrews 2012-04-29 05:17:38 UTC
Yes, crashes Win and Mac too.
Comment 2 Steve Daulton 2012-04-29 08:24:13 UTC
Created attachment 252 [details]
throws error on single audio channel in vector
Comment 3 Steve Daulton 2012-04-29 08:35:07 UTC
Patch only tested on Linux but I think it should be OK for other platforms.
Comment 4 Gale Andrews 2012-04-29 15:14:26 UTC
Confirmed on Win 7 I get the message box instead of crash when running (vector (osc 60)) from the OK or Debug buttons.

Though it should probably be "wxCENTER" per US English policy.
Comment 5 Steve Daulton 2012-04-29 19:42:34 UTC
(In reply to comment #4)
> Though it should probably be "wxCENTER" per US English policy.

In the wxWidgets documentation it is "wcxCENTRE" though I see that both this and "wxCENTER" are used throughout the Audacity code.
http://docs.wxwidgets.org/trunk/classwx_multi_choice_dialog.html

As for which is correct I'm not qualified to say, but if in doubt it seems safest to go with the documentation.
Comment 6 Vaughan Johnson 2012-04-30 15:46:59 UTC
(In reply to comment #5)

>> Though it should probably be "wxCENTER" per US English policy.
> 
> In the wxWidgets documentation it is "wcxCENTRE" though I see that both this
> and "wxCENTER" are used throughout the Audacity code.
> http://docs.wxwidgets.org/trunk/classwx_multi_choice_dialog.html
> 
> As for which is correct I'm not qualified to say, but if in doubt it seems
> safest to go with the documentation.
> 

They are functionally identical, so neither is safer. 

It's important to be consistently US English only in stuff we present to users, i.e., GUI, website, manual, etc. 

The source code itself has been mixed for a long time, depending on who wrote it.
Comment 7 Steve Daulton 2012-06-06 14:56:14 UTC
(In reply to comment #6)
The patch has been ready for 5 weeks.
Any problems with it?
Comment 8 Steve Daulton 2012-06-06 15:21:29 UTC
The current patch reports:

$ patch -p 0 < bug497.patch
patching file src/effects/nyquist/Nyquist.cpp
Hunk #1 succeeded at 917 (offset 77 lines).
patching file lib-src/libnyquist/nyx.c
Hunk #1 succeeded at 881 (offset 6 lines).

It still works on Linux but if it fails on other platforms the patch may need to be applied manually to work around the line offsets.
Comment 9 Richard Ash 2012-06-16 12:49:47 UTC
Committed with some cleanup to the error message in revision 11786.
Comment 10 Gale Andrews 2012-06-17 05:18:10 UTC
RESOLVED - FIXED. Error message occurs on all three platforms.