[Solved] an "invisible" bug several years old (DLL related)

Everything else that doesn't fall into one of the other PB categories.
User avatar
Caronte3D
Addict
Addict
Posts: 1355
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

[Solved] an "invisible" bug several years old (DLL related)

Post by Caronte3D »

Years ago I made a dll for a 3rd party application and I have endured an elusive bug for all that time without being able to catch it.

The bug caused the DLL (and the application) to get slower the more days they were running without restarting.

I was checking everything about the memory usage in my dll and was not able to find the bug at all in all these years, which forced me to incorporate a function that would force the application to restart every x days, poor solution, but it's the only way I found to avoid the extreme slowness that was reached with the days.

This Friday I found the culprit behind such a bug, so I'm sharing it here, because it's something that I at least didn't know about and that can drive anyone crazy.

The bug was that I had some global variable outside the function: "ProcedureDLL AttachProcess(Instance)" and ALL global variables must go in that function :shock:

So... remember to put ALL global variables in there :wink:

P.D: The info about that is from this video someone posted here on the forum:
https://youtu.be/JPQWQfDhICA
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

Re: [Solved] an "invisible" bug several years old (DLL related)

Post by Oso »

Caronte3D wrote: Sun Nov 20, 2022 8:01 pm I was checking everything about the memory usage in my dll and was not able to find the bug at all in all these years, which forced me to incorporate a function that would force the application to restart every x days, poor solution, but it's the only way I found to avoid the extreme slowness that was reached with the days. This Friday I found the culprit behind such a bug...
Thanks for posting this, Caronte3D. I can well appreciate your satisfaction on finding that bug. I found a 20-year-old bug in an application recently, so I know the feeling after years of annoyance with it (a variable reused and not initialised :o ).
User avatar
pendle
New User
New User
Posts: 7
Joined: Tue Jun 28, 2022 7:41 pm

Re: [Solved] an "invisible" bug several years old (DLL related)

Post by pendle »

Good info thanks for sharing
Post Reply