64-bit Cocoa applications compiled on El Capitan crash.
Original Reporter info from Mantis: crlab @neurolabusc1
-
Reporter name: Chris Rorden
Original Reporter info from Mantis: crlab @neurolabusc1
- Reporter name: Chris Rorden
Description:
I 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 reproduce:
A. 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
Mantis conversion info:
- Mantis ID: 30183
- OS: Darwin El Capitan
- OS Build: 10.11.5
- Build: 1.6.0
- Platform: MacBook Retina
- Version: 1.6
- Monitored by: » Vincent (Vincent Snijders)