Can the OnError lib report procedures?

Everything else that doesn't fall into one of the other PB categories.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Can the OnError lib report procedures?

Post by Dude »

I've been using the OnError lib (with line numbering enabled) to try to track down an illegal memory access error, but the reported lines seem to have nothing to do with the crashing. For example, it would say that a line that calls a procedure was the cause, or a simple "a+1" was the cause, etc. Not really helpful.

So I figure it would help me better if I knew in which actual procedure the crash was occurring, so I could look closer at that procedure. Is there a way to do that with the OnError lib? Thanks.

Also, is there any reason NOT to keep the OnError lib code in my app for public release? It makes the exe a bit larger, but I feel it's probably better for customer service to have a nice crash report instead of just the app dying the usual Windows way. Eve the manual says something about that, but would it slow down my app to keep it in?
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Can the OnError lib report procedures?

Post by Josh »

The reported lines have very well something to do with the crash, so the OnError library can't tell you anything else. However, the cause of the memory error is probably somewhere else in your program code.

So have fun searching, try the Purifier first.
sorry for my bad english
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Can the OnError lib report procedures?

Post by Little John »

Dude wrote:Also, is there any reason NOT to keep the OnError lib code in my app for public release? It makes the exe a bit larger, but I feel it's probably better for customer service to have a nice crash report instead of just the app dying the usual Windows way. Eve the manual says something about that, but would it slow down my app to keep it in?
Actually, the use in the finished EXE program is the main purpose of the OnError library:
[u]Reference Manual[/u] wrote:This library provides a way to track program errors (program crashes) similar to the PureBasic debugger but without the drawbacks of a bigger filesize and lower execution speed when using the debugger. This way the final version of a program which is shipped to the end user can still intercept program errors and provide some information about the error to the user so he can report it back to the developer.
However, privacy concerns were raised about the OnError library:
viewtopic.php?f=3&t=63745
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Can the OnError lib report procedures?

Post by Dude »

Little John wrote:However, privacy concerns were raised about the OnError library
That's no concern to me because I just strip out the path like so:

Code: Select all

SourceFile$=GetFilePart(ErrorFile())
Anyway, next question: I've added "PurifierGranularity(1,1,1,1)" to my source at the recommendation of another post, but I don't know how the Purifier works. Is that command supposed to halt my app somewhere or something? The Help manual is very vague about how to use the Purifier. Can someone please explain like I'm 5? :)
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Can the OnError lib report procedures?

Post by Shardik »

Dude wrote:Anyway, next question: I've added "PurifierGranularity(1,1,1,1)" to my source at the recommendation of another post, but I don't know how the Purifier works.
Have you already read Fred's blog posting about the purifier?
Last edited by Shardik on Sun Jul 14, 2019 9:40 am, edited 1 time in total.
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Can the OnError lib report procedures?

Post by Little John »

Shardik wrote:
Little John wrote:Anyway, next question: I've added "PurifierGranularity(1,1,1,1)" to my source at the recommendation of another post, but I don't know how the Purifier works.
No.
It was NOT ME who wrote that!
Is proper quoting that hard?
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Can the OnError lib report procedures?

Post by Dude »

Shardik wrote:Have you already read Fred's blog posting about the purifier?
No, because I didn't know about it. Thanks for linking it. However, that blog is still pretty vague, too. From what I read in it, I assume the debugger will stop my app when an overflow is found? The blog doesn't specifically say. I'm sitting here running my app with the Purifier on and its granularity set to 1,1,1,1 and nothing has halted yet, so I don't even know if the Purifier is working. There's nothing to indicate that my app is running with the Purifier on. Is this normal until an illegal memory access error occurs?

One more question: it seems the Purifier doesn't work with built exes, but only during IDE development; so it's going to be useless for my beta-testers, right? It's only something I can test with?
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Can the OnError lib report procedures?

Post by Shardik »

Little John wrote:
Shardik wrote:
Little John wrote:Anyway, next question: I've added "PurifierGranularity(1,1,1,1)" to my source at the recommendation of another post, but I don't know how the Purifier works.
No.
It was NOT ME who wrote that!
Is proper quoting that hard?
Sorry about misquoting you. I have changed the author name in my quote above replacing your name by Dude's. But I still think it's a bug in the forum software that your name was put into the quote instead of Dude's, especially because only Dude wrote the cited sentence. Of course it's still my fault for don't catching the wrong author name in the quoted text...
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Can the OnError lib report procedures?

Post by Dude »

Found the cause of the crashing: viewtopic.php?f=13&t=73189 :oops:

At least I learned how the Purifier works, and the OnError lib. So not a total loss of my time. :)
Post Reply