# What is this error

**URL:** <https://forum.crystal-lang.org/t/what-is-this-error/6818>\
**Category:** Help & Support\
**Created:** [May 5, 2024, 6:16pm UTC](https://forum.crystal-lang.org/t/what-is-this-error/6818 "2024-05-05T18:16:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aiac](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@aiac](https://forum.crystal-lang.org/u/aiac)\
**Post date:** [May 5, 2024, 6:16pm UTC](https://forum.crystal-lang.org/t/what-is-this-error/6818/1 "2024-05-05T18:16:34Z")

</div>

only happend when start `--release` app

```auto
Unhandled exception: Negative count (ArgumentError)
  from src\minimp3.cr:679 in '__crystal_main'
  from E:\scoop\global\apps\crystal\current\src\crystal\main.cr:141 in 'main'
  from E:\scoop\global\apps\crystal\current\src\crystal\system\win32\wmain.cr:37 in 'wmain'
  from D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 in '__scrt_common_main_seh'
  from C:\WINDOWS\System32\KERNEL32.DLL +75133 in 'BaseThreadInitThunk'
  from C:\WINDOWS\SYSTEM32\ntdll.dll +371272 in 'RtlUserThreadStart'

```

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [May 5, 2024, 6:25pm UTC](https://forum.crystal-lang.org/t/what-is-this-error/6818/2 "2024-05-05T18:25:37Z")

</div>

Uh, can you share the code that reproduces this? Otherwise it’s kind of hard to say.

EDIT: Or at least what’s at `src\minimp3.cr:679`.

---

<div class="post-metadata">

**Author:** ![aiac](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@aiac](https://forum.crystal-lang.org/u/aiac)\
**Post date:** [May 5, 2024, 6:34pm UTC](https://forum.crystal-lang.org/t/what-is-this-error/6818/3 "2024-05-05T18:34:16Z")

</div>

![Screenshot 2024-05-06 023402](https://canada1.discourse-cdn.com/flex036/uploads/crystal_lang/original/2X/7/777c16ae663104448d47bc9d216dd81f4c478643.png)

 ![Screenshot 2024-05-06 023558](https://canada1.discourse-cdn.com/flex036/uploads/crystal_lang/original/2X/f/f6317fd67d9c6ec5e3065fe9300682db44dc0792.png)

---

<div class="post-metadata">

**Author:** ![aiac](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@aiac](https://forum.crystal-lang.org/u/aiac)\
**Post date:** [May 5, 2024, 7:00pm UTC](https://forum.crystal-lang.org/t/what-is-this-error/6818/4 "2024-05-05T19:00:22Z")

</div>

🤔🤔🤔

# do not work when comment `p! sample_bytes`

 ![Screenshot 2024-05-06 025611](https://canada1.discourse-cdn.com/flex036/uploads/crystal_lang/original/2X/4/43efe64666fcadff5efb8f618a14d3bf20fb2a87.png)

# works well when uncomment `p! sample_bytes`

 ![Screenshot 2024-05-06 025716](https://canada1.discourse-cdn.com/flex036/uploads/crystal_lang/original/2X/5/5fd91174b281e8ad329ff4af45d42417ee835bd8.png)

---

<div class="post-metadata">

**Author:** ![aiac](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@aiac](https://forum.crystal-lang.org/u/aiac)\
**Post date:** [May 6, 2024, 12:17pm UTC](https://forum.crystal-lang.org/t/what-is-this-error/6818/6 "2024-05-06T12:17:48Z")

</div>

UPDATE:

- from:

`dec = uninitialized LibMinimp3::Mp3decT `

- to:

`p_dec = Pointer(LibMinimp3::Mp3decT).malloc(1)`

---

<div class="post-metadata">

**Author:** ![beta-ziliani](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/beta-ziliani/32/1821_2.png) [@beta-ziliani](https://forum.crystal-lang.org/u/beta-ziliani)\
**Post date:** [May 7, 2024, 8:01pm UTC](https://forum.crystal-lang.org/t/what-is-this-error/6818/7 "2024-05-07T20:01:51Z")

</div>

From what I understand, your problem only shows with `--release`, is that right? Because if so, then this sounds like a bug in the compiler (but maybe it’s a bug that only shows in `--release`?). Can you get a minimum working example if you think this is not a bug from the application?
