Access violation in OnHintTimer for Floating Button in Win64 binary

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #37875
    HeDiBo
    Participant

    Hovering over a TacFloatBtn for retrieving the Hint, there is an access violation when running my application as a WIN64 process:

    Code:
    procedure TacFloatComponent.OnHintTimer(Sender: TObject);
    begin
    if (FHintTimer <> nil) and (TObject(FHintTimer.Tag) is TacFloatBtn) then // Produces the access violation
    with TacFloatBtn(FHintTimer.Tag) do begin
    FHintTimer.Enabled := False;
    if (AForm <> nil) and PtInRect(AForm.BoundsRect, acMousePos) then
    DoShowHintWnd(TObject(FHintTimer.Tag));
    end;
    end;

    This is the stack at the moment of the error:

    Code:
    System._IsClass($FFFFFFFFFB0B01E0,TClass($150E7A0))
    acFloatCtrls.TacFloatComponent.OnHintTimer($7FF4FA933AE0)
    Vcl.ExtCtrls.TTimer.Timer
    Vcl.ExtCtrls.TTimer.WndProc($14FBB0)
    System.Classes.StdWndProc(???,???,???,???)
    :00007FFFB9766CC1 ; C:WINDOWSSystem32user32.dll
    :00007FFFB9766693 ; C:WINDOWSSystem32user32.dll
    Vcl.Forms.TApplication.ProcessMessage(???)
    Vcl.Forms.TApplication.HandleMessage
    Vcl.Forms.TApplication.Run
    #58059
    HeDiBo
    Participant

    Redefining the hint timer as this:

    Code:
    TsTimer = class(TTimer)
    protected
    FOwner: TObject;
    end{class};

    and making the appropriate adjustments in TacFloatBtn.pas, replacing the use of the Tag property with the FOwner property will do the trick.

    The same problem could arise in procedure TsSkinProvider.StartHintTimer(TitleItem: TacTitleBarItem);

    #58069
    Support
    Keymaster

    Thank you for researching, I will check it soon.

    #58077
    Support
    Keymaster

    Hello!

    Can you help me to repeat this error in the test-application? Is it possible?

    #58078
    HeDiBo
    Participant
    'Support' wrote:

    Hello!

    Can you help me to repeat this error in the test-application? Is it possible?

    Your code uses a Tag (which is a NativeInt) as a pointer to a TObject (which is 64 bits Word in the Win64 binary).

    That's what's wrong, I think.

    But my problem is only reproducable if the object resides at an address that requires more than 63 bits and has the sign set.

    By the way, my solution works, I implemented it in the appropriate places in AC and got rid of the problem.

    #58079
    Support
    Keymaster

    You are right, I will change it in the nearest release.

    #58094
    HeDiBo
    Participant
    'Support' wrote:

    You are right, I will change it in the nearest release.

    The sSkinProvider module has the same problem:

    Code:
    procedure TsSkinProvider.OnHintTimer(Sender: TObject);
    begin
    if (FHintTimer nil) and (FHintTimer.Tag 0) then begin
    FHintTimer.Enabled := False;
    if PtInRect(FHintRect, acMousePos) then
    ShowHintWnd(TacTitleBarItem(FHintTimer.Tag)); // This causes trouble
    end;
    end;

    Making a similar change as in TacFloatBtn, solved this problem too.

    #58117
    Support
    Keymaster

    This code will be changed in the nearest release, also.

    #58172
    HeDiBo
    Participant
    'Support' wrote:

    This code will be changed in the nearest release, also.

    Problem solved in AC 13.17a7.gif

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.