GC issue? List.pool overwritten by allocated object
Steven Schveighoffer
schveiguy at gmail.com
Mon May 19 00:59:36 UTC 2025
On Sunday, 18 May 2025 at 19:10:18 UTC, Denis Feklushkin wrote:
> On Monday, 12 May 2025 at 21:29:10 UTC, Steven Schveighoffer
> wrote:
>
>>> Yes, of course I understand perfectly well. And it seems to
>>> me that I am not doing anything "reprehensible".
>>
>> The "reprehensible" thing that almost always causes GC issues
>> is use after free because you are interacting with C memory.
>
> I just added `GC.collect()` before lines what caused SIGSERV
> and all was fixed. Is that what you meant?
No, I mean that almost always a GC problem is caused by using
memory that the GC cannot see.
So things are collected before they are unreferenced.
However, GC.disable at the start should fix it, and you've said
that doesn't. So that sounds more like a straight buffer overflow
or other issue.
> If so, I don't understand the nature of this error
>
> I feel uncomfortable about all this: if it fixes problem - then
> why? If it doesn't, then there must be a bug somewhere that is
> causing and collect() jsut masks it
I would guess it is the latter.
-Steve
More information about the Digitalmars-d
mailing list