# Segmentation Fault hunting: SDL\_Rect on heap or stack for SDL\_RenderCopy?

**URL:** <https://discourse.libsdl.org/t/segmentation-fault-hunting-sdl-rect-on-heap-or-stack-for-sdl-rendercopy/50545>\
**Category:** SDL Development\
**Created:** [April 16, 2024, 9:48pm UTC](https://discourse.libsdl.org/t/segmentation-fault-hunting-sdl-rect-on-heap-or-stack-for-sdl-rendercopy/50545 "2024-04-16T21:48:40Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Peter87](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/p/f07891/32.png) [@Peter87](https://discourse.libsdl.org/u/Peter87)\
**Post date:** [April 17, 2024, 10:28am UTC](https://discourse.libsdl.org/t/segmentation-fault-hunting-sdl-rect-on-heap-or-stack-for-sdl-rendercopy/50545/7 "2024-04-17T10:28:50Z")

</div>

> [@kismet](#):
>
> I didn’t know about valgrid (I am going to read about it!)

Valgrind is a great tool, but I don’t think it’s available on Windows. “Sanitizers”, that come with many modern compilers nowadays, provide similar functionality.

> [@kismet](#):
>
> It was a very silly issue!!!

I noticed that a [similar issue](https://discourse.libsdl.org/t/sdl-dialog-allocate-space-for-terminator-when-building-filter-string/50543) got fixed in the SDL codebase just a few hours ago so you are apparently not alone in making this sort of mistake. 😉

---

_[View the full topic](https://discourse.libsdl.org/t/segmentation-fault-hunting-sdl-rect-on-heap-or-stack-for-sdl-rendercopy/50545)._
