Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004912 [JEDI VCL] 00 JVCL Components crash sometimes 2009-09-01 09:15 2009-09-24 16:47
Reporter geby View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0004912: bad handling of WM_WINDOWPOSCHANGED on runtime designer surface
Description I am using Delphi 7 pro. Problem have some mysterious symptoms:

- When I try to move component on the surface at Vista and Win7, component is not repainted properly in some cases. Especially when I try to move TPageControl with some TTabSheets.

- Designer sometimes crashed when I changing properties (like TabStops in PageControl), or sometimes when I click some control at surface. When I load a design from file and some components have Visible:=false, then click the designer crash too. It crashing with exception EOSError: "A call to an OS function failed"
Additional Information I found a problem with handling of WM_WINDOWPOSCHANGED in TJvDesignSurface.IsDesignMessage.

For some unknown reason handling of this message causing sending of this message again. But it cause endless message loop in some cases!

I try to do a dirty hack - I remove the line:
SendMessage(Control.Handle, AMsg.Msg, AMsg.wParam, AMsg.lParam);

And wow! All seems to be OK now! Component repaint is OK, no crashes too...
Tags No tags attached.
Attached Files zip file icon jvclbug2.zip [^] (623,584 bytes) 2009-09-10 13:10
zip file icon vclbug2video.zip [^] (229,748 bytes) 2009-09-23 11:00

- Relationships

-  Notes
(0016068)
obones (administrator)
2009-09-09 19:37

Hello,

We would really like to have the zipped sources of a sample application showing this.
(0016085)
geby (reporter)
2009-09-10 13:19

I attached the sample aplication.

Steps for reproduce:

1) Run the application and load test2.gfm. Try to click the Label with caption "Enter your keyword...". Crash...

2) Or run the application. Swicth to "Additional" tab on the component pallete and place TPageControl into designer. Right-click on the PageControl and create two new pages by popup menu. Then go to ObjectInspector and find property "TabStop" and change his value.

3) you maybe find many other ways, application is unstable, until I remove SednMessage, as I said before.

Crashes are different on various systems. On WinXP, Vista or Win7 - each one crashing differently. However I test way 1 and 2 on the WinXP and Vista now, and this sample application crashing on both systems here.

Thanks.
(0016141)
obones (administrator)
2009-09-22 16:40

I'm sorry, but I'm not seeing this at all.
Could it be that you are using themes?
(0016148)
geby (reporter)
2009-09-22 18:40

Did you try compiled sample inside my ZIP? I see the problem on my home WinXP (classis view), work WinXP (classic too...), on my Notebook with Vista (Vista aero), and users reporting problem on Windows 7 too.
(0016155)
obones (administrator)
2009-09-23 08:40

Yes, I did use the sample inside your zip and I did not see the problem at all.
(0016161)
geby (reporter)
2009-09-23 11:04

It is mysterious, because I really not found computer without crash. :-O

I attach small AVI video, where you can see this my crash. Once I clicked the label, application crash inside kernel. This is my on my WinXP computer.
(0016175)
Cyrus (reporter)
2009-09-23 20:23

SVN Revision : 12520.

Delphi 7 Personal (Build 8.1).

Windows 2000 SP4.

--

I can confirm this bug.

If you compile and run JvDesigner-example at folder "examples\JvDesigner" inside IDE and add button to JvDesignPanel area and then try to move it around, it will give EStackOverflow exception dialog.

Execution of program stops inside JvDesignSurface.pas (revision 12515) at line 895. If I try to continue execution, I will get another execption but this time it is "access violation at 0x77e413ba: write of address 0x00030c64" and I need to reset program.

Running JvDesigner-example outside of IDE does not give any error messages. Program just suddenly disappears.

If I comment out "SendMessage(Control.Handle, AMsg.Msg, AMsg.wParam, AMsg.lParam);" at line 892 inside JvDesignSurface.pas and recompile JvDesigner-example and run it, there is no exceptions any more.
(0016181)
obones (administrator)
2009-09-24 10:12

Then this must be related to Delphi7 because I don't see it with any version including and above BDS2006.
(0016182)
geby (reporter)
2009-09-24 10:25

Of course. Code is:

  {$IFDEF DELPHI10_UP}
  Control.UpdateBounds;
  {$ELSE}
  SendMessage(Control.Handle, AMsg.Msg, AMsg.wParam, AMsg.lParam);
  {$ENDIF DELPHI10_UP}

And problem is with SendMessage, as I reported on the begin. So, Delphi versions with UpdateBounds method have not a problem.
(0016185)
obones (administrator)
2009-09-24 12:20

oh, my bad, I did not notice that IFDEF...
I'll investigate
(0016186)
obones (administrator)
2009-09-24 12:26

Thing is, there is a need to emulate UpdateBounds because of issue 4693 as indicated in the source code.
So I'm wondering what would be the equivalent to UpdateBounds and because I don't have Delphi 7 at hand I cannot test right now. Could you try to replace the SendMessage call with this call:

Control.Dispatch(Msg);

If that works, then please let me know.
Regards
Olivier
(0016188)
geby (reporter)
2009-09-24 15:58

You mean AMsg instead of just Msg, I think.

Control.Dispatch(AMsg);

I made a quick test and no crashes here now.

Thank you!
(0016189)
obones (administrator)
2009-09-24 16:47

Yes, it was AMsg. Thanks for the confirmation, the fix is now in SVN

- Issue History
Date Modified Username Field Change
2009-09-01 09:15 geby New Issue
2009-09-09 19:37 obones Note Added: 0016068
2009-09-09 19:37 obones Status new => feedback
2009-09-10 13:10 geby File Added: jvclbug2.zip
2009-09-10 13:19 geby Note Added: 0016085
2009-09-22 16:40 obones Note Added: 0016141
2009-09-22 18:40 geby Note Added: 0016148
2009-09-23 08:40 obones Note Added: 0016155
2009-09-23 11:00 geby File Added: vclbug2video.zip
2009-09-23 11:04 geby Note Added: 0016161
2009-09-23 20:23 Cyrus Note Added: 0016175
2009-09-24 10:12 obones Note Added: 0016181
2009-09-24 10:25 geby Note Added: 0016182
2009-09-24 12:20 obones Note Added: 0016185
2009-09-24 12:26 obones Note Added: 0016186
2009-09-24 15:58 geby Note Added: 0016188
2009-09-24 16:47 obones Note Added: 0016189
2009-09-24 16:47 obones Status feedback => resolved
2009-09-24 16:47 obones Fixed in Version => Daily / SVN
2009-09-24 16:47 obones Resolution open => fixed
2009-09-24 16:47 obones Assigned To => obones


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker