Page 2 of 2
Re: After adding some new global variables ...
Posted: Sat Aug 22, 2020 10:57 pm
by Saki
Hi, yes, after 10 minutes or an hour working with the program a crash.
Then no one for a few days.
New PB versions, test, fine, go, then two days, crash !
It was a string between several numerical procedure parameters.
All the work, everything for the trash can, if you don't find it.
But find this, almost impossible.
A similar bug, but one that kept appearing and could be located, put me on the trail.
I had to cut 20,000 lines down to almost zero, more as one time.
Officially this bug does not exist, it cannot be reproduced with mini codes.
Therefore, it usually only occurs when the codes become very large, then it becomes narrow and overwriting becomes easier to find a target.
Re: After adding some new global variables ...
Posted: Sun Aug 23, 2020 12:11 am
by Mistrel
Some bugs are exceptionally difficult to reproduce. I'm sure many of us have experienced this at some point.
Anyways, the debugger isn't suppose to crash at random. I'm sure there is a bug. But Fred can't fix it unless hr can reproduce it. You get to decide if you want to continue with the debugger off or put the time into submitting code that will crash for us in the same way.
You can try asking Fed or Phreak in a private message if you can send them code privately if you need to.
Re: Nach dem Hinzufügen einiger neuer globaler Variablen ...
Posted: Sun Aug 23, 2020 8:23 am
by marc_256
Saki wrote:
Have you ever thought about turning on the Purifier ?
In your case it will probably not help, but you always have to try it.
So I did some tests with and without the Purifier.
Always the same problem.
This message is not the first time I have with (very) large files ...
viewtopic.php?f=28&t=74132
This is not a problem of the last versions of PB.
I did cut more than the part of my program to become before the message,
and still have the crash message in the IDE.
Strange,

will continue to cut parts of my large program and see ...
marc
Re: After adding some new global variables ...
Posted: Sun Aug 23, 2020 9:02 am
by Saki
Hi,
that approaches the problem I described.
Start with procedures that have strings in their parameters.
Temporarily, they can usually be easily removed for testing purposes.
Convert val() or anything else that works with strings before you pass it to a procedure, or within the procedure.
I wouldn't be surprised if you find the error then.
I myself almost never work with screen, almost always only with canvas,
so I can't tell if anything else is happening in that direction.
But it is always the best approach to start with the strings in the procedure parameters when looking for the error.
If you can confirm the string bug, that would be a blessing,
as he strikes most foul and treacherously.
@Mistrel
The bug itself is exactly described.
It's probably the primary method itself how the string is passed and it's always the same.
If there is a buffer overflow, it is localizable, no matter if a test code causes a crash or not.
Best Regards Saki
Re: After adding some new global variables ...
Posted: Sun Aug 23, 2020 1:43 pm
by marc_256
You are never gone believe this ...
I removed one by one parts of my program,
till the moment I could compile the program with the debugger enabled.
After that point I added one by one the removed parts to find the exact place the compiler crash appears ...
So,

after added all the part ALL WORKS WELL even with the debugger enabled ?????
I can't finger point the problem at all !!!
And I even added some new stuff like this :

Re: Nach dem Hinzufügen einiger neuer Variablen globaler ...
Posted: Sun Aug 23, 2020 3:25 pm
by Saki
Yes,
it always depends on how the memory is used.
Using the example of strings, things happen when the termination of the string, that is, the two zeros are overwritten.
Then the system tries to read the "string" until two zeros are found.
If the string overwrites a variable or data, these can quickly assume an invalid value.
This get the crash.
You do very nice things on the screen.
Best Regards Saki
Re: After adding some new global variables ...
Posted: Sun Aug 23, 2020 7:37 pm
by marc_256
Hi Saki,
I LOVE PureBasic, the reasons see pictures below.
But there are moments I have a love/hate relation with PB...
Well today is (again) one of them,
I added:
1x Declare MyContainer()
20 Globals (word and long)
1x Structure MyStructure
1x Global Dim MyContainer.MyStructure
1x Procedure MyContainer()
Nothing want to start again.
And again the CRASH message
And if I disable the debugger, PB compiles the program and stops (quit) PB.
Without any error message at all !!!
I think you are right about the memory management of variables and strings...
thanks for the info,
marc

Re: After adding some new global variables ...
Posted: Mon Aug 24, 2020 1:54 pm
by Saki
Very nice work Marc !
Re: After adding some new global variables ...
Posted: Mon Aug 24, 2020 2:16 pm
by skywalk
marc_256 wrote:I LOVE PureBasic, the reasons see pictures below.
But there are moments I have a love/hate relation with PB...
Well today is (again) one of them,
I added:
1x Declare MyContainer()
20 Globals (word and long)
1x Structure MyStructure
1x Global Dim MyContainer.MyStructure
1x Procedure MyContainer()
Nothing want to start again.
And again the CRASH message
And if I disable the debugger, PB compiles the program and stops (quit) PB.
Without any error message at all !!!
You never answered if you are attempting your app entirely with source code?
Did you parse out lib functions to dll's?
I also remember a hard to track bug when I exceeded the allotted memory for a procedure.
I solved that with a global memory structure instead of defining it within the procedure.
Re: After adding some new global variables ...
Posted: Mon Sep 14, 2020 9:42 am
by Fred
If you can reproduce it everytime, please send me a PM with your project so I can try to replicate here.