Jump to content
Wil van Antwerpen

Catch details on AV

Recommended Posts

Hi,

 

Sometimes users report a problem with my FMX applications.
Usually I am able to help them by asking them to email me the logs that the application creates specifically for troubleshooting purposes.


However if the user reports an access violation it gets pretty hard to find what actually happened as my logs do not have any details on that.
They don't even log the AV at all.

Is there a possibility to log that kind of problem with a bit of detail?

 

edit: FYI, both Windows as well as macOS, delphi 10.3 and 10.4

 

Thanks

Edited by Wil van Antwerpen

Share this post


Link to post

FWIW, the customer that triggered this issue has helped me to nail it down.

I'm very grateful for him to do that kind of detective work.
 

The offending code was:

sValue := ListBox.Selected.TagString;

There was no selection made in the ListBox and as such Selected was nil.

Previously there would always have been a selected value in the ListBox, but due to a change elsewhere that precondition was no longer true.

 

From the customers initial report I was under the assumption that the error was in a different form ....
So any details I would be able to log would help (form name, method, etc...), if only the moment an AV happens can be logged then even that might be helpful as I can then implement a debuglevel to the log to catch more details.
Just looking for ideas. :)

Share this post


Link to post

The magicians at Grijjy made something for iOS and Android.
https://github.com/grijjy/JustAddCode/tree/master/ErrorReporting

Nothing for MacOS or Linux yet.

IMO, basic cross platform stack tracing should come out of the box from EMBT.
MadExcept and EurekaLog could still make a living, dealing with more bells and whistles and with the reporting bit.

  • Like 1

Share this post


Link to post
On 11/26/2020 at 6:24 AM, Lars Fosdal said:

IMO, basic cross platform stack tracing should come out of the box from EMBT.

Agreed.  And believe me, it has been requested many many times, but for whatever reason Embarcadero has continued to decide not to provide it.

 

Share this post


Link to post

That one was new to me - and it looks pretty brand spanking fresh too. 

Ver.0.99.

 

Pricing model is a bit simplistic.

Needs a team license with source code.

Share this post


Link to post

 

1 hour ago, Lars Fosdal said:

Pricing model is a bit simplistic.

Needs a team license with source code.

"Time limited license"... Thanks, but let's not.

 

Also it seems they've opted to keep the map file info separate from the application. I guess that makes sense on mobile due to the size. Not so much on desktop.

Share this post


Link to post
8 hours ago, Anders Melander said:

Also it seems they've opted to keep the map file info separate from the application. I guess that makes sense on mobile due to the size. Not so much on desktop.

There was something called "PE Overlay" that originally was so popular in the stone era where memory was in MB! If someone had to include something(file, picture, ...) with his exe/dll without shipping out the file separately, he used the overlay technique instead of the resource ... because using the resource means that the file gets mapped automatically by the loader to the main memory, while using the Overlay, the file gets mapped to memory under the developer command (say an exception occurred ... now you need to map the map-file from exe which is on disk into the memory and finally produce the log). The idea was that a developer inserts the file at the end of the executable and since PE size doesn't correspond to the actual size, the loader won't map the trailing (file) to memory and file remains on disk. 

Today the Overlay technique is used widely in the malware industry and in the PE signature/certificate to store some metadata (BTW, Delphi uses Overlay for signature/certificate).

I'm wondering if this applies also to mobile (I've a strong feeling that it does).

Share this post


Link to post

Hi,

 

Thanks for all the tips. I will check out the 3rd party products, but am a bit wary of adding 3rd party controls that are working at this low level to already released software. Especially if the component comes without source so I that it becomes more difficult for me to estimate the impact on stability, or if I need to look for another solution once the next version of macOS is released.

If I start working on a new product it makes more sense to me as I will then have more time to test.

 

Looks like the grjji github code might get me the basics I need for now.

 

9 hours ago, Anders Melander said:

 

"Time limited license"... Thanks, but let's not.

The website is very unclear and that does not give me a good feeling about the product itself.

Version history 0.99beta...
There's more text in the screenshots then there is text detailing the functionality about the product, several typo's in there as well.

Time limited how?
After a year the code stops working?
After a year I need to buy a new license if I want to include it into a new application?

Something else?

Does it come with source?
Does it work with FMX? (I only see VCL even on the macOS/Linux screenshots)

Does it work with Delphi 10.3/10.4?

 

I believe that the people behind it are very very smart, but I need more details to even consider it as a solution.


Like you say.. no thanks.

Edited by Wil van Antwerpen
  • Like 1

Share this post


Link to post
48 minutes ago, Mahdi Safsafi said:

I'm wondering if this applies also to mobile (I've a strong feeling that it does).

I don't know but I think in this case it has more to do with limiting the deployment size than with limiting the consumed address space.

  • Like 1

Share this post


Link to post

Poor man's solution:
 

const

  S_M_ExceptInfoPatt       = '%s (%s @ $%x)';


...

Result := Format(S_M_ExceptInfoPatt, [E.Message, E.ClassName, NativeUInt(ExceptAddr)]);

then run your app in IDE with F7 or stop at an breakpoint, Search > Goto address

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×