Wil van Antwerpen 25 Posted November 26, 2020 (edited) 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 November 26, 2020 by Wil van Antwerpen Share this post Link to post
Wil van Antwerpen 25 Posted November 26, 2020 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
Anders Melander 1783 Posted November 26, 2020 On Windows you can use an exception logger such as MadExcept or Eurekalog. I don't know of any solutions for maxOS. 1 Share this post Link to post
Lars Fosdal 1792 Posted November 26, 2020 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. 1 Share this post Link to post
Remy Lebeau 1396 Posted November 28, 2020 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
Lars Fosdal 1792 Posted November 30, 2020 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
Anders Melander 1783 Posted November 30, 2020 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
Mahdi Safsafi 225 Posted November 30, 2020 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
Wil van Antwerpen 25 Posted November 30, 2020 (edited) 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 November 30, 2020 by Wil van Antwerpen 1 Share this post Link to post
Anders Melander 1783 Posted November 30, 2020 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. 1 Share this post Link to post
Doug Rudd 2 Posted December 15, 2020 SmartCrashLog is by Eugene Kryukov, the inventor of FireMonkey. Share this post Link to post
Fr0sT.Brutal 900 Posted December 17, 2020 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