muXed
New Member
Posts: 15
|
Post by muXed on Sept 18, 2020 14:17:46 GMT -5
Good evening all,
I've got an issue - regarding the best way to troubleshoot my program.
I have quite a serious bug with it; where it crashes the whole program without any error or log file.
The problem is that my program is 20k lines of code and the bug is for the most part "Random"
The most irritating thing is that the error doesn't occur in liberty itself, only in the executable.
My observations are:- From what I can workout it might be directory based but not 100% I'm successfully running two instances on 2 different computers where no errors happen. However at the time of writing this thread i have I run list views which close frequently along with multiple dll's and api's, Wondering whether these would cause this behaviour?
Any help would be greatly appreciated !
|
|
|
Post by Carl Gundel on Sept 18, 2020 15:17:58 GMT -5
Good evening all, I've got an issue - regarding the best way to troubleshoot my program. I have quite a serious bug with it; where it crashes the whole program without any error or log file. The problem is that my program is 20k lines of code and the bug is for the most part "Random" The most irritating thing is that the error doesn't occur in liberty itself, only in the executable. My observations are:- From what I can workout it might be directory based but not 100% I'm successfully running two instances on 2 different computers where no errors happen. However at the time of writing this thread i have I run list views which close frequently along with multiple dll's and api's, Wondering whether these would cause this behaviour? Any help would be greatly appreciated ! What sort of things do the DLLs and APIs do for you? Can you create a version of the program that eliminates them just for the purpose of debugging?
|
|
|
Post by Brandon Parker on Sept 18, 2020 20:50:28 GMT -5
I would bet it is either a "handle" issue or a memory leak issue. All handles used with API calls should normally us ulong in Liberty BASIC. The memory leak issue is something that you can also encounter with API calls if an API is expecting the user to handle the destruction of memory objects and the user does not handle the memory properly.
Feel free to post snippets where you might suspect the issue to be, or you can PM me if you want. I would be willing to take a look at the program in its entirety if you want to share it.
{:0)
Brandon Parker
|
|
|
Post by Rod on Sept 19, 2020 1:57:02 GMT -5
Yes the most usual cause of a random crash is using type long to type a handle. Ensure every variable that holds a handle is typed as ulong. If you use long then Liberty can misinterpret a handle variable when Windows issues a very large number as a handle. So the program works most of the time but will occasionally fail.
If you have been seeking out API code, be aware that a lot of old code uses type long, that used to work, not anymore so old code needs tweaked to use ulong.
The other reason that a .exe would fail is if you had two [branch] labels one under the other with no code in etween. But that may have been fixed. What version of Liberty are you using?
|
|
muXed
New Member
Posts: 15
|
Post by muXed on Sept 19, 2020 14:42:43 GMT -5
I would be it is either a "handle" issue or a memory leak issue. All handles used with API calls should normally us ulong in Liberty BASIC. The memory leak issue is something that you can also encounter with API calls if an API is expecting the user to handle the destruction of memory objects and the user does not handle the memory properly. Feel free to post snippets where you might suspect the issue to be, or you can PM me if you want. I would be willing to take a look at the program in its entirety if you want to share it. {:0) Brandon Parker Hi Brandon, I've Pm'd you the full exe and code. Any input would be greatly appreciated Carl; the dll's that i use are WMLiberty.dll msghook.dll DatePUP32.dll /// i can rule this out as the bug was experienced previously Unfortunately i cannot really eliminate these dlls from my code as they are heavily relied on throughout the program Rod; I'll take a look; does sound like a strong possibility that it is the cause of my bug Thanks guys, I appreciate all the help!
|
|