v icon indicating copy to clipboard operation
v copied to clipboard

stbi: don't use garbage collection for memory management in `stb_image_write.h` for now

Open Wertzui123 opened this issue 2 years ago • 3 comments

(follow-up to #16028)

There is a memory access/corruption bug (that I couldn't fix) when using the GC_ functions for memory management in stb_image_write.

Furthermore, the library should free allocated memory by itself anyway.

Note that this may still allow some leaks, but it's definitely better than corrupted memory and crashes caused by it.

Wertzui123 avatar Feb 03 '23 15:02 Wertzui123

Can you provide a small example?

spytheman avatar Feb 03 '23 21:02 spytheman

@Wertzui123 any chance of adding an example/test for this? Even if it can not be automated easily now, it will still be valuable, since it can then serve as a test for regressions, in case we decide to upgrade stb_image_write.h or if there are changes to the garbage collection in V, or in the Boehm source.

spytheman avatar Feb 08 '23 07:02 spytheman

Sorry for not responding, I was really busy last week. It sounds stupid now, but I'm currently unable to reproduce the issue again; I will convert this PR to a draft until I have added an example/test.

Wertzui123 avatar Feb 08 '23 16:02 Wertzui123

I am closing this for now.

spytheman avatar Mar 06 '23 07:03 spytheman