MATLAB: Do I receive a segmentation violation when I specify a negative length when using the FFT function in MATLAB 6.5 (R13)

_mffftfcncrashfftifftlengthlibmwfftw.dllMATLABmffftfcnnegativesegmentationsegvviolation

The code
fft(1:10,-1)
produces the following segmentation violation in MATLAB 6.0 (R12):
Warning: FFT length must be a non-negative integer scalar.
------------------------------------------------------------------------
Segmentation violation detected at Thu May 19 12:47:01 2005
------------------------------------------------------------------------
Configuration:
MATLAB Version: 6.0.0.88 (R12)
Operating System: Microsoft Windows 2000
Window System: Version 5.1 (Build 2600: Service Pack 2)
Processor ID: x86 Family 15 Model 2 Stepping 9, GenuineIntel
Virtual Machine: Java 1.1.8 from Sun Microsystems Inc.
Register State:
EAX = 00000000 EBX = 00000001
ECX = 1dda3e10 EDX = 1dfd7df0
ESI = 00000000 EDI = ffffffff
EBP = 014bd040 ESP = 014bcfbc
EIP = 019cffb4 FLG = 00010286
Stack Trace:
[0] libmwfftw.dll:019cffb4(0x02236250, 1, 0x01000000, 0xffffffff)
[1] numerics.dll:_mfFFTFcn(0x02236ba8, 0x014bd0d0, 0xffffffff, 0x014bd298) + 856 bytes
[2] numerics.dll:_mfFullFFTFcn(0, 0x014bd0d0, 2, 0x014bd298) + 26 bytes
[3] m_interpreter.dll:_inExecuteInternalFcn(150, 2, 0, 0) + 1144 bytes
[4] m_interpreter.dll:_inInterPcode(2, 0x014bdd64, 0, 2) + 2206 bytes
[5] m_interpreter.dll:_in_local_call_eval_function(0, 3309080, 0x014bdd64, 0x014bddf0) + 204 bytes
[6] m_interpreter.dll:_inEvalStringWithIsVarFcn(0x1de679d8 "fft(1,-1)\n", 10, 0, 0) + 355 bytes
[7] m_interpreter.dll:_inEvalString(0x1de679d8 "fft(1,-1)\n", 10, 0, 0) + 50 bytes
[8] m_interpreter.dll:_inParser(0x80000001, 271326, 0, 39) + 1224 bytes
[9] matlab.exe:_WinMain@16(0x00400000 "MZ", 0, 271326, 1) + 3039 bytes
[10] matlab.exe:_WinMainCRTStartup(0x80000001, 0x00f6e0c4, 0x7ffd6000, 0x8054a938) + 308 bytes
[11] kernel32.dll:7c816d4f(0x004610f2, 0, 0x00905a4d, 3)
<snip>

Best Answer

This issue has been fixed in MATLAB 7.0 (R14). If you are using a previous version, read the following:
We have verified that there is a bug in MATLAB 6.5 (R13) that affects the way the FFT function handles length arguments of negative value. To work around this issue, specify a positive length.