# Defining long variable names crashing Cabbage

**URL:** <https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393>\
**Category:** Cabbage slugs\
**Created:** [22 March 2021 13:11 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393 "2021-03-22T13:11:56Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![PatrickB](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/patrickb/32/2830_2.png) [@PatrickB](https://forum.cabbageaudio.com/u/PatrickB)\
**Post date:** [22 March 2021 13:11 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/1 "2021-03-22T13:11:57Z")

</div>

When you define a variable longer than 23 characters it will crash Cabbage.

This problem started from version 2.5.23.

If you load a file with a long variable name you crash Cabbage when scrolling through it and you will be unable to edit the file as I found out the hard way. The only way to recover is using an external editor.

The program itself is not affected though and will run just fine

Happy hunting. 😁

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [22 March 2021 13:57 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/2 "2021-03-22T13:57:44Z")

</div>

I guess it’s a parser issue again. I don’t think it will take me as soon to hunt this one down as it did the comment issue! 😆

---

<div class="post-metadata">

**Author:** ![PatrickB](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/patrickb/32/2830_2.png) [@PatrickB](https://forum.cabbageaudio.com/u/PatrickB)\
**Post date:** [22 March 2021 14:26 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/3 "2021-03-22T14:26:19Z")

</div>

Had a feeling this would not be a quick one. 😁

Anyway, it’s easy to avoid once you know it. Just have to restrain myself using those long descriptive variable names. 😂

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [23 March 2021 12:06 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/4 "2021-03-23T12:06:48Z")

</div>

I’ve changed this to 32, if you need longer let me know. There is a slight cost to this as the parser is constantly checking text to see if it should highlight things.

---

<div class="post-metadata">

**Author:** ![PatrickB](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/patrickb/32/2830_2.png) [@PatrickB](https://forum.cabbageaudio.com/u/PatrickB)\
**Post date:** [23 March 2021 12:17 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/5 "2021-03-23T12:17:05Z")

</div>

Hi Rory,

the largest variable name I defined was 24 characters long, hence the crash I experienced.

I think the most important thing is that Cabbages doesn’t crash when the character limit is (accidentally) reached.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [23 March 2021 12:19 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/6 "2021-03-23T12:19:43Z")

</div>

Agreed.

[edit] fixed

---

<div class="post-metadata">

**Author:** ![PatrickB](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/patrickb/32/2830_2.png) [@PatrickB](https://forum.cabbageaudio.com/u/PatrickB)\
**Post date:** [24 March 2021 20:44 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/7 "2021-03-24T20:44:39Z")

</div>

Rory,

note that Cabbage still crashes when exceeding the limit of 31 characters.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [25 March 2021 10:56 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/8 "2021-03-25T10:56:56Z")

</div>

Seems to be fine for me here? Are you sure you are using the latest beta package?

![2021-03-25 10.56.01](https://forum.cabbageaudio.com/uploads/default/original/2X/8/867f6351815b853896ace97af46ee5ccd45d7d80.gif)

---

<div class="post-metadata">

**Author:** ![PatrickB](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/patrickb/32/2830_2.png) [@PatrickB](https://forum.cabbageaudio.com/u/PatrickB)\
**Post date:** [25 March 2021 11:22 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/9 "2021-03-25T11:22:55Z")

</div>

Yes, 24.5 but also tried with the latest 24.6 and same thing here.

I’m on Windows 10 64-bit.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [25 March 2021 11:27 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/10 "2021-03-25T11:27:10Z")

</div>

Would you expect to see a crash based on what I’m doing that gif, or have you concocted another more sinister way of doing it 😏

---

<div class="post-metadata">

**Author:** ![PatrickB](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/patrickb/32/2830_2.png) [@PatrickB](https://forum.cabbageaudio.com/u/PatrickB)\
**Post date:** [25 March 2021 13:22 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/11 "2021-03-25T13:22:15Z")

</div>

Rory,  
haha, sinister, yes of course.

I think this bug is still going to give you some headaches. 😂  
I still can remember me debugging a parser that refused to understand reasonable language. 😧

In testing a bug of this type I usually take the way of the least resistance: put my finger on a key and let the repeat magic happen. You should try it. Really mind bending. 😁

However, paradoxically, if I type in what you typed nothing happens, Cabbage stays happy until…  
I backspace back to the beginning → boom. 😂

I’m sure you can come up with a number of combinations that work and don’t work.  
Is it important? For the moment I don’t think so unless you have a key stuck on your keyboard. 😉

But it still is a bug.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [25 March 2021 14:36 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/12 "2021-03-25T14:36:51Z")

</div>

I just can’t recreate this. Are you on Windows or MacOS?

---

<div class="post-metadata">

**Author:** ![PatrickB](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/patrickb/32/2830_2.png) [@PatrickB](https://forum.cabbageaudio.com/u/PatrickB)\
**Post date:** [25 March 2021 14:43 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/13 "2021-03-25T14:43:19Z")

</div>

Windows 10 64-bit

I can look if this works in Linux or macOS if you want. Just need some time for this.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [25 March 2021 14:47 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/14 "2021-03-25T14:47:02Z")

</div>

I just tried on MacOS and didn’t hit any issues. I will try on Windows and see if I can recreate the issue there.

---

<div class="post-metadata">

**Author:** ![PatrickB](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/patrickb/32/2830_2.png) [@PatrickB](https://forum.cabbageaudio.com/u/PatrickB)\
**Post date:** [7 April 2021 14:47 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/15 "2021-04-07T14:47:14Z")

</div>

Seems to be solved in latest v2.5.30. 👍

---

<div class="post-metadata">

**Author:** ![djalexx1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/djalexx1/32/3233_2.png) [@djalexx1](https://forum.cabbageaudio.com/u/djalexx1)\
**Post date:** [21 April 2021 15:33 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/16 "2021-04-21T15:33:53Z")

</div>

i found that sometimes when you are moving some buttons it does a duplicate script on that line and it get long , so i re- open de .csd file and go straight to the script and erase the duplicate script and start editing again with no problems, keep checking the scroll bar as soon i see its getting shorter i go and erase duplicates, that does it for me.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [21 April 2021 15:37 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/17 "2021-04-21T15:37:55Z")

</div>

This is related to another issue. In fact, I have been working on it for the past few days also. It seems to be happen when you use the GUI editor, and try inserting some images. I’ve pushed through a fix for this just now. Let me know if it helps.

---

<div class="post-metadata">

**Author:** ![djalexx1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/djalexx1/32/3233_2.png) [@djalexx1](https://forum.cabbageaudio.com/u/djalexx1)\
**Post date:** [21 April 2021 15:48 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/18 "2021-04-21T15:48:06Z")

</div>

yes, when i add images its when it happened to me, question, when you do this bug fixes, i have to go and download the latest version of cabbage?, its there where the fix is?, thanx.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [21 April 2021 15:53 UTC](https://forum.cabbageaudio.com/t/defining-long-variable-names-crashing-cabbage/2393/19 "2021-04-21T15:53:55Z")

</div>

The latest versions are built daily. You can grab the installers from [here](https://dev.azure.com/rorywalsh/Cabbage/_build?view=runs). Just click on the latest run, wait for it to finish building, and then select the artefacts published link. That will bring up a drop link, click on that and grab the installers 👍

Some times there are several build on the go at the same time. You can usually see from the commit tag what was the latest change to be pushed.
