View Issue Details

IDProjectCategoryView StatusLast Update
0019310FPCRTLpublic2011-05-15 17:13
ReporterMartin Friebe Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformw32OSwin 
Product Version2.5.1 
Fixed in Version2.6.0 
Summary0019310: "assert", raises exception with wrong code/frame-address
DescriptionAssert has a similar issue as 0012528

  Procedure AssertErrorHandler (Const Msg,FN : ShortString;LineNo:longint; TheAddr : pointer);
  Var S : String;
  begin
    If Msg='' then S:=SAssertionFailed else S:=Msg;
    Raise EAssertionFailed.Createfmt(SAssertError,[S,Fn,LineNo]) at Pointer(theAddr);
  end;

When the compiler creates code for assert (w32/i386) it bushes the current value of ebp on the stack (same as "get_frame" would return).

As you can see, in the above code, the value of ebp is used as the address of the code raising the assert. This value does not even point to any code at all.

As in 0012528 the frame is set to 0x0

My understanding is, that the code should be

    Raise EAssertionFailed.Createfmt(SAssertError,[S,Fn,LineNo]) at get_caller_addr(theAddr), get_caller_frame(theAddr);
Steps To Reproducetrigger an assert, and inspect the argument to fpc_raiseexception
TagsNo tags attached.
Fixed in Revision17470
FPCOldBugId
FPCTarget
Attached Files

Relationships

related to 0012528 resolvedFlorian TFPList exception with no excpetion stack printed 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2011-05-08 11:44 Martin Friebe New Issue
2011-05-15 17:03 Florian Relationship added related to 0012528
2011-05-15 17:13 Florian Fixed in Revision => 17470
2011-05-15 17:13 Florian Status new => resolved
2011-05-15 17:13 Florian Fixed in Version => 2.5.1
2011-05-15 17:13 Florian Resolution open => fixed
2011-05-15 17:13 Florian Assigned To => Florian