Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erased components in Delphi program

Tags:

delphi

Updates

2016-02-18: Added process information


I have a Delphi program compiled using XE4. It is being used by a few hundred customers. A couple of weeks ago one of these customers reported that some areas of the executable was being erased (images bellow) randomly during the day. This client has 35 sites using this exe and the problem occurs on no more than 10 of these sites.

Investigation

1 - My first suspicion was an infinite loop. The exe keeps responding while the components are erased, nothing changed on the code so radically from the time this problem did'n happen and the logs don't show any loop (this exe has logs everywhere).

2 - Misbehaving threads. I have a separate thread that syncs data between this exe and our server in the cloud. Again, logs don't show that the thread is running when the problem occur and again, nothing was changed here.

3 - Some other program (antivirus?) is affecting my exe. Couldn't investigate this hipotesis properly yet, but until now couldn't find any installed program that raised my attention.

My question is: What could be causing this issue? How can I investigate further? I know this may be a wide question but this is all information I could gather and I can't imagine many more places to look at.

Images

1 - In the image bellow the red-stroked area should be a TToolBar

erased TToolBar

2 - In this second image there are three areas, from the top to the bottom the first one should be a TToolBar, the second one should be the title of the child form and the third one should be a TwwDBGrid

Menu, title and TwwDBGrid erased

3 - The third example shows on the top the erased area where should be a TEdit, just bellow it there's what should be a line on a TwwDBGrid and on the side we can see an erased scrollbar from the TwwDBGrid

Tedit, line and scroolbar erased

4 - This last example shows 5 erased areas: The title of the application, the main TToolBar, The title of the Form, a TButton and two TwwDBGrid

enter image description here

5 - This is an interesting example beacause beyond the erased components there are 4 TSpeedButtons that are not erased but they are without the images they have originally (the first red stroked areas). The other 3 red stroked areas are, in order, 2 TEdits, a TwwDBGrd and a TButton

enter image description here

Process Information

I got a screenshot by the momment the problem occurs. scgolr is my software.

enter image description here

like image 335
Ricardo Acras Avatar asked Feb 02 '16 11:02

Ricardo Acras


2 Answers

There is really not enough detailed information to give you a definite answer. However, I can answer with some directions on your question:

How can I investigate further?

Because of what you have stated:

  • The program is in use by a few hundred customers
  • One (only) customer experiences the problem
  • First occurance of the problem was some weeks ago

the first thing to do, is get in contact with the customer, and get the information you say that you have asked for but not got. The questions that need to be answered are:

  • What has changed in the customers environment at the time the problem started with respect to hardware, network, server, OS, other software running in the PCs?
  • Has anything changed in the way your customer is using your software?
  • What do the customer have to do to get rid of the problem, once it occurs? Close the program? Restart the PC? Or maybe just minimize - restore the erroneous window?

With the above I do not suggest that the fault is with this one customer and their equipment or their way of using the software. It may just be that the combination at the site which is different from all your other customers, triggers the problem to show up.

Some specific things to check in your software and at the site when problem occurs and if the problem goes away with a minimize - restore of the application (which would suggest a painting interrupted problem:

  • Do you call Application.ProcessMessages at any time?
  • Does the background thread access same data as the GUI? If yes, are the data protection properly in place (locking, synchronisation).
  • Does the background thread access any GUI components without Synchronize?

Finally I suggest that you visit the customer onsite. You get much better and faster answers in a direct discussion.


Edit after process information received.

There is nothing alarming concerning GDI or User objects. But it is alarming when you say in the comments that you call Application.ProcessMessages in many places, obviously to 'fix' a non-responsive UI. For example, what happens if the user double clicks a button, but does it slowly enough that Windows detects it as to separate clicks? First click may start your long lasting procedure within which you call A.P. The second click is read from the message que which starts the same procedure. Now the second call to the procedure runs (with its own calls to A.P.) and eventually ends and execution returns to the first call. Depending on what you do in this procedure, you may well be messing up handles and device contexts etc. A strong recommendation said with a friendly intent: Get rid of those calls to A.P.

like image 171
Tom Brunberg Avatar answered Oct 10 '22 17:10

Tom Brunberg


the problem is with the security plugin (Warsaw - Gas Tecnologia) bank's website that your client is accessing , update it and it will be solved , the problem happens in Brazil

like image 36
Passella Avatar answered Oct 10 '22 18:10

Passella