View Issue Details

IDProjectCategoryView StatusLast Update
0029911LazarusIDEpublic2019-12-12 11:37
Reporterlks Assigned ToZeljan Rikalo  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Platformi386-darwinOSOSX 
Product Version1.7 (SVN) 
Summary0029911: Lazarus dev trunk often hangs when invoking File Select Dialog
DescriptionWhen I do Project>Open, Package>Open, File>Open, File>Save As, etc., I get a file selection dialog.

About half the time on my machine (Mac Mini latest OS), the file dialog hangs with a spinning wheel. I really started noticing this problem a couple of weeks ago, although I can't swear that it wasn't happening from time to time before that.

On possibly a related note, sometimes the file dialog does not open in the proper directory (e.g. when I do Cmd-O to open a new unit file in the source file editor, the directory isn't always the same as the current unit).

Lazarus: r52073 (1.7)
FPC: r33355 (3.1.1)
TagsNo tags attached.
Fixed in Revision53027
LazTarget-
WidgetsetCarbon
Attached Files

Relationships

has duplicate 0030585 resolvedBart Broersma Intermittent hang on MacOSX Carbon associated with file dialogs 
has duplicate 0030640 resolvedJuha Manninen Chosing folder when saving project hangs 
related to 0031067 resolvedZeljan Rikalo Problem save/open project 

Activities

Hans Luijten

2016-08-20 13:19

reporter   ~0094209

I can confirm this.

I'm experiencing the same problem with SVN 52835.
The most annoying one being: File Save All.
The dialog cannot be clicked, spinning wheel, and the only thing left to do: Force Quit.
Effectively, I cannot even save a project ...

Tested on MacOS 10.11 and macOS Sierra, on MacBook Pro 13" Retina (2014) and MacBook Pro 15" Retina (2013).

Hans Luijten

2016-08-20 13:20

reporter   ~0094210

p.s. I'd consider this a major issue, as it prevents me from working with Lazarus completely.

Cyrax

2016-08-20 13:29

reporter   ~0094211

Can you people try to rebuild FPC and Lazarus without any optimization options?

Append this to your make command line:
"OPT=-gw2 -godwarfsets -godwarfmethodclassprefix -gl -O- -vbq"

Hans Luijten

2016-08-20 13:55

reporter   ~0094213

I'd love to give that a try and help out.
Sorry for the lack of experience, but where exactly do I add this?

When adding to the command line, I get an error message (tried FPC);

$> make all OPT=-gw2 -godwarfsets -godwarfmethodclassprefix -gl -O- -vbq

/Applications/Xcode.app/Contents/Developer/usr/bin/make: invalid option -- g
/Applications/Xcode.app/Contents/Developer/usr/bin/make: invalid option -- g
/Applications/Xcode.app/Contents/Developer/usr/bin/make: invalid option -- g
/Applications/Xcode.app/Contents/Developer/usr/bin/make: invalid option -- O
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Cyrax

2016-08-20 14:17

reporter   ~0094214

You need to enclose OPT with quotation marks.

Hans Luijten

2016-08-20 14:38

reporter   ~0094215

Thanks Cyrax.
I've recompiled fpc and lazarus as such (in case some else wants to try):

FPC:
make clean all "OPT=-gw2 -godwarfsets -godwarfmethodclassprefix -gl -O- -vbq"
sudo make install

Lazarus:
make clean all "OPT=-gw2 -godwarfsets -godwarfmethodclassprefix -gl -O- -vbq"
open lazarus.app

Initially, first time, the save dialog worked.
I cheered to quickly though ... save all worked once ... and is hanging again on a second attempt.
I tried starting it with "open lazarus.app" and by double clicking the app from the Finder (just to make sure).

Let me know what to try/test.

Cyrax

2016-08-20 15:00

reporter   ~0094216

Last edited: 2016-08-20 15:01

View 2 revisions

Have you tried Lazarus 1.6.2 (the fixes_1_6 branch from the Lazarus SVN repository)?

Hans Luijten

2016-08-20 15:20

reporter   ~0094217

I have tested 1.6, and then reverted to 1.6 RC.
I have no yet tested 1.6.2.
How would I get this particular version?
(again: apologies for not knowing)

Bart Broersma

2016-08-21 00:47

developer   ~0094231

> I have no yet tested 1.6.2.
1.6.2 has not been released yet.

C Western

2016-09-17 22:12

reporter   ~0094698

I have just noticed this issue; I have posted a patch in 0030585 which shows signs of fixing it for me.

Bart Broersma

2016-09-17 22:40

developer   ~0094699

@C Western: can you attach the patch from 0030585 here?
(After you do so, I can resolve 0030585 as duplicate of this one.)

C Western

2016-09-18 10:10

reporter  

hang.patch (1,055 bytes)   
diff -uwNr --exclude=.svn --exclude=Makefile --exclude=Makefile.fpc --exclude=Makefile.compiled --exclude='*.rsj' --exclude='*.bak' --exclude='*.po' lazarus/lcl/interfaces/carbon/carbonwinapi.inc lazarus.w/lcl/interfaces/carbon/carbonwinapi.inc
--- lazarus/lcl/interfaces/carbon/carbonwinapi.inc	2016-04-30 11:12:40.000000000 +0100
+++ lazarus.w/lcl/interfaces/carbon/carbonwinapi.inc	2016-09-08 22:17:24.000000000 +0100
@@ -1811,8 +1811,11 @@
       DebugLn('TCarbonWidgetSet.GetParent Widget: ' + DbgS(TCarbonControl(Handle).Widget));
     {$ENDIF}
     Result := HWnd(GetCarbonWidget(HIViewGetSuperview(TCarbonControl(Handle).Widget)));
-    if Result = 0 then // no parent control => then parent is a window?
+    if Result = 0 then begin // no parent control => then parent is a window?
       Result := HWnd(GetCarbonWidget(HIViewGetWindow(TCarbonControl(Handle).Widget)));
+      if Result = Handle then
+        Result := 0; // Sanity check - otherwise FindLCLWindow can be stuck in a loop
+    end;
   end;
   // Carbon windows has no parent
   
hang.patch (1,055 bytes)   

C Western

2016-09-18 10:11

reporter   ~0094703

Done

Zeljan Rikalo

2016-09-25 10:16

developer   ~0094808

Please test and close if ok.

Issue History

Date Modified Username Field Change
2016-03-28 06:35 lks New Issue
2016-08-20 13:19 Hans Luijten Note Added: 0094209
2016-08-20 13:20 Hans Luijten Note Added: 0094210
2016-08-20 13:29 Cyrax Note Added: 0094211
2016-08-20 13:55 Hans Luijten Note Added: 0094213
2016-08-20 14:17 Cyrax Note Added: 0094214
2016-08-20 14:38 Hans Luijten Note Added: 0094215
2016-08-20 15:00 Cyrax Note Added: 0094216
2016-08-20 15:01 Cyrax Note Edited: 0094216 View Revisions
2016-08-20 15:20 Hans Luijten Note Added: 0094217
2016-08-21 00:47 Bart Broersma Note Added: 0094231
2016-09-17 22:12 C Western Note Added: 0094698
2016-09-17 22:39 Bart Broersma Relationship added has duplicate 0030585
2016-09-17 22:40 Bart Broersma Note Added: 0094699
2016-09-18 10:10 C Western File Added: hang.patch
2016-09-18 10:11 C Western Note Added: 0094703
2016-09-24 20:15 Juha Manninen Relationship added has duplicate 0030640
2016-09-25 10:00 Zeljan Rikalo Assigned To => Zeljan Rikalo
2016-09-25 10:00 Zeljan Rikalo Status new => assigned
2016-09-25 10:16 Zeljan Rikalo Fixed in Revision => 53027
2016-09-25 10:16 Zeljan Rikalo LazTarget => -
2016-09-25 10:16 Zeljan Rikalo Widgetset => Carbon
2016-09-25 10:16 Zeljan Rikalo Note Added: 0094808
2016-09-25 10:16 Zeljan Rikalo Status assigned => resolved
2016-09-25 10:16 Zeljan Rikalo Resolution open => fixed
2016-12-09 00:44 Juha Manninen Relationship added related to 0031067