# fl.peaks~ and 1-ary vector crash

**URL:** <https://framelib.discourse.group/t/fl-peaks-and-1-ary-vector-crash/34>\
**Category:** Bugs\
**Created:** [11 September 2019 15:45 UTC](https://framelib.discourse.group/t/fl-peaks-and-1-ary-vector-crash/34 "2019-09-11T15:45:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![o.green](https://yyz2.discourse-cdn.com/free1/user_avatar/framelib.discourse.group/o.green/32/29_2.png) [@o.green](https://framelib.discourse.group/u/o.green)\
**Post date:** [11 September 2019 15:45 UTC](https://framelib.discourse.group/t/fl-peaks-and-1-ary-vector-crash/34/1 "2019-09-11T15:45:36Z")

</div>

### Summary: `fl.peaks~` crashes with 1-ary vectors

### FrameLib Version: d12b329

### Environment Details (Max/SC/Whatever): Max 7, OS 10.12

### Steps to reproduce (Provide patch/code if possible):

```

----------begin_max5_patcher----------
326.3ocuREsSBCCE84tuhl97jP2PP7WwXLkwUr3ncosCGg.e61damh5TIAiO
r6x8zSumbtmtOivVn6.KidK8NJgrOiPPn..I0SXaDcU0BKRiofWzKVyxiG4f
NGB+X8HspBN1efbIB6odUYOlt0UCN2tFHJHiQuOcj0sqFQY8jUsajJOcTUdB
rQ3pdRpV8fApbwgTvKFMNmNmGpWWFpEdj2lreNQciCJ.dHKKTxuXGafURqCL
Go7A7cwk66hev2iQGymf+lM6e03Mf3Y6PYM+68bd56uHyGOE89MywPe9u38x
S7NRgUKUe9UOJS.+iKDqt0T06gTpReWnkf0IUBmTqNgCOxYvU94pS4YnSwWz
IZOQSyVvXSjQI7I6ZsIzNKGakpXaI1Zfsxd9SPDgwu0c9UdqIFRcSmvhWUuD
LpVY5YkW4CYuBnXx7aC
-----------end_max5_patcher-----------

```

### Actual Result:

```auto
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000010e744000
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
...
0 AHarker.fl-peaks- 0x0000000119c467ad FrameLib_Peaks::process() + 237
1 AHarker.fl-once- 0x0000000119ccc958 FrameLib_ProcessingQueue::add(FrameLib_DSP*) + 2776
2 AHarker.fl-once- 0x0000000119ccd20e FrameLib_DSP::blockUpdate(double const* const*, double**, unsigned long) + 350
3 AHarker.fl-once- 0x0000000119cc2c5c FrameLib_Expand<FrameLib_Once>::blockUpdate(double const* const*, double**, unsigned long) + 1116

```

### Expected Result:

An error message? Not a punishment crash, at any rate

### Logs/Other

---

<div class="post-metadata">

**Author:** ![a.harker](https://yyz2.discourse-cdn.com/free1/user_avatar/framelib.discourse.group/a.harker/32/21_2.png) [@a.harker](https://framelib.discourse.group/u/a.harker)\
**Post date:** [16 September 2019 19:58 UTC](https://framelib.discourse.group/t/fl-peaks-and-1-ary-vector-crash/34/2 "2019-09-16T19:58:51Z")

</div>

This is not a punishment crash - it is a coding error.

The problem is that I really like unsigned ints for values that shouldn’t be negative, but I forget that you have to be careful when subtracting them:

```
for (unsigned long i = 2; i < (sizeIn - 2); i++)

```

If I were cleverer I would have noticed that this line is not safe, given that I clearly thought about trying to prevent issues with low length inputs when coding.

Now fixed on master.

---

<div class="post-metadata">

**Author:** ![jessephamel](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jessephamel](https://framelib.discourse.group/u/jessephamel)\
**Post date:** [16 November 2022 08:41 UTC](https://framelib.discourse.group/t/fl-peaks-and-1-ary-vector-crash/34/3 "2022-11-16T08:41:56Z")

</div>

fl.peaks~ is still crashing for me, with OP’s patch as well as the help file. FL v1.0.1, Max 8 64bit, Windows 10.

---

<div class="post-metadata">

**Author:** ![a.harker](https://yyz2.discourse-cdn.com/free1/user_avatar/framelib.discourse.group/a.harker/32/21_2.png) [@a.harker](https://framelib.discourse.group/u/a.harker)\
**Post date:** [16 November 2022 09:11 UTC](https://framelib.discourse.group/t/fl-peaks-and-1-ary-vector-crash/34/4 "2022-11-16T09:11:38Z")

</div>

Thanks Jesse - my current build isn’t crashing and given the helpfile was made with later builds I suspect they didn’t crash either on Mac. The line I quote above doesn’t even exist as far as I can see in the latest code - so I think this is a different issue, rather than the original one recurring.

Can you make an issue on GitHub if you have a moment/are able to? [Issues · AlexHarker/FrameLib · GitHub](https://github.com/AlexHarker/FrameLib/issues)

That will make it easier to track and I’ll find some time to boot up windows and figure out what badness is occurring here (which I suspect will be windows only).
