# Errors

> LSL run-time errors such as the Math Error and the Stack-Heap Collision.

:::caution[Stub]
This documentation page is a stub and is currently under development.
:::

From the wiki's errors page: "There are only a few ways to crash a script in LSL. The most popular is integer divide-by-zero but there are also functions which will cause the script to crash."

| Message | Cause (wiki wording) |
| --- | --- |
| Math Error | Math error, divide by zero, imaginary result, etc. |
| Stack-Heap Collision | The script ran out of memory. Use less memory or split your memory usage across multiple scripts. |
| Too Many Listens | The script tried to have more than 65 listens open at the same time. Considering using llListenRemove. |
| Lists may not contain lists | For whatever reason the following will compile, but it will crash at runtime `[(list)1]` |
| Hit Sandbox Limit | Setting STATUS_SANDBOX and then the objects moves beyond 10m |

Functions the wiki lists as able to crash a script: [`llListen`](/functions/llListen/) (Too Many Listens), [`llPow`](/functions/llPow/) and [`llSqrt`](/functions/llSqrt/) (Math Error, "Triggered for imaginary results"). The [modulus operator](/fundamentals/operators/) also causes a Math Error "when its second operand equals zero".

## Reference

- [Operators](/fundamentals/operators/), [Script memory](/fundamentals/memory/)
- [`llListen`](/functions/llListen/), [`llListenRemove`](/functions/llListenRemove/), [`llPow`](/functions/llPow/), [`llSqrt`](/functions/llSqrt/)
- [`STATUS_SANDBOX`](/constants/STATUS_SANDBOX/)

*Quotations are from the Second Life Wiki pages [Category:LSL Error](https://wiki.secondlife.com/wiki/Category:LSL_Error), [LSL Operators](https://wiki.secondlife.com/wiki/LSL_Operators), by Second Life Wiki contributors, under [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/).*

---

From lsl.dev: https://lsl.dev/fundamentals/errors/
