View Issue Details

IDProjectCategoryView StatusLast Update
0025217LazarusLCLpublic2013-11-18 02:11
ReporteraccSoneAssigned ToPaul Ishenin 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.3 (SVN)Product Build2013-10-18 
Target VersionFixed in Version1.2.0 
Summary0025217: TLabel crahes with EXC_BAD_ACCESS
Descriptioncompile with 64bit and TLable crashes in TWidgetSet.DrawText (intfbasewinapi.inc, line 750 ) when it tries to reset the DC brush in:

function TCocoaWidgetSet.SelectObject(ADC: HDC; GDIObj: HGDIOBJ): HGDIOBJ;
cocoawinapi.inc, line 1477

-> if gdi is TCocoaBrush then <- crashes here
Steps To ReproduceCompile attached test program and run it.
Additional InformationMaybe the reason is a leak of the initial brushs and pens of the dc used by TLabel? No crash if one uncomment:

  {Reset brush}
// SelectObject(DC, B);

  {Reset pen}
// DeleteObject(SelectObject(DC, P));
  

in intfbasewinapi.inc, line 749
Tagscocoa
Fixed in Revision43456
LazTarget-
WidgetsetCocoa
Attached Files
  • testcocoa64bitapp.zip (131,930 bytes)
  • fix_0025217.diff (345 bytes)
    Index: intfbasewinapi.inc
    ===================================================================
    --- intfbasewinapi.inc	(revision 43274)
    +++ intfbasewinapi.inc	(working copy)
    @@ -366,7 +366,7 @@
       AStr : String;
       pIndex,
       pX1, pX2, pY : Longint;
    -  B, P : Longint;
    +  B, P : HGDIOBJ;
       LogP : TLogPen;
       MaxLength : Integer;
       Pt : TPoint;
    
    fix_0025217.diff (345 bytes)

Relationships

has duplicate 0025216 closedZeljan Rikalo TLabel crahes with EXC_BAD_ACCESS 

Activities

accSone

2013-10-19 19:42

developer  

testcocoa64bitapp.zip (131,930 bytes)

accSone

2013-10-19 19:48

developer   ~0070902

No crash if compiling same project with i386 (32bit)

accSone

2013-10-20 17:09

developer  

fix_0025217.diff (345 bytes)
Index: intfbasewinapi.inc
===================================================================
--- intfbasewinapi.inc	(revision 43274)
+++ intfbasewinapi.inc	(working copy)
@@ -366,7 +366,7 @@
   AStr : String;
   pIndex,
   pX1, pX2, pY : Longint;
-  B, P : Longint;
+  B, P : HGDIOBJ;
   LogP : TLogPen;
   MaxLength : Integer;
   Pt : TPoint;
fix_0025217.diff (345 bytes)

accSone

2013-10-20 17:13

developer   ~0070923

Problem was the longint type of B,P in line 396 of intfbasewinapi.inc. This doesn't work in 64bit. Replaced with HGDIOBJ that has the right size. Attached you find the patch.

Paul Ishenin

2013-11-18 02:11

manager   ~0071373

Thanks, applied.

Issue History

Date Modified Username Field Change
2013-10-19 19:42 accSone New Issue
2013-10-19 19:42 accSone File Added: testcocoa64bitapp.zip
2013-10-19 19:46 accSone Tag Attached: cocoa
2013-10-19 19:48 accSone Note Added: 0070902
2013-10-19 21:26 Zeljan Rikalo Relationship added has duplicate 0025216
2013-10-20 17:09 accSone File Added: fix_0025217.diff
2013-10-20 17:13 accSone Note Added: 0070923
2013-11-18 02:11 Paul Ishenin Fixed in Revision => 43456
2013-11-18 02:11 Paul Ishenin LazTarget => -
2013-11-18 02:11 Paul Ishenin Note Added: 0071373
2013-11-18 02:11 Paul Ishenin Status new => resolved
2013-11-18 02:11 Paul Ishenin Fixed in Version => 1.2.0
2013-11-18 02:11 Paul Ishenin Resolution open => fixed
2013-11-18 02:11 Paul Ishenin Assigned To => Paul Ishenin