View Issue Details

IDProjectCategoryView StatusLast Update
0030183LazarusLCLpublic2018-01-09 17:08
ReporterChris Rorden Assigned ToOndrej Pokorny  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
PlatformMacBook RetinaOSDarwin El Capitan 
Product Version1.6 
Summary0030183: 64-bit Cocoa applications compiled on El Capitan crash.
DescriptionI was happily building my large projects (MRIcroGL and SurfIce) as 64-bit Cocoa executables with Yosemite. I then upgraded my computer and Xcode (though I have kept the same fps/lazarus install). I can build and run 32-bit Carbon and 32-bit Cocoa applications. I can also run 64-bit Cocoa applications I created with Lazarus prior to the upgrade (e.g. from OSX 10.10). However, 64-bit Cocoa applications built on El Capitan crash. This might be related to FPC issue 0029667, but I am wary of upgrading to the latest SVN for both Lazarus and FPC when everything else works so well. I would be grateful if someone running the latest SVN could see if this problem is still present. It effects any Lazarus project that is compiled for 64-bit Cocoa (e.g. lazbuild ./project1.lpr --cpu=x86_64 --ws=cocoa --compiler="/usr/local/bin/ppcx64")
Steps To ReproduceA. Create a blank Lazarus GUI application and build it on OSX (so it creates a .app folder). In my example I added the following feedback, but this is optional.

procedure TForm1.FormShow(Sender: TObject);
begin
  {$IFDEF LCLCarbon} writeln('Carbon'); {$ENDIF}
  {$IFDEF LCLCocoa} writeln('Cocoa'); {$ENDIF}
  {$IFDEF CPU64} writeln('64-bit'); {$ELSE} writeln('32-bit'); {$ENDIF}
end;

B. Compile the project as 64-bit Cocoa from the command line
 lazbuild ./project1.lpr --cpu=x86_64 --ws=cocoa --compiler="/usr/local/bin/ppcx64

C. Run the project


-------------------------

1.) Default 32-bit Carbon works
> lazbuild ./project1.lpr
> ./project1.app/Contents/MacOS/project1
> Carbon
> 32-bit


2.) 32-bit Cocoa works
> lazbuild ./project1.lpr --ws=cocoa
> ./project1.app/Contents/MacOS/project1
> Carbon
> 32-bit

3.) 64-bit Cocoa fails
> lazbuild ./project1.lpr --cpu=x86_64 --ws=cocoa --compiler="/usr/local/bin/ppcx64"
> Cocoa
> 64-bit
TApplication.HandleException Access violation
  Stack trace:
  $00007FFF8F1724DD
  $0000000100184BB8
  $00007FFF92AE1C36
  $00007FFF92AE2B15
  $00007FFF92521539
  $00000001001824DB
  $00007FFF924A14DB
  $00000001001776E7
  $0000000100034142
  $00000001000363FD
  $00000001000368C4
  $0000000100177592
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetCocoa
Attached Files

Relationships

duplicate of 0029667 resolvedJonas Maebe FPC 64 bit Objective C problems 

Activities

Ondrej Pokorny

2016-05-25 06:30

developer   ~0092764

> I would be grateful if someone running the latest SVN could see if this problem is still present.

Please use the mailing list or forum for questions. Report here only bugs you tested yourself.

Chris Rorden

2016-05-25 15:45

reporter   ~0092771

OK, I can confirm that upgrading to the latest FPC fixes this issue. I assume it is a duplicate of 0029667, and can be closed. I do hope a version of FPC with this patch is included in the next stable Lazarus release.

1.) Get SVN to get FPC revision 33788.
   svn co http://svn.freepascal.org/svn/fpc/trunk fpc
2.) Build/Install 64-bit version of FPC
   sudo make all CPU_TARGET=x86_64
   sudo make install CPU_TARGET=x86_64
3.) Check fpc version
  /usr/local/lib/fpc/3.1.1/ppcx64 -v
  Free Pascal Compiler version 3.1.1 [2016/05/25] for x86_64
4.) Build project
  ./project1.lpr --cpu=x86_64 --ws=cocoa --compiler="/usr/local/lib/fpc/3.1.1/ppcx64"

Ondrej Pokorny

2016-05-25 16:33

developer   ~0092775

> I do hope a version of FPC with this patch is included in the next stable Lazarus release.

It depends when FPC 3.0.2 is released.

Chris Rorden

2018-01-09 17:08

reporter   ~0105553

Fixed.

Issue History

Date Modified Username Field Change
2016-05-24 21:56 Chris Rorden New Issue
2016-05-25 06:30 Ondrej Pokorny Note Added: 0092764
2016-05-25 15:45 Chris Rorden Note Added: 0092771
2016-05-25 16:33 Ondrej Pokorny Note Added: 0092775
2016-05-25 16:35 Ondrej Pokorny LazTarget => -
2016-05-25 16:35 Ondrej Pokorny Relationship added duplicate of 0029667
2016-05-25 16:35 Ondrej Pokorny Status new => resolved
2016-05-25 16:35 Ondrej Pokorny Resolution open => duplicate
2016-05-25 16:35 Ondrej Pokorny Assigned To => Ondrej Pokorny
2018-01-09 17:08 Chris Rorden Note Added: 0105553
2018-01-09 17:08 Chris Rorden Status resolved => closed