Lazarus

Programming => Widgetset => Cocoa => Topic started by: MISV on August 03, 2018, 10:50:58 pm

Title: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 03, 2018, 10:50:58 pm
I have submitted this bug today
https://bugs.freepascal.org/view.php?id=34088 (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 (http://wiki.lazarus.freepascal.org/Creating_a_Backtrace_with_lldb)
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 05, 2018, 04:04:39 pm
I some trace of the access violation posted. But the IDE remains unusable to me :( Can anyone else duplicate the problem?
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 09, 2018, 04:05:02 pm
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...
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: skalogryz on August 09, 2018, 05:06:55 pm
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?
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: Trenatos on August 09, 2018, 05:40:59 pm
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.
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 09, 2018, 05:48:01 pm
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
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 09, 2018, 06:11:29 pm
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 (https://bugs.freepascal.org/view.php?id=33973)

Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: skalogryz on August 09, 2018, 08:37:52 pm
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)?
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 09, 2018, 08:49:34 pm
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)
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: skalogryz on August 09, 2018, 09:34:48 pm
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.
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 09, 2018, 09:50:04 pm
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)
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: skalogryz on August 09, 2018, 10:45:30 pm
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.  
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 10, 2018, 04:19:49 pm
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)
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 11, 2018, 12:26:33 am
Seems newest trunk solved the issues...
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: skalogryz on August 11, 2018, 02:51:57 am
Seems newest trunk solved the issues...
there was nothing done in the trunk to resolve the issue.
What revision did you use before?
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 12, 2018, 03:50:40 pm
At time of writing my initial post,  I have been using at max a 1 day old trunk there. Most likely only hours old, but I don't have revision number.

...But maybe my build was messed up somehow...

Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: skalogryz on August 12, 2018, 04:36:57 pm
what if it's a floating bug?
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 15, 2018, 12:47:09 am
Maybe depending on if I am installing 32bit or 64bit fpcupdeluxe... maybe different units pulled in or similar... will try test both to see just in case I made an oversight concerning using 32 vs 64 bit cocoa
Title: Re: Cocoa IDE erroring - rebuilding not possible - cant make full lldb trace?
Post by: MISV on August 16, 2018, 01:12:54 am
now it seems to work on both 32bit/cocoa and 64bit/cocoa fpcupdeluxe builds   :)
TinyPortal © 2005-2018