Tagged: exception
- This topic has 9 replies, 2 voices, and was last updated 4 years, 2 months ago by Support.
-
AuthorPosts
-
July 14, 2020 at 1:24 pm #69104GreatisParticipant
Hello,
Sometimes this exception fired.
But I cannot reproduce it.
But I see in clients error log that the error repeats.Can you suggest a fix or workaround?
Assembler Information:
——————————————————————————
; sThirdParty.GetCommonData (Line=457 – Offset=8)
; ———————————————–
00561F84 mov edx, [ebp-$04]
00561F87 mov edx, [edx+$0094]
00561F8D call sSkinManager.TsSkinManager.IsValidSkinIndex
00561F92 test al, al
00561F94 jz sThirdParty.GetCommonData (Line=463)
00561F96 mov eax, [ebp-$04]
00561F99 call sCommonData.TsCommonData.GetCommonSkinData
00561F9E mov eax, [eax+$0520]
00561FA4 mov edx, [ebp-$04]
00561FA7 imul edx, [edx+$0094], $22
00561FAE cmp dword ptr [eax+edx*8+$14], +$64 ; <– EXCEPTION
00561FB3 jnz sThirdParty.GetCommonData (Line=463)
;
; Line=461 – Offset=12
; ——————–
00561FB5 push $00
00561FB7 mov eax, [ebp-$04]
00561FBA call sCommonData.TsCommonData.GetSkinManager
00561FBF mov ecx, eax
00561FC1 mov eax, [ebp+$08]
00561FC4 mov eax, [eax-$4C]
00561FC7 mov edx, [ebp-$04]
00561FCA mov edx, [edx+$0094]
00561FD0 call sCommonData.GetFontIndexRegisters:
—————————–
EAX: 00000528 EDI: 0000000D
EBX: 062D3310 ESI: 00000000
ECX: 00E175E8 ESP: 0019D78C
EDX: 00000000 EIP: 0060C880Another variant:
; sThirdParty.GetCommonData (Line=468 – Offset=19)
; ————————————————
0056201A mov edx, [ebp+$08]
0056201D mov edx, [edx-$44]
00562020 call sSkinManager.TsSkinManager.IsValidSkinIndex
00562025 test al, al
00562027 jz sThirdParty.GetCommonData (Line=471)
;
; Line=469 – Offset=20
; ——————–
00562029 mov eax, [ebp-$04]
0056202C call sCommonData.TsCommonData.GetCommonSkinData
00562031 mov eax, [eax+$0520]
00562037 mov edx, [ebp+$08]
0056203A imul edx, [edx-$44], $22
0056203E mov eax, [eax+edx*8+$1C] ; <– EXCEPTION
00562042 mov edx, [ebp+$08]
00562045 mov [edx-$14], eax
00562048 jmp sThirdParty.GetCommonData (Line=473)
;
; Line=471 – Offset=22
; ——————–
0056204A mov eax, [ebp+$08]
0056204D mov dword ptr [eax-$14], $00FFFFFF ; ”…Registers:
—————————–
EAX: 00000000 EDI: 0019EB88
EBX: 0019EDEC ESI: 0019EB4C
ECX: 026AF0D8 ESP: 0019EB24
EDX: 000007F8 EIP: 0056203EAlphaControls 14.22
Registered UserJuly 15, 2020 at 8:27 pm #69108SupportKeymasterHello
Can you try latest version of the package?
There is a big chance that this error is fixed already.July 16, 2020 at 9:02 am #69113GreatisParticipantHi,
I understand, but I can’t do it, because is hard in reproducing.
I see it several times on my PC and I see it every day in the user’s bug reports.
I checked the latest version 15.12.
The code was not changed: sThirdParty.pas
Now the line is 460.
if (DrawData.CurrentState = 0) and
(SkinData.FOwnerControl.Parent <> nil) and
(SkinData.SkinManager <> nil) and SkinData.SkinManager.IsValidSkinIndex(SkinData.SkinIndex) and
(SkinData.CommonSkinData.gd[SkinData.SkinIndex].Props[0].Transparency = 100) thenThe exception is on the:
SkinData.CommonSkinData.gd[SkinData.SkinIndex].Props[0].TransparencyI suppose that this code is not safe.
SkinData received as parameter:
procedure GetCommonData(SkinData: TsCtrlSkinData);SkinIndex maybe wrong or gd is not properly initialized.
I want to fix the bug and asked your opinion.
What is SkinData.SkinIndex?
How to check that it is valid?
How to check that it is not bigger than the size of “gd”?I can add “try/catch” on, but I don’t know how safe is assigning this on exception:
DrawData.SkinIndex := SkinData.SkinIndex;Thank you!
DmitryJuly 19, 2020 at 8:40 pm #69121SupportKeymasterHello!
SkinIndex is an index of skin data for appropriate section.
This index used for searching of data which stored in the sections array (“gd”).How to check that it is valid?
How to check that it is not bigger than the size of “gd”?The “IsValidSkinIndex” function checks it already, so, SkinIndex is correct there and “gd” array is not empty.
Do you know which control has this problem? And when it happens?
July 20, 2020 at 8:41 am #69129GreatisParticipantI have my own grid component.
I use SkinManager in the main form.
My grid is declared in Thridparty list as “Grid”.The grid component stored in a separate form.
SkinProvider exists in each form.I see the exception immediately after showing the child form.
The form is created manually.July 27, 2020 at 4:57 am #69137SupportKeymasterAre you sure that problem is in grid?
I see this code in the first report: “sThirdParty.GetCommonData”
This code used for drawing of buttons only. Maybe some button causes the problem there?
I still think that you should try the latest version of the package. Code in the sThirdParty.pas is not changed, but huge changes in other linked units exists.July 28, 2020 at 8:58 am #69141GreatisParticipantThank you for your answer!
I thought that it was my component.
But recently I saw the exception and the buttons (sButBtn) were not displayed.I suppose you are right, the problem is in drawing buttons.
I added try/catch to avoid exception:
DrawData.SkinIndex := SkinData.SkinIndex;
try
if (DrawData.CurrentState = 0) and
(SkinData.FOwnerControl.Parent <> nil) and
(SkinData.SkinManager <> nil) and SkinData.SkinManager.IsValidSkinIndex(SkinData.SkinIndex) and
(SkinData.CommonSkinData.gd[SkinData.SkinIndex].Props[0].Transparency = 100) then
DrawData.SkinIndex := GetFontIndex(Button, SkinData.SkinIndex, SkinData.SkinManager);
except
end;It works, but there are a lot of codes with direct access to gd.
SkinData.CommonSkinData.gd[…].I guess that IsValidSkinIndex works well, but gd is not properly filled at the moment when we access it.
Getting this causes the exception:
Props[0].TransparencyIs there a workaround?
How to be sure that the structures are filled well before opening a window with buttons?July 28, 2020 at 11:09 am #69145SupportKeymasterThis structure is filled when skin is loaded immediately.
If skin is active then this structure is filled. Maybe you know a way how can I repeat the error?
Which buttons has this error? TsBitBtn? The error occurs when form is shown immediately? Skin is active already there?- This reply was modified 4 years, 4 months ago by Support.
August 25, 2020 at 1:15 pm #69351GreatisParticipantHi,
Seems like the problems were fixed after 2 weeks of monitoring after releasing the new version.
The problem was in this code:
SkinManager->Active=RestoreCurSkin();
I supposed if the property was set it will not executes something.
I found that it is just true.
The function SetActive checks for current setting.
procedure TsSkinManager.SetActive(const Value: boolean);
begin
if FActive <> Value then begin
FActive := Value;But at the end of function it executes always:
SkinListController.SendSkinChanged;Usually, it may not a problem, but my program executes this code in Timer a lot of times.
Hope it will help someone.
Thanks for help.
Resolved.August 29, 2020 at 6:14 pm #69376SupportKeymasterHi
I will check if code in the SetActive may be improved. -
AuthorPosts
- You must be logged in to reply to this topic.