[Lazarus] Trunk LCL-AggPas demo 1 gives segmentation fault

Alexander Klenin klenin at gmail.com
Mon Mar 12 13:17:35 CET 2012


On Mon, Mar 12, 2012 at 20:57, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:

> I've got the latest Lazarus Trunk and using FPC 2.6.1 under 64-bit
> Ubuntu 10.04. Running the demo gives me a near instant crash. Ignoring
> the error gives me a blank form. No AggPas painting occurs at all.


> #4  0x000000000074b9d7 in AGGTEXTOUT (this=0x7ffff7e0ec30, X=10.5, Y=30.5,
>    STR=0xa32ce0 "LCL and AggPas", ROUNDOFF=false, DDX=0, DDY=0)
>    at ../../../../../lazarus/components/aggpas/src/agg_lcl.pas:452
> #5  0x0000000000742779 in DOTEXTOUT (this=0x7ffff7e0ec30, X=10, Y=30,
>    STR=0xa32ce0 "LCL and AggPas")
>    at ../../../../../lazarus/components/aggpas/src/agg_fpimage.pas:1480
> #6  0x000000000053ae01 in
> FPCANVAS$_$TFPCUSTOMCANVAS_$__$$_TEXTOUT$LONGINT$LONGINT$ANSISTRING ()

This may or may not help, but I have carried the patch below in my
local copy for a few years already.
I vaguely remember the symthoms to be the same, but I am on Windows,
and it was a long time ago.

Index: src/agg_fpimage.pas
===================================================================
--- src/agg_fpimage.pas	(revision 35880)
+++ src/agg_fpimage.pas	(working copy)
@@ -3483,10 +3483,10 @@
 end;

 procedure TAggFPFont.SetAggHeight(const AValue: double);
-{$IFDEF AGG2D_USE_FREETYPE}
+//{$IFDEF AGG2D_USE_FREETYPE}
 var
   c: TAggFPCanvas;
-{$ENDIF}
+//{$ENDIF}
 begin
   if FAggHeight=AValue then exit;
   FAggHeight:=AValue;
@@ -3498,7 +3498,11 @@
   else
     c.m_fontEngine.height_(c.AggWorldToScreen(FAggHeight ) );
   {$ELSE}
-  // ToDo
+  c:=TAggFPCanvas(Canvas);
+  if FAggCache = AGG_VectorFontCache then
+    c.m_fontEngine.height_(FAggHeight )
+  else
+    c.m_fontEngine.height_(c.AggWorldToScreen(FAggHeight ) );
   {$ENDIF}
 end;



-- 
Alexander S. Klenin




More information about the Lazarus mailing list