Recent

Author Topic: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?  (Read 8443 times)

MISV

  • Hero Member
  • *****
  • Posts: 783
I have submitted this bug today
https://bugs.freepascal.org/view.php?id=34088

Essentially
I am using fpcupdeluxe. Upon startup and other times you get arithmetic error. Trying to rebuild gives access violation.

But I did not get any backtrace or line number information
http://wiki.lazarus.freepascal.org/Creating_a_Backtrace_with_lldb

MISV

  • Hero Member
  • *****
  • Posts: 783
I some trace of the access violation posted. But the IDE remains unusable to me :( Can anyone else duplicate the problem?

MISV

  • Hero Member
  • *****
  • Posts: 783
I managed to make some traces of the arithmetic error. I submitted bug report but sofar no response. Can anyone duplicate my problem? I think it is a pretty critical problem if IDE does not work :(

NBut maybe a larger problem for me because I rely on fpcupdeluxe and not setup a Carbon-IDE to compile Cocoa appplications. Maybe that was a way forward...

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
judging by the log file, I can think that the issue comes from the difference in the order of LCL messages sent.

Though an interesting thing is that the issue comes from "files drop" call:
Code: [Select]
    frame 0000006: 0x000000010079af34 lazarus`MAINIDEBARDROPFILES(this=0x000000010a9c68f0, SENDER=0x000000010a9c68f0, FILENAMES=ANSISTRING [] @ 0x000000010ac70670, highFILENAMES=0) at mainbar.pas:405
    frame 0000007: 0x000000010005fca4 lazarus`FORMS$_$TCUSTOMFORM_$__$$_INTFDROPFILES$array_of_ANSISTRING + 68
    frame 0000008: 0x00000001001eed3d lazarus`-[TAppDelegate application:openFiles:] + 357
    frame 0000009: 0x00007fff4e6741ba AppKit`-[NSApplication _doOpenFile:ok:tryTemp:] + 286
    frame 0000010: 0x00007fff4e253337 AppKit`-[NSApplication finishLaunching] + 2438

So my question is: how do you start the IDE?
- do you double click on a lazarus file (letting macOS to open the IDE for you)
- do you drag and drop the file into IDE or the app icon
- do you simply launch IDE (by clicking on the app icon in Finder or Dock)
- some other way?
« Last Edit: August 09, 2018, 05:11:51 pm by skalogryz »

Trenatos

  • Hero Member
  • *****
  • Posts: 535
    • MarcusFernstrom.com
I haven't done a stack trace, but I have the same problem when using fpcupdeluxe.

For a while now, I've had to rebuild using lazbuild from the commandline to get rid of the arithmetic error.

Code: Pascal  [Select][+][-]
  1. lazbuild --build-ide= --widgetset="Cocoa"

Then I can run it normally, as well as rebuild through the IDE.

MISV

  • Hero Member
  • *****
  • Posts: 783
judging by the log file, I can think that the issue comes from the difference in the order of LCL messages sent.

Though an interesting thing is that the issue comes from "files drop" call:
Code: [Select]
    frame 0000006: 0x000000010079af34 lazarus`MAINIDEBARDROPFILES(this=0x000000010a9c68f0, SENDER=0x000000010a9c68f0, FILENAMES=ANSISTRING [] @ 0x000000010ac70670, highFILENAMES=0) at mainbar.pas:405
    frame 0000007: 0x000000010005fca4 lazarus`FORMS$_$TCUSTOMFORM_$__$$_INTFDROPFILES$array_of_ANSISTRING + 68
    frame 0000008: 0x00000001001eed3d lazarus`-[TAppDelegate application:openFiles:] + 357
    frame 0000009: 0x00007fff4e6741ba AppKit`-[NSApplication _doOpenFile:ok:tryTemp:] + 286
    frame 0000010: 0x00007fff4e253337 AppKit`-[NSApplication finishLaunching] + 2438

So my question is: how do you start the IDE?
- do you double click on a lazarus file (letting macOS to open the IDE for you)
- do you drag and drop the file into IDE or the app icon
- do you simply launch IDE (by clicking on the app icon in Finder or Dock)
- some other way?


fpcupdeluxe supplies a startlazarus.app file which I use (it seems to launch lazarus.app) by doubbleclicking on it in Finder
« Last Edit: August 09, 2018, 06:18:20 pm by MISV »

MISV

  • Hero Member
  • *****
  • Posts: 783
I haven't done a stack trace, but I have the same problem when using fpcupdeluxe.

For a while now, I've had to rebuild using lazbuild from the commandline to get rid of the arithmetic error.

Code: Pascal  [Select][+][-]
  1. lazbuild --build-ide= --widgetset="Cocoa"

Then I can run it normally, as well as rebuild through the IDE.

I get this error
Quote
(3104) Compiling lclextensions_package.pas
(3104) Compiling delphicompat.pas
/Users/examplename/EN/LazarusComponents/lclextensions_lazarus/delphicompat.pas(131,2) Fatal: (2013) Cannot open include file "uses.inc"
Fatal: (1018) Compilation aborted
Error: (lazarus) Compile package lclextensions_package 0.6.1: stopped with exit code 256
/Users/examplename/EN/LazarusComponents/HtmlViewer/source/FramBrwz.pas(1088,51) Warn
/Developer/lazarus/components/ideintf/dbpropedits.pas(58,32) Hint: (5024) Parameter "Index" no
(310
Error: (lazarus) Compile package FrameViewer09 11.0: terminated
Error: (lazarus) Compile package IDEIntf 1.0: terminated
Error: (lazarus) Compile package SynEdit 1.0: terminated
Error: (lazarus) [TLazPackageGraph.CompileRequiredPackages] "Exit code 256"
Error: (lazarus) Building IDE: Compile AutoInstall Packages failed.

I have had issues with this before - maybe related:
https://bugs.freepascal.org/view.php?id=33973

« Last Edit: August 15, 2018, 09:56:15 am by MISV »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
fpcupdeluxe supplies a startlazarus.app file which I use (it seems to launch lazarus.app) by doubbleclicking on it in Finder
ok, and what happens if you start lazarus.app manually (using lazarus binary)?

MISV

  • Hero Member
  • *****
  • Posts: 783
fpcupdeluxe supplies a startlazarus.app file which I use (it seems to launch lazarus.app) by doubbleclicking on it in Finder
ok, and what happens if you start lazarus.app manually (using lazarus binary)?

Same error - happens in lazarus file no matter how I have tried to start it - but if there are other ways I should try let me know. (I ran lldb against lazarus)
« Last Edit: August 09, 2018, 08:51:30 pm by MISV »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
please run lazarus under lldb.
When lldb loads lazarus, and prompts you to enter the first command, please run the following and provide the output:
Code: [Select]
settings show target.run-args

and then continue the execution.

MISV

  • Hero Member
  • *****
  • Posts: 783
please run lazarus under lldb.
When lldb loads lazarus, and prompts you to enter the first command, please run the following and provide the output:
Code: [Select]
settings show target.run-args

and then continue the execution.


Code: Pascal  [Select][+][-]
  1. (lldb) settings show target.run-args
  2. target.run-args (array of strings) =
  3. (lldb)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
and does it crash with EXC_BAD_ACCESS or Arithmetic overflow?

IF it's EXC_BAD_ACCESS, then try to modify cocoaobject.inc (part of cocoaint.pas)
Code: Pascal  [Select][+][-]
  1. procedure TAppDelegate.application_openFiles(sender: NSApplication; filenames: NSArray);
  2. var
  3.   lFiles: array of string;
  4.   lNSStr: NSString;
  5.   i: Integer;
  6. begin
  7.   if (filenames.count=0) then Exit; // this is a new line
  8.   SetLength(lFiles, filenames.count);
  9.   for i := 0 to filenames.count-1 do
  10.   begin
  11.     lNSStr := NSString(filenames.objectAtIndex(i));
  12.     lFiles[i] := NSStringToString(lNSStr);
  13.   end;
  14.   Application.IntfDropFiles(lFiles);
  15.   if Application.MainForm<>nil then
  16.     Application.MainForm.IntfDropFiles(lFiles);
  17. end;
  18.  
« Last Edit: August 09, 2018, 10:49:37 pm by skalogryz »

MISV

  • Hero Member
  • *****
  • Posts: 783
and does it crash with EXC_BAD_ACCESS or Arithmetic overflow?

IF it's EXC_BAD_ACCESS, then try to modify cocoaobject.inc (part of cocoaint.pas)
Code: Pascal  [Select][+][-]
  1. procedure TAppDelegate.application_openFiles(sender: NSApplication; filenames: NSArray);
  2. var
  3.   lFiles: array of string;
  4.   lNSStr: NSString;
  5.   i: Integer;
  6. begin
  7.   if (filenames.count=0) then Exit; // this is a new line
  8.   SetLength(lFiles, filenames.count);
  9.   for i := 0 to filenames.count-1 do
  10.   begin
  11.     lNSStr := NSString(filenames.objectAtIndex(i));
  12.     lFiles[i] := NSStringToString(lNSStr);
  13.   end;
  14.   Application.IntfDropFiles(lFiles);
  15.   if Application.MainForm<>nil then
  16.     Application.MainForm.IntfDropFiles(lFiles);
  17. end;
  18.  


Upon startup I get arithmetic overflow.

However, I will try take another look tonight, but I can/could not rebuild the lazarus IDE due to lclextensions issue with missing uses.inc file (on/off problems with fpcupdeluxe trunks - see one of hee above posts)
« Last Edit: August 10, 2018, 05:11:13 pm by MISV »

MISV

  • Hero Member
  • *****
  • Posts: 783
Seems newest trunk solved the issues...

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Seems newest trunk solved the issues...
there was nothing done in the trunk to resolve the issue.
What revision did you use before?

 

TinyPortal © 2005-2018