View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0036318 | Lazarus | Utilities | public | 2019-11-15 22:52 | 2020-11-11 16:56 |
Reporter | Abou Al Montacir | Assigned To | Juha Manninen | ||
Priority | normal | Severity | minor | Reproducibility | random |
Status | resolved | Resolution | fixed | ||
Platform | x86_64 | OS | Debian GNU/Linux | ||
Product Version | 2.0.6 | ||||
Summary | 0036318: lazbuild crashes when compiling packages | ||||
Description | This issue was initially reported as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=943600 During Debian auto tests the packages are rebuilt and sometimes a crash in lazbuild is observed. The following trace was obtained after the crash: (1008) 3534 lines compiled, 0.6 sec (1021) 4 warning(s) issued (1022) 30 hint(s) issued (1023) 3 note(s) issued Warning: (lazarus) [TLazPackageGraph.ConvertPackageRSTFiles] skipping read only directory /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/language/ Thread 4 "lazbuild" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff7408700 (LWP 9098)] 0x000000000051ac03 in LEAVECRITICALSECTION (this=0x7ffff7641880) at ideexterntoolintf.pas:1237 1237 FWorkerMessages.LeaveCriticalSection; (gdb) bt # 0 0x000000000051ac03 in LEAVECRITICALSECTION (this=0x7ffff7641880) at ideexterntoolintf.pas:1237 # 1 0x00000000009e9cb5 in SETTHREAD (this=0x7ffff7641880, AVALUE=0x0) at exttools.pas:411 # 2 0x00000000009edc57 in SETTOOL (this=0x7ffff761fc40, AVALUE=0x0) at exttools.pas:1313 # 3 0x00000000009eeeb1 in DESTROY (this=0x7ffff761fc40, vmt=0x1) at exttools.pas:1612 # 4 0x000000000041cd20 in SYSTEM$_$TOBJECT_$__$$_FREE () # 5 0x00007ffff77a9a80 in ?? () # 6 0x0000000000440cd7 in CLASSES_$$_THREADFUNC$POINTER$$INT64 () # 7 0x00007ffff761fc40 in ?? () # 8 0x0000000000000000 in ?? () (gdb) p FWorkerMessages $1 = 0x0 | ||||
Steps To Reproduce | One can reproduce the issue by executing the following command multiple times. It may require tens of times before the issue is observed. rm -r /tmp/.lazarus ; HOME=/tmp ./lazbuild -B --verbose /usr/lib/lazarus/2.0.6/components/sparta/smartformeditor/sparta_smartformeditor.lpk | ||||
Additional Information | Some investigations using instrumented code as follows resulted int he following logs: Code changes: procedure TAbstractExternalTool.EnterCriticalSection; begin WriteLn('+TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = ', HexStr(FWorkerMessages)); FWorkerMessages.EnterCriticalSection; WriteLn('-TAbstractExternalTool.EnterCriticalSection'); end; procedure TAbstractExternalTool.LeaveCriticalSection; begin WriteLn('+TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = ', HexStr(FWorkerMessages)); FWorkerMessages.LeaveCriticalSection; WriteLn('-TAbstractExternalTool.LeaveCriticalSection'); end; Logs: (1008) 3534 lines compiled, 0.6 sec (1021) 4 warning(s) issued (1022) 30 hint(s) issued (1023) 3 note(s) issued +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.EnterCriticalSection +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.LeaveCriticalSection Warning: (lazarus) [TLazPackageGraph.ConvertPackageRSTFiles] skipping read only directory /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/language/ +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.EnterCriticalSection +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.EnterCriticalSection +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.LeaveCriticalSection +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.LeaveCriticalSection +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.EnterCriticalSection +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A17940 +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.LeaveCriticalSection +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.EnterCriticalSection +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.EnterCriticalSection +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.LeaveCriticalSection +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.EnterCriticalSection +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.LeaveCriticalSection +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A16DE0 -TAbstractExternalTool.EnterCriticalSection +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 00007FFFF7A16DE0 -TAbstractExternalTool.LeaveCriticalSection +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A13340 -TAbstractExternalTool.EnterCriticalSection +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 00007FFFF7A13340 -TAbstractExternalTool.LeaveCriticalSection +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 00007FFFF7A17940 -TAbstractExternalTool.LeaveCriticalSection -TAbstractExternalTool.EnterCriticalSection +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 0000000000000000 Thread 4 "lazbuild" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff7408700 (LWP 11030)] 0x000000000051ad0b in LEAVECRITICALSECTION (this=0x7ffff7649880) at ideexterntoolintf.pas:1240 1240 FWorkerMessages.LeaveCriticalSection; (gdb) | ||||
Tags | No tags attached. | ||||
Fixed in Revision | r64005 | ||||
LazTarget | - | ||||
Widgetset | |||||
Attached Files |
|
related to | 0032340 | resolved | Juha Manninen | lazbuild exception |
related to | 0028448 | resolved | Juha Manninen | lazbuild appears to stall when building on armel and armhf |
related to | 0036959 | resolved | Juha Manninen | LazBuild crashes with --recursive builds |
related to | 0037179 | resolved | Juha Manninen | [lazbuild] [patch] Lazbuild randomly aborts project building process. |
related to | 0037883 | resolved | Juha Manninen | The problem of building software in Lazarus 2.1.0 svn > 63557 |
|
lazbuild-crash.log (30,804 bytes)
$rm -r /tmp/.lazarus ; HOME=/tmp gdb --args ./lazbuild -B --verbose /usr/lib/lazarus/2.0.6/components/sparta/smartformeditor/sparta_smartformeditor.lpk GNU gdb (Debian 8.2.1-2+b1) 8.2.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./lazbuild...done. (gdb) r Starting program: /mnt/data/mazen/Debian/lazarus/lazbuild -B --verbose /usr/lib/lazarus/2.0.6/components/sparta/smartformeditor/sparta_smartformeditor.lpk [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Parameter: build-all Hint: (lazarus) primary config path: /tmp/.lazarus CopySecondaryConfigFile /etc/lazarus/environmentoptions.xml -> /tmp/.lazarus/environmentoptions.xml Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="" TargetCPU="" Options="" compiler file changed "/usr/bin/fpc" FileAge=1548372422 StoredAge=0 Hint: [TPCTargetConfigCache.NeedsUpdate] /usr/bin/fpc TargetOS= TargetCPU= CompilerOptions= ExtraOptions= PATH=/home/mazen/bin:/home/mazen/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/bin Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-iWTOTP" [Detaching after fork from child process 9082] Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-va" "compilertest.pas" [Detaching after fork from child process 9084] Hint: [TPCTargetConfigCache.Update] has changed Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 Changed: OS/CPU=True LCL=False Hint: (lazarus) compile package "/usr/lib/lazarus/2.0.6/components/sparta/smartformeditor/sparta_smartformeditor.lpk" Hint: (lazarus) package FCL 1.0.1 was compiled via "make" with parameters " -Fu. -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq fcllaz.pas" Hint: (lazarus) package LazUtils 1.0 was compiled via "make" with parameters " -Fu../../packager/units/x86_64-linux;. -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq lazutils.pas" Hint: (lazarus) Missing state file of sparta_Generics 0.0: /usr/lib/lazarus/2.0.6/components/sparta/generics/lib/x86_64-linux/sparta_Generics.compiled Error: (lazarus) unable to create package output directory "/usr/lib/lazarus/2.0.6/components/sparta/generics/lib/x86_64-linux" of package "sparta_Generics 0.0" Hint: (lazarus) normal output directory of package sparta_Generics 0.0 is not writable: "/usr/lib/lazarus/2.0.6/components/sparta/generics/lib/x86_64-linux/" Hint: (lazarus) Fallback output directory of sparta_Generics: /tmp/.lazarus/lib/sparta_Generics/lib/x86_64-linux TParsedCompilerOptions.SetOutputDirectoryOverride New=/tmp/.lazarus/lib/sparta_Generics/lib/x86_64-linux Hint: (lazarus) Missing state file of sparta_Generics 0.0: /tmp/.lazarus/lib/sparta_Generics/lib/x86_64-linux/sparta_Generics.compiled Hint: (lazarus) package LCLBase 2.0.6 was compiled via "make" with parameters " -Fuforms;widgetset;nonwin32;../packager/units/x86_64-linux;../components/lazutils/lib/x86_64-linux;. -Fiinclude -MObjFPC -Scghi -O1 -g -gl -vew -l alllclunits.pp" Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="linux" TargetCPU="x86_64" Options="" compiler file changed "/usr/bin/fpc" FileAge=1548372422 StoredAge=0 Hint: [TPCTargetConfigCache.NeedsUpdate] /usr/bin/fpc TargetOS=linux TargetCPU=x86_64 CompilerOptions= ExtraOptions= PATH=/home/mazen/bin:/home/mazen/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/bin Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-iWTOTP" "-Px86_64" "-Tlinux" [Detaching after fork from child process 9086] Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-va" "compilertest.pas" "-Px86_64" "-Tlinux" [Detaching after fork from child process 9088] Hint: [TPCTargetConfigCache.Update] has changed Hint: (lazarus) package LCL 2.0.6 was compiled via "make" with parameters " -MObjFPC -Scghi -O1 -g -gl -vewnhi -l -Fugtk2;../../packager/units/x86_64-linux;../../components/lazutils/lib/x86_64-linux;../units/x86_64-linux;. -Figtk2 lcl.pas" Hint: (lazarus) package LazControls 1.0.1 was compiled via "make" with parameters " -Fu../../packager/units/x86_64-linux;../lazutils/lib/x86_64-linux;../../lcl/units/x86_64-linux;../../lcl/units/x86_64-linux/gtk2;. -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -dLCL -dLCLgtk2 lazcontrols.pas" Hint: (lazarus) Missing state file of sparta_MDI 0.0: /usr/lib/lazarus/2.0.6/components/sparta/mdi/lib/x86_64-linux/sparta_MDI.compiled Error: (lazarus) unable to create package output directory "/usr/lib/lazarus/2.0.6/components/sparta/mdi/lib/x86_64-linux" of package "sparta_MDI 0.0" Hint: (lazarus) normal output directory of package sparta_MDI 0.0 is not writable: "/usr/lib/lazarus/2.0.6/components/sparta/mdi/lib/x86_64-linux/" Hint: (lazarus) Fallback output directory of sparta_MDI: /tmp/.lazarus/lib/sparta_MDI/lib/x86_64-linux TParsedCompilerOptions.SetOutputDirectoryOverride New=/tmp/.lazarus/lib/sparta_MDI/lib/x86_64-linux Hint: (lazarus) Missing state file of sparta_MDI 0.0: /tmp/.lazarus/lib/sparta_MDI/lib/x86_64-linux/sparta_MDI.compiled Hint: (lazarus) package IDEIntf 1.0 was compiled via "make" with parameters " -Fu../../packager/units/x86_64-linux;../lazutils/lib/x86_64-linux;../../lcl/units/x86_64-linux;../../lcl/units/x86_64-linux/gtk2;../lazcontrols/lib/x86_64-linux/gtk2;. -Fiimages -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -dLCL -dLCLgtk2 ideintf.pas" Hint: (lazarus) Missing state file of sparta_DockedFormEditor 0.0: /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/lib/x86_64-linux/gtk2/sparta_DockedFormEditor.compiled Error: (lazarus) unable to create package output directory "/usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/lib/x86_64-linux/gtk2" of package "sparta_DockedFormEditor 0.0" Hint: (lazarus) normal output directory of package sparta_DockedFormEditor 0.0 is not writable: "/usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/lib/x86_64-linux/gtk2/" Hint: (lazarus) Fallback output directory of sparta_DockedFormEditor: /tmp/.lazarus/lib/sparta_DockedFormEditor/lib/x86_64-linux/gtk2 TParsedCompilerOptions.SetOutputDirectoryOverride New=/tmp/.lazarus/lib/sparta_DockedFormEditor/lib/x86_64-linux/gtk2 Hint: (lazarus) Missing state file of sparta_DockedFormEditor 0.0: /tmp/.lazarus/lib/sparta_DockedFormEditor/lib/x86_64-linux/gtk2/sparta_DockedFormEditor.compiled Hint: (lazarus) TBuildManager.MacroFuncInstantFPCCache /usr/bin/instantfpc Hint: (lazarus) [RunTool] "/usr/bin/instantfpc" "--get-cache" [Detaching after fork from child process 9091] Hint: (lazarus) [TBuildManager.MacroFuncInstantFPCCache] /tmp/.cache/instantfpc/ [New Thread 0x7ffff7408700 (LWP 9092)] Info: (lazarus) Execute Title="Compile package sparta_Generics 0.0" Info: (lazarus) Working Directory="/usr/lib/lazarus/2.0.6/components/sparta/generics/" Info: (lazarus) Executable="/usr/bin/fpc" Info: (lazarus) Param[0]="-B" Info: (lazarus) Param[1]="-MObjFPC" Info: (lazarus) Param[2]="-Scghi" Info: (lazarus) Param[3]="-Cg" Info: (lazarus) Param[4]="-O1" Info: (lazarus) Param[5]="-g" Info: (lazarus) Param[6]="-gl" Info: (lazarus) Param[7]="-l" Info: (lazarus) Param[8]="-vewnhibq" Info: (lazarus) Param[9]="-Fi/usr/lib/lazarus/2.0.6/components/sparta/generics/source/inc" Info: (lazarus) Param[10]="-Fu/usr/lib/lazarus/2.0.6/components/sparta/generics/source" Info: (lazarus) Param[11]="-Fu/usr/lib/lazarus/2.0.6/packager/units/x86_64-linux" Info: (lazarus) Param[12]="-Fu/usr/lib/lazarus/2.0.6/components/sparta/generics/" Info: (lazarus) Param[13]="-FU/tmp/.lazarus/lib/sparta_Generics/lib/x86_64-linux" Info: (lazarus) Param[14]="sparta_generics.pas" [Detaching after fork from child process 9093] Hint: (11030) Start of reading config file /etc/fpc.cfg Hint: (11031) End of reading config file /etc/fpc.cfg Free Pascal Compiler version 3.0.4+dfsg-22 [2019/01/24] for x86_64 Copyright (c) 1993-2017 by Florian Klaempfl and others (1002) Target OS: Linux for x86-64 (3104) Compiling sparta_generics.pas (3104) Compiling ./source/generics.collections.pas (3104) Compiling ./source/generics.memoryexpanders.pas (3104) Compiling ./source/generics.defaults.pas (3104) Compiling ./source/generics.hashes.pas (3104) Compiling ./source/generics.strings.pas (1010) Writing Resource String Table file: generics.strings.rsj (3104) Compiling ./source/generics.helpers.pas (1008) 12751 lines compiled, 5.2 sec [New Thread 0x7ffff6f9f700 (LWP 9095)] Info: (lazarus) Execute Title="Compile package sparta_MDI 0.0" Info: (lazarus) Working Directory="/usr/lib/lazarus/2.0.6/components/sparta/mdi/" Info: (lazarus) Executable="/usr/bin/fpc" Info: (lazarus) Param[0]="-B" Info: (lazarus) Param[1]="-MObjFPC" Info: (lazarus) Param[2]="-Scghi" Info: (lazarus) Param[3]="-Cg" Info: (lazarus) Param[4]="-O1" Info: (lazarus) Param[5]="-g" Info: (lazarus) Param[6]="-gl" Info: (lazarus) Param[7]="-l" Info: (lazarus) Param[8]="-vewnhibq" Info: (lazarus) Param[9]="-Fu/usr/lib/lazarus/2.0.6/components/sparta/mdi/source" Info: (lazarus) Param[10]="-Fu/usr/lib/lazarus/2.0.6/packager/units/x86_64-linux" Info: (lazarus) Param[11]="-Fu/usr/lib/lazarus/2.0.6/components/lazutils/lib/x86_64-linux" Info: (lazarus) Param[12]="-Fu/tmp/.lazarus/lib/sparta_Generics/lib/x86_64-linux" Info: (lazarus) Param[13]="-Fu/usr/lib/lazarus/2.0.6/lcl/units/x86_64-linux" Info: (lazarus) Param[14]="-Fu/usr/lib/lazarus/2.0.6/lcl/units/x86_64-linux/gtk2" Info: (lazarus) Param[15]="-Fu/usr/lib/lazarus/2.0.6/components/sparta/mdi/" Info: (lazarus) Param[16]="-FU/tmp/.lazarus/lib/sparta_MDI/lib/x86_64-linux" Info: (lazarus) Param[17]="-dLCL" Info: (lazarus) Param[18]="-dLCLgtk2" Info: (lazarus) Param[19]="sparta_mdi.pas" [Detaching after fork from child process 9096] [Thread 0x7ffff7408700 (LWP 9092) exited] Hint: (11030) Start of reading config file /etc/fpc.cfg Hint: (11031) End of reading config file /etc/fpc.cfg Free Pascal Compiler version 3.0.4+dfsg-22 [2019/01/24] for x86_64 Copyright (c) 1993-2017 by Florian Klaempfl and others (1002) Target OS: Linux for x86-64 (3104) Compiling sparta_mdi.pas (3104) Compiling ./source/sparta_basicresizeframe.pas (3104) Compiling ./source/sparta_interfacesmdi.pas /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(34,30) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(33,24) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(142,34) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(74,30) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(77,51) Hint: (5024) Parameter "Button" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(77,78) Hint: (5024) Parameter "Shift" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(77,103) Hint: (5024) Parameter "X" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(77,111) Hint: (5024) Parameter "Y" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(78,51) Hint: (5024) Parameter "Shift" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(78,76) Hint: (5024) Parameter "X" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(78,84) Hint: (5024) Parameter "Y" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(79,49) Hint: (5024) Parameter "Button" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(79,76) Hint: (5024) Parameter "Shift" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(79,101) Hint: (5024) Parameter "X" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(79,109) Hint: (5024) Parameter "Y" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(105,35) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(106,33) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(71,25) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(71,51) Hint: (5024) Parameter "Done" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(49,29) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(1012,21) Hint: (5057) Local variable "LMsg" does not seem to be initialized /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(50,27) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(50,64) Hint: (5024) Parameter "Shift" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(1026,21) Hint: (5057) Local variable "LMsg" does not seem to be initialized /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(51,25) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(51,62) Hint: (5024) Parameter "Shift" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicresizeframe.pas(52,32) Hint: (5024) Parameter "Sender" not used (3104) Compiling ./source/sparta_basicresizer.pas (3104) Compiling ./source/sparta_abstractresizer.pas (3104) Compiling sparta_mdi_strconsts.pas (1010) Writing Resource String Table file: sparta_mdi_strconsts.rsj /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_abstractresizer.pas(18,32) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_abstractresizer.pas(23,43) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_abstractresizer.pas(39,31) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_abstractresizer.pas(39,53) Hint: (5024) Parameter "PositioningKind" not used (3104) Compiling ./source/sparta_basicfakecustom.pas (3104) Compiling ./source/sparta_formbackgroundformdi.pas /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(16,31) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(16,53) Hint: (5024) Parameter "Button" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(17,12) Hint: (5024) Parameter "Shift" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(17,37) Hint: (5024) Parameter "X" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(17,45) Hint: (5024) Parameter "Y" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(18,31) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(18,53) Hint: (5024) Parameter "Shift" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(18,78) Hint: (5024) Parameter "X" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(18,86) Hint: (5024) Parameter "Y" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(20,29) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(20,51) Hint: (5024) Parameter "Button" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(21,12) Hint: (5024) Parameter "Shift" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(21,37) Hint: (5024) Parameter "X" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_formbackgroundformdi.pas(21,45) Hint: (5024) Parameter "Y" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicfakecustom.pas(42,34) Hint: (5024) Parameter "AVal" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicfakecustom.pas(43,34) Hint: (5024) Parameter "AVal" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicfakecustom.pas(44,32) Hint: (5024) Parameter "AVal" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicfakecustom.pas(45,32) Hint: (5024) Parameter "AVal" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicfakecustom.pas(46,34) Hint: (5024) Parameter "AVal" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_basicfakecustom.pas(73,30) Hint: (5024) Parameter "AModified" not used (3104) Compiling ./source/sparta_multiplyresizer.pas /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_multiplyresizer.pas(33,40) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/./source/sparta_multiplyresizer.pas(41,31) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/generics.defaults.pas(285,33) Hint: (5024) Parameter "AFrom" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/generics.defaults.pas(285,40) Hint: (5024) Parameter "ATo" not used Warning: (4046) Constructing a class "TCustomDictionaryEnumerator$4$crc9F8762C9" with abstract method "DoMoveNext" /usr/lib/lazarus/2.0.6/components/sparta/mdi/generics.collections.pas(140,14) Hint: (5062) Found abstract method: DoMoveNext(<TEnumerator$1$crc9BD4E51B>):Boolean; Warning: (4046) Constructing a class "TCustomDictionaryEnumerator$4$crc9F8762C9" with abstract method "GetCurrent" Hint: (5062) Found abstract method: GetCurrent(<TCustomDictionaryEnumerator$4$crc9F8762C9>):TMultiplyResizer; Warning: (4046) Constructing a class "TCustomDictionaryEnumerator$4$crc53E23F4C" with abstract method "DoMoveNext" /usr/lib/lazarus/2.0.6/components/sparta/mdi/generics.collections.pas(140,14) Hint: (5062) Found abstract method: DoMoveNext(<TEnumerator$1$crcB48932EB>):Boolean; Warning: (4046) Constructing a class "TCustomDictionaryEnumerator$4$crc53E23F4C" with abstract method "GetCurrent" Hint: (5062) Found abstract method: GetCurrent(<TCustomDictionaryEnumerator$4$crc53E23F4C>;<var IDesignedForm>):IDesignedForm; /usr/lib/lazarus/2.0.6/components/sparta/mdi/generics.defaults.pas(285,33) Hint: (5024) Parameter "AFrom" not used /usr/lib/lazarus/2.0.6/components/sparta/mdi/generics.defaults.pas(285,40) Hint: (5024) Parameter "ATo" not used Warning: (4046) Constructing a class "TCustomDictionaryEnumerator$4$crc8C671884" with abstract method "DoMoveNext" /usr/lib/lazarus/2.0.6/components/sparta/mdi/generics.collections.pas(140,14) Hint: (5062) Found abstract method: DoMoveNext(<TEnumerator$1$crc2C698D20>):Boolean; Warning: (4046) Constructing a class "TCustomDictionaryEnumerator$4$crc8C671884" with abstract method "GetCurrent" Hint: (5062) Found abstract method: GetCurrent(<TCustomDictionaryEnumerator$4$crc8C671884>):TResizerRec; Warning: (4046) Constructing a class "TCustomDictionaryEnumerator$4$crcD5798EC8" with abstract method "DoMoveNext" /usr/lib/lazarus/2.0.6/components/sparta/mdi/generics.collections.pas(140,14) Hint: (5062) Found abstract method: DoMoveNext(<TEnumerator$1$crcB48932EB>):Boolean; Warning: (4046) Constructing a class "TCustomDictionaryEnumerator$4$crcD5798EC8" with abstract method "GetCurrent" Hint: (5062) Found abstract method: GetCurrent(<TCustomDictionaryEnumerator$4$crcD5798EC8>;<var IDesignedForm>):IDesignedForm; /usr/lib/lazarus/2.0.6/components/sparta/mdi/sparta_mdi.pas(10,3) Hint: (5023) Unit "sparta_BasicResizeFrame" not used in sparta_MDI /usr/lib/lazarus/2.0.6/components/sparta/mdi/sparta_mdi.pas(10,28) Hint: (5023) Unit "sparta_InterfacesMDI" not used in sparta_MDI /usr/lib/lazarus/2.0.6/components/sparta/mdi/sparta_mdi.pas(10,50) Hint: (5023) Unit "sparta_BasicResizer" not used in sparta_MDI /usr/lib/lazarus/2.0.6/components/sparta/mdi/sparta_mdi.pas(11,3) Hint: (5023) Unit "sparta_MDI_StrConsts" not used in sparta_MDI /usr/lib/lazarus/2.0.6/components/sparta/mdi/sparta_mdi.pas(11,25) Hint: (5023) Unit "sparta_BasicFakeCustom" not used in sparta_MDI /usr/lib/lazarus/2.0.6/components/sparta/mdi/sparta_mdi.pas(11,49) Hint: (5023) Unit "sparta_FormBackgroundForMDI" not used in sparta_MDI /usr/lib/lazarus/2.0.6/components/sparta/mdi/sparta_mdi.pas(12,3) Hint: (5023) Unit "sparta_MultiplyResizer" not used in sparta_MDI /usr/lib/lazarus/2.0.6/components/sparta/mdi/sparta_mdi.pas(12,27) Hint: (5023) Unit "sparta_AbstractResizer" not used in sparta_MDI (1008) 2817 lines compiled, 1.4 sec (1021) 8 warning(s) issued (1022) 75 hint(s) issued [New Thread 0x7ffff7408700 (LWP 9098)] Info: (lazarus) Execute Title="Compile package sparta_DockedFormEditor 0.0" Info: (lazarus) Working Directory="/usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/" Info: (lazarus) Executable="/usr/bin/fpc" Info: (lazarus) Param[0]="-B" Info: (lazarus) Param[1]="-MObjFPC" Info: (lazarus) Param[2]="-Scghi" Info: (lazarus) Param[3]="-Cg" Info: (lazarus) Param[4]="-O1" Info: (lazarus) Param[5]="-g" Info: (lazarus) Param[6]="-gl" Info: (lazarus) Param[7]="-Xg" Info: (lazarus) Param[8]="-l" Info: (lazarus) Param[9]="-vewnhibq" Info: (lazarus) Param[10]="-Fi/usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/source" Info: (lazarus) Param[11]="-Fu/usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/source" Info: (lazarus) Param[12]="-Fu/usr/lib/lazarus/2.0.6/packager/units/x86_64-linux" Info: (lazarus) Param[13]="-Fu/usr/lib/lazarus/2.0.6/components/lazutils/lib/x86_64-linux" Info: (lazarus) Param[14]="-Fu/tmp/.lazarus/lib/sparta_Generics/lib/x86_64-linux" Info: (lazarus) Param[15]="-Fu/usr/lib/lazarus/2.0.6/lcl/units/x86_64-linux" Info: (lazarus) Param[16]="-Fu/usr/lib/lazarus/2.0.6/lcl/units/x86_64-linux/gtk2" Info: (lazarus) Param[17]="-Fu/usr/lib/lazarus/2.0.6/components/lazcontrols/lib/x86_64-linux/gtk2" Info: (lazarus) Param[18]="-Fu/tmp/.lazarus/lib/sparta_MDI/lib/x86_64-linux" Info: (lazarus) Param[19]="-Fu/usr/lib/lazarus/2.0.6/components/ideintf/units/x86_64-linux/gtk2" Info: (lazarus) Param[20]="-Fu/usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/" Info: (lazarus) Param[21]="-FU/tmp/.lazarus/lib/sparta_DockedFormEditor/lib/x86_64-linux/gtk2" Info: (lazarus) Param[22]="-dLCL" Info: (lazarus) Param[23]="-dLCLgtk2" Info: (lazarus) Param[24]="sparta_dockedformeditor.pas" [Thread 0x7ffff6f9f700 (LWP 9095) exited] [Detaching after fork from child process 9099] Hint: (11030) Start of reading config file /etc/fpc.cfg Hint: (11031) End of reading config file /etc/fpc.cfg Free Pascal Compiler version 3.0.4+dfsg-22 [2019/01/24] for x86_64 Copyright (c) 1993-2017 by Florian Klaempfl and others (1002) Target OS: Linux for x86-64 (3104) Compiling sparta_dockedformeditor.pas (3104) Compiling ./source/sparta_reg_dockedformeditor.pas (3104) Compiling ./source/sparta_mainide.pas (3104) Compiling ./source/sparta_hashutils.pas (3104) Compiling sparta_strconsts.pas (1010) Writing Resource String Table file: sparta_strconsts.rsj (3104) Compiling ./source/sparta_designedform.pas (3104) Compiling ./source/sparta_resizer.pas (3104) Compiling ./source/spartaapi.pas /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/spartaapi.pas(83,33) Hint: (5024) Parameter "AParent" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/spartaapi.pas(83,47) Hint: (5024) Parameter "AAddons" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/spartaapi.pas(84,33) Hint: (5024) Parameter "AEDTUClass" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/spartaapi.pas(85,35) Hint: (5024) Parameter "AEDTUClass" not used (3104) Compiling ./source/sparta_fakeform.pas (3104) Compiling ./source/sparta_fakecustom.pas (3104) Compiling ./source/sparta_mainide.pas (3104) Compiling ./source/sparta_fakeform.pas /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_fakeform.pas(54,15) Warning: (3057) An inherited method is hidden by "SetAlign(TAlign);" /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_fakeform.pas(55,15) Warning: (3057) An inherited method is hidden by "SetAnchors(const TAnchors);" (3104) Compiling ./source/sparta_fakeframe.pas /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_fakeframe.pas(39,15) Warning: (3057) An inherited method is hidden by "SetAlign(TAlign);" /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_fakeframe.pas(41,15) Warning: (3057) An inherited method is hidden by "SetAnchors(const TAnchors);" (3104) Compiling ./source/sparta_resizerframe.pas /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(56,32) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(111,30) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(866,3) Note: (5025) Local variable "Designer" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(867,3) Note: (5025) Local variable "Form" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(138,72) Hint: (5024) Parameter "AIndex" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(157,38) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(158,36) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(183,39) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(183,61) Hint: (5024) Parameter "Button" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(184,12) Hint: (5024) Parameter "Shift" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(184,37) Hint: (5024) Parameter "X" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(184,45) Hint: (5024) Parameter "Y" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(180,38) Hint: (5024) Parameter "Sender" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(179,52) Hint: (5024) Parameter "APersistent" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(179,83) Hint: (5024) Parameter "Select" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(173,62) Hint: (5024) Parameter "AEditor" not used /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/./source/sparta_mainide.pas(1707,3) Note: (5027) Local variable "LPageCtrl" is assigned but never used (3104) Compiling ./source/sparta_fakenoncontrol.pas /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/sparta_dockedformeditor.pas(11,32) Hint: (5023) Unit "sparta_DesignedForm" not used in sparta_DockedFormEditor /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/sparta_dockedformeditor.pas(11,53) Hint: (5023) Unit "sparta_Resizer" not used in sparta_DockedFormEditor /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/sparta_dockedformeditor.pas(12,3) Hint: (5023) Unit "sparta_ResizerFrame" not used in sparta_DockedFormEditor /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/sparta_dockedformeditor.pas(12,24) Hint: (5023) Unit "SpartaAPI" not used in sparta_DockedFormEditor /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/sparta_dockedformeditor.pas(12,35) Hint: (5023) Unit "sparta_FakeCustom" not used in sparta_DockedFormEditor /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/sparta_dockedformeditor.pas(12,54) Hint: (5023) Unit "sparta_FakeForm" not used in sparta_DockedFormEditor /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/sparta_dockedformeditor.pas(13,3) Hint: (5023) Unit "sparta_FakeFrame" not used in sparta_DockedFormEditor /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/sparta_dockedformeditor.pas(13,21) Hint: (5023) Unit "sparta_FakeNonControl" not used in sparta_DockedFormEditor /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/sparta_dockedformeditor.pas(13,60) Hint: (5023) Unit "sparta_HashUtils" not used in sparta_DockedFormEditor /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/sparta_dockedformeditor.pas(14,3) Hint: (5023) Unit "sparta_strconsts" not used in sparta_DockedFormEditor (1008) 3534 lines compiled, 0.6 sec (1021) 4 warning(s) issued (1022) 30 hint(s) issued (1023) 3 note(s) issued Warning: (lazarus) [TLazPackageGraph.ConvertPackageRSTFiles] skipping read only directory /usr/lib/lazarus/2.0.6/components/sparta/dockedformeditor/language/ Thread 4 "lazbuild" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff7408700 (LWP 9098)] 0x000000000051ac03 in LEAVECRITICALSECTION (this=0x7ffff7641880) at ideexterntoolintf.pas:1237 1237 FWorkerMessages.LeaveCriticalSection; (gdb) bt #0 0x000000000051ac03 in LEAVECRITICALSECTION (this=0x7ffff7641880) at ideexterntoolintf.pas:1237 #1 0x00000000009e9cb5 in SETTHREAD (this=0x7ffff7641880, AVALUE=0x0) at exttools.pas:411 #2 0x00000000009edc57 in SETTOOL (this=0x7ffff761fc40, AVALUE=0x0) at exttools.pas:1313 #3 0x00000000009eeeb1 in DESTROY (this=0x7ffff761fc40, vmt=0x1) at exttools.pas:1612 #4 0x000000000041cd20 in SYSTEM$_$TOBJECT_$__$$_FREE () #5 0x00007ffff77a9a80 in ?? () #6 0x0000000000440cd7 in CLASSES_$$_THREADFUNC$POINTER$$INT64 () #7 0x00007ffff761fc40 in ?? () #8 0x0000000000000000 in ?? () (gdb) p FWorkerMessages $1 = 0x0 |
|
I have observed this very same crash many times on ARM ! With various FPC versions and Lazarus versions. |
|
Exactly. Second run works without crash. Cleaning lib/$(CPU_TARGET)-$(OS_TARGET) also helps. Looks like reading outdated PPU raises exception without proper error report or unit rebuild requirement. |
|
I've used the attached patch to close Debian side ticket, but not sure if this is the right fix for long term. Fix-lazbuild-random-crash.patch (849 bytes)
Description: lazbuild fails to build some packages during auto tests. Author: Abou Al Montacir <abou.almontacir@sfr.fr> Bug-Debian: http://bugs.debian.org/943600 diff --git a/components/ideintf/ideexterntoolintf.pas b/components/ideintf/ideexterntoolintf.pas index 4654265c..fdf7549f 100644 --- a/components/ideintf/ideexterntoolintf.pas +++ b/components/ideintf/ideexterntoolintf.pas @@ -1229,12 +1229,14 @@ end; procedure TAbstractExternalTool.EnterCriticalSection; begin - FWorkerMessages.EnterCriticalSection; + if Assigned(FWorkerMessages) then + FWorkerMessages.EnterCriticalSection; end; procedure TAbstractExternalTool.LeaveCriticalSection; begin - FWorkerMessages.LeaveCriticalSection; + if Assigned(FWorkerMessages) then + FWorkerMessages.LeaveCriticalSection; end; procedure TAbstractExternalTool.ConsistencyCheck; |
|
Unfortunately the above patch did not fix completely the crash. |
|
This looks fishy: ... +TAbstractExternalTool.EnterCriticalSection: FWorkerMessages = 00007FFFF7A17940 +TAbstractExternalTool.LeaveCriticalSection: FWorkerMessages = 00007FFFF7A17940 ... The debug message for entering "LeaveCriticalSection" comes right after the debug message for entering "EnterCriticalSection". The actual call for FWorkerMessages.EnterCriticalSection has not happened yet. |
|
I have an additional request for lazbuild. Lazbuild has an option "--max-process-count" If I understand the docs, the default is to max the process-count if undefined. I would like to propose to use only a single process as default. In the same way that make has a --jobs option: 1 per default. To stretch this request even more ... ;-) This is the Makefile patch I use for useride: ***************************************************** useride: ifdef LAZBUILDJOBS ifdef LCL_PLATFORM ./lazbuild$(SRCEXEEXT) --max-process-count=$(LAZBUILDJOBS) --lazarusdir=. --build-ide= --ws=$(LCL_PLATFORM) else ./lazbuild$(SRCEXEEXT) --max-process-count=$(LAZBUILDJOBS) --lazarusdir=. --build-ide= endif else ifdef LCL_PLATFORM ./lazbuild$(SRCEXEEXT) --lazarusdir=. --build-ide= --ws=$(LCL_PLATFORM) else ./lazbuild$(SRCEXEEXT) --lazarusdir=. --build-ide= endif endif ***************************************************** starter: As you can see, also the --ws is set !! My 2 cents. |
|
@Alfred, does using only a single process cure the crash, too? It is a reasonable suggestion in any case. |
|
Well. I am not sure. All installs by fpcupdeluxe patch the Lazarus makefile as proposed above. I have not seen this error since then on my own systems and have not received any reports anymore regarding this crash by users. But this is not a rocket-science conclusion as you will understand. |
|
> All installs by fpcupdeluxe patch the Lazarus makefile as proposed above. > I have not seen this error since then on my own systems and have not received any reports anymore regarding this crash by users. Do you mean your code block would replace in the root Makefile this at line 3391? useride: ./lazbuild$(SRCEXEEXT) --lazarusdir=. --build-ide= The Makefile is actually generated from Makefile.fpc. It has a comment on top saying : # Don't edit, this file is generated by FPCMake Version 2.0.0 I had to study this topic when I recently split IdeIntf package. So the patch should go to Makefile.fpc file. There starting at line 189 is : #----------------------------------------------------------------------------- # calls lazbuild to build lazarus and packages with user's settings # requires lazbuild # ignores LCL_PLATFORM and OPTS useride: ./lazbuild$(SRCEXEEXT) --lazarusdir=. --build-ide= It has an explicit mention about ignoring LCL_PLATFORM and OPTS. This must be asked from Mattias. He is the only one who knows the build details well. One more thing: I don't find LAZBUILDJOBS anywhere in the Makefile. Is that correct? And another: The Makefile section builds Lazarus useride using LazBuild. It does not build LazBuild itself, thus it cannot fix any bug in LazBuild. What bug exactly gets fixed? I think we a mixing too many issues here now. |
|
@juha. Yes, the change must be made in Makefile.fpc. And, after the change, the Makefiles must be re-generated. If Mattias is going to take a look at the Makefile, I would like to ask both of you to look at some other reports about the Makefile also. Perhaps you are to review these also. https://bugs.freepascal.org/view.php?id=36316 https://bugs.freepascal.org/view.php?id=36767 https://bugs.freepascal.org/view.php?id=36688 |
|
Ps: The latest release of fpcupdeluxe does not patch for LAZBUILDJOBS anymore. The Makefile itself only gets an internal hack for the LCL_PLATFORM, otherwise using lazbuild on Darwin cocoa fails. I have included the original patch for the Makefile, for your info. lazpatch_useride.patch (736 bytes)
Index: Makefile =================================================================== --- Makefile (revision 62450) +++ Makefile (working copy) @@ -3276,7 +3276,19 @@ idepkg: $(MAKE) -C ide idepkg useride: +ifdef LAZBUILDJOBS +ifdef LCL_PLATFORM + ./lazbuild$(SRCEXEEXT) --max-process-count=$(LAZBUILDJOBS) --lazarusdir=. --build-ide= --ws=$(LCL_PLATFORM) +else + ./lazbuild$(SRCEXEEXT) --max-process-count=$(LAZBUILDJOBS) --lazarusdir=. --build-ide= +endif +else +ifdef LCL_PLATFORM + ./lazbuild$(SRCEXEEXT) --lazarusdir=. --build-ide= --ws=$(LCL_PLATFORM) +else ./lazbuild$(SRCEXEEXT) --lazarusdir=. --build-ide= +endif +endif starter: $(MAKE) -C ide starter lazbuild: registration lazutils codetools |
|
"And another: The Makefile section builds Lazarus useride using LazBuild. It does not build LazBuild itself, thus it cannot fix any bug in LazBuild. What bug exactly gets fixed? I think we a mixing too many issues here now." The above is 100% correct. I still have no real clue about the original crash report or its fixes. |
|
As I said, the patch forcing using only one process does reduce de occurrence rate, but still not fixing this issue. I continue seeing it in the continuous integration builds. |
|
Hello Juha and Abou, In the process of making fpcupdeluxe multi-threaded, I have used the Lazarus code for external tools. Code-re-use is always better than re-inventing the wheel. While using the code, I encountered some crashes. I solved it by changing the destroy-sequence. Look here: destructor TExternalTools.Destroy; begin RunExternalTool:=nil; TerminateAll; EnterCriticalSection; try if fRunning.Count>0 then raise Exception.Create('TExternalTools.Destroy some tools still running'); if ExternalToolList=Self then ExternalToolList:=nil; if ExternalTools=Self then ExternalTools:=nil; inherited Destroy; <----------------------------------------- In original code, destroy is called here. FreeAndNil(fRunning); FreeAndNil(fParsers); finally LeaveCriticalSection; end; DoneCriticalsection(FCritSec); inherited Destroy; <----------------------------------------- In my code, destroy is called here. This solved all crashes. end; Please review. |
|
I just reviewed the above change myself: did not work. So, never mind. Will keep on searching. |
|
Was close. The below causes no crashes anymore ! destructor TExternalTools.Destroy; begin RunExternalTool:=nil; TerminateAll; EnterCriticalSection; try if fRunning.Count>0 then raise Exception.Create('TExternalTools.Destroy some tools still running'); if ExternalToolList=Self then ExternalToolList:=nil; if ExternalTools<>Self then inherited Destroy; FreeAndNil(fRunning); FreeAndNil(fParsers); finally LeaveCriticalSection; end; DoneCriticalsection(FCritSec); if ExternalTools=Self then inherited Destroy; end; |
|
Alfred, can you please provide a patch. In related 0036959 you have a patch which looks different from your destructor TExternalTools.Destroy code here. Why? It was about the same problem, wasn't it? |
|
Hi Juha, Yes, please use the patch as attached in https://bugs.freepascal.org/view.php?id=36959 It looks good to me, has logic, and prevents all crashes. |
|
Ok, the patch is similar. The other part sets FTool.FThread:=nil; without using the setter method. However calling inherited Destroy from different places based on a global variable feels like a hack. What more, having 2 global variables (ExternalToolList and ExternalTools) for the same purpose feels like a hack, too. ExternalToolList is defined for the base class and it should be enough IMO. How would you fix the bug if ExternalTools variable was removed? I will send a question for the ExternalTool author Mattias, too. |
|
Alright. I will (also) wait for Mattias answer too, before discussing this in detail. |
|
I added the make useride options LCL_PLATFORM and LAZBUILDJOBS to Makefile.fpc and Makefile in trunk |
|
Your patch calls inherited based on ExternalTools=Self. In lazbuild the ExternalTools is at that point already nil, so you never call inherited. Please confirm. |
|
Formerly ExternalTools was freed using FreeAndNil, which first sets ExternalTools to nil, and the calls Free. I changed it to ExternalTools.Free, so ExternalTools is still set during the destructor, and the call of TerminateAll. I was not able to reproduce the crash in lazbuild, so please test, if this makes a difference for you. |
|
First, thanks for the Makefile changes ! Second: no luck. Still crash. Thanks to a previous (related) report, this crash is now easy to reproduce (on Windows) by compiling lazpaint with lazbuild. |
|
See my changes in r63079. It does not try to fix any crashes but it clarifies the global variables. I turned ExternalTools from a global var into a global function, returning ExternalToolList. Duplicate assignments to ExternalToolList was removed. Now ExternalToolList is assigned only in TExternalToolsBase constructor and destructor. Please test. So the change by Mattias made no difference. Please try if your earlier change "FTool.FThread:=nil;" does. Otherwise I have no idea what is going on. |
|
Sorry about this, but its still not working. Makes me curious: may I ask what is wrong with the patch I proposed, that results in a working lazbuild ? |
|
> may I ask what is wrong with the patch I proposed, that results in a working lazbuild ? Please see note #c122412 by Mattias. Your patch prevents inherited Destroy ever being called, thus leaking memory. Mattias also asked for your confirmation in that note. By looking at your patch I can say it is a hack. Something is seriously wrong if you must call inherited Destroy from 2 different places based on a global variable value. I admit a memory leak is better than a crash but we should find the fundamental reason for the crash. |
|
I added debug lines in r63082. There are many calls to CheckSynchronize by procedure TExternalToolsConsole.HandleMesages. Please add more debug lines to suspicious places. I believe the actual bug can be tracked finally. [Edit] I downloaded LazPaint sources from GitHub and tried to build it, as it allegedly triggers the error more often. It cannot be built with the BGRA* stuff provided by OPM. Is it really so? Do I need to download the packages from somewhere else? |
|
I tried lazbuild 63082 with -B -r dozen times on Win10 with fpc 3.0.4 32bit. Never a crash. Instead of unreliable lineinfo stacktrace, can you get a gdb backtrace? |
|
Here you go. ******************************************************************* TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! An unhandled exception occurred at $77623D53: EAccessViolation: Access violation $77623D53 $775F8911 $775F60F9 TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! $004172A9 TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! $00416D66 TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! $00491338 TABSTRACTEXTERNALTOOL__ENTERCRITICALSECTION, line 1231 of ideexterntoolintf.pas TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! $0072E42B TEXTERNALTOOL__SETTHREAD, line 468 of exttools.pas TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! (1002) Target OS: Win32 for i386 (3104) Compiling lazpaint.lpr TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! $0073173B TEXTERNALTOOLTHREAD__SETTOOL, line 1375 of exttools.pas TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! $0073259D TEXTERNALTOOLTHREAD__DESTROY, line 1678 of exttools.pas TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! $00413472 TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! $00409D7F $76DE6359 $77627C14 $77627BE4 TExternalToolsConsole.HandleMesages: Calling CheckSynchronize! |
|
This does not look like a gdb backtrace. See here: https://wiki.lazarus.freepascal.org/Creating_a_Backtrace_with_GDB#Very_short_how-to |
|
There is a gdb stack trace at the issue description. Is is missing something? |
|
Alfred's patch in the related 0036959 effectively prevents calling inherited Destroy in TExternalTools.Destroy. TExternalTools is a container of threads. Why would it fix the SIGSEGV which happened much earlier when synchronizing individual TExternalTool threads. I created a new patch against Lazarus trunk that only comments out the inherited Destroy, although it makes no sense. Please test. We would also need a fresh debugger stacktrace from Lazarus trunk. The line numbers in the original stacktrace do not match. 0001-Dont-call-inherited-from-TExternalTools.Destroy.patch (695 bytes)
From 8c90e1b8231706ae7df4a50bb2ccf1c34334c9c7 Mon Sep 17 00:00:00 2001 From: Juha <juha.manninen62@gmail.com> Date: Sat, 2 May 2020 10:12:18 +0300 Subject: [PATCH] Don't call inherited from TExternalTools.Destroy. --- ide/exttools.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ide/exttools.pas b/ide/exttools.pas index c4895feab..4b7b4f588 100644 --- a/ide/exttools.pas +++ b/ide/exttools.pas @@ -1221,7 +1221,7 @@ begin try if fRunning.Count>0 then raise Exception.Create('TExternalTools.Destroy some tools still running'); - inherited Destroy; + //inherited Destroy; FreeAndNil(fRunning); FreeAndNil(fParsers); finally -- 2.26.2 |
|
Hi Juha, Without using your latest patch, I have tried to reproduce the error without success. Using a script to use lazbuild to compile lazpaint for 50 times in a row caused no problems at all. I am using FPC trunk and Lazarus trunk. Will keep trying to reproduce. Edit: After 72 runs, I got THE error again. Will now try your patch. |
|
I found a suspect where a freed Tools collection could affect: procedure TExternalTool.WaitForExit; It has inside a loop : if MyTools.IndexOf(Self)<0 then exit; However WaitForExit was not in the stacktrace. I increased Sleep() time there to 50ms. I don't know if it makes reproducing the bug easier or more difficult. You can try smaller values in your tests. I have also added DebugLn() calls around. |
|
Please test with r64005. See related 0037883. |
|
Will do ! |
|
Testing done. Results of building lazpaint with lazbuild (as before). With Sleep(1): not a single crash. Tested 100 times. Without Sleep(1): 75 crashes out of 100 builds. With ThreadSwitch: 70 crashes out of 100 builds. Conclusions. Sleep(1) solves all problems. Its not only the context-switching of sleep() itself: The 1ms delay itself seems to be very important also. So, please add Sleep(1), also in fixes. Thanks. |
|
Great! Sorry what is ThreadSwitch exactly? Do you know why Sleep(1) and the delay are important? I cannot figure out any reason. |
|
ThreadSwitch: https://www.freepascal.org/docs-html/rtl/system/threadswitch.html I was just researching the possibility that only context switching was necessary. With little hope, due to the fact that it was reported that Sleep(0) did not work. This is a LONG standing bug that has been solved by adding Sleep(1). I am happy with it. The code for using multi-threaded external tools in "ideexterntoolintf.pas" is very complex. Its hard to understand the execution-flow of this code. I have no time to dive deep into it. And again, I am very happy with the fix that solves 3 years of random crashed (reported by many users of fpcupdeluxe) when using lazbuild. |
|
Now it is in fixes 2.0 branch, too. Resolving finally ... |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-11-15 22:52 | Abou Al Montacir | New Issue | |
2019-11-15 22:52 | Abou Al Montacir | File Added: lazbuild-crash.log | |
2019-11-15 22:54 | Abou Al Montacir | Description Updated | View Revisions |
2019-11-15 22:54 | Abou Al Montacir | LazTarget | => - |
2019-11-16 06:35 | Alfred | Note Added: 0119335 | |
2019-11-16 07:31 | Juha Manninen | Relationship added | related to 0032340 |
2019-11-16 07:42 | Juha Manninen | Relationship added | related to 0028448 |
2019-11-16 08:34 | Anton Kavalenka | Note Added: 0119336 | |
2019-11-16 11:52 | Abou Al Montacir | File Added: Fix-lazbuild-random-crash.patch | |
2019-11-16 11:52 | Abou Al Montacir | Note Added: 0119339 | |
2019-11-16 12:19 | Abou Al Montacir | Note Added: 0119340 | |
2019-11-17 11:04 | Juha Manninen | Note Added: 0119356 | |
2019-11-17 11:05 | Juha Manninen | Note Edited: 0119356 | View Revisions |
2019-11-17 11:05 | Juha Manninen | Note Edited: 0119356 | View Revisions |
2019-11-21 09:37 | Alfred | Note Added: 0119413 | |
2020-04-01 13:46 | Juha Manninen | Note Added: 0121831 | |
2020-04-01 20:14 | Alfred | Note Added: 0121833 | |
2020-04-02 11:30 | Juha Manninen | Note Added: 0121838 | |
2020-04-02 11:31 | Juha Manninen | Note Edited: 0121838 | View Revisions |
2020-04-02 11:33 | Juha Manninen | Status | new => feedback |
2020-04-02 11:38 | Juha Manninen | Note Edited: 0121838 | View Revisions |
2020-04-03 05:22 | Alfred | Note Added: 0121852 | |
2020-04-03 05:27 | Alfred | File Added: lazpatch_useride.patch | |
2020-04-03 05:27 | Alfred | Note Added: 0121853 | |
2020-04-03 05:29 | Alfred | Note Added: 0121854 | |
2020-04-19 20:24 | Abou Al Montacir | Note Added: 0122260 | |
2020-04-19 20:24 | Abou Al Montacir | Status | feedback => new |
2020-04-22 18:11 | Alfred | Note Added: 0122338 | |
2020-04-23 07:15 | Alfred | Note Added: 0122348 | |
2020-04-23 08:11 | Alfred | Note Added: 0122349 | |
2020-04-23 23:53 | Maxim Ganetsky | Relationship added | related to 0036959 |
2020-04-25 09:36 | Juha Manninen | Note Added: 0122399 | |
2020-04-25 09:36 | Juha Manninen | Note Edited: 0122399 | View Revisions |
2020-04-25 10:47 | Alfred | Note Added: 0122403 | |
2020-04-25 11:59 | Juha Manninen | Assigned To | => Juha Manninen |
2020-04-25 11:59 | Juha Manninen | Status | new => feedback |
2020-04-25 11:59 | Juha Manninen | Note Added: 0122406 | |
2020-04-25 12:10 | Juha Manninen | Note Edited: 0122406 | View Revisions |
2020-04-25 12:11 | Alfred | Note Added: 0122408 | |
2020-04-25 13:47 | Mattias Gaertner | Note Added: 0122410 | |
2020-04-25 14:09 | Mattias Gaertner | Note Added: 0122412 | |
2020-04-25 14:14 | Mattias Gaertner | Note Added: 0122413 | |
2020-04-25 14:57 | Alfred | Note Added: 0122414 | |
2020-04-25 14:57 | Alfred | File Added: lazbuildcrash01.JPG | |
2020-04-25 17:45 | Juha Manninen | Note Added: 0122419 | |
2020-04-25 19:23 | Alfred | Note Added: 0122424 | |
2020-04-25 19:23 | Alfred | File Added: lazbuildcrash02.JPG | |
2020-04-25 20:44 | Juha Manninen | Note Added: 0122428 | |
2020-04-25 20:46 | Juha Manninen | Note Edited: 0122428 | View Revisions |
2020-04-26 09:33 | Juha Manninen | Note Added: 0122436 | |
2020-04-26 10:08 | Mattias Gaertner | Note Added: 0122437 | |
2020-04-26 10:27 | Juha Manninen | Note Edited: 0122436 | View Revisions |
2020-04-26 15:06 | Alfred | Note Added: 0122448 | |
2020-04-26 20:46 | Mattias Gaertner | Note Added: 0122456 | |
2020-04-27 19:25 | Abou Al Montacir | Note Added: 0122472 | |
2020-04-27 19:25 | Abou Al Montacir | Status | feedback => assigned |
2020-05-02 09:21 | Juha Manninen | Note Added: 0122594 | |
2020-05-02 09:21 | Juha Manninen | File Added: 0001-Dont-call-inherited-from-TExternalTools.Destroy.patch | |
2020-05-02 09:22 | Juha Manninen | Note Edited: 0122594 | View Revisions |
2020-05-02 11:45 | Juha Manninen | Note Edited: 0122594 | View Revisions |
2020-05-02 11:52 | Juha Manninen | Note Edited: 0122594 | View Revisions |
2020-05-02 19:02 | Alfred | Note Added: 0122601 | |
2020-05-02 20:21 | Alfred | Note Edited: 0122601 | View Revisions |
2020-05-02 20:27 | Juha Manninen | Note Added: 0122603 | |
2020-05-02 20:29 | Juha Manninen | Note Edited: 0122603 | View Revisions |
2020-06-06 11:00 | Juha Manninen | Relationship added | related to 0037179 |
2020-10-15 01:18 | Juha Manninen | Relationship added | related to 0037883 |
2020-10-15 02:15 | Juha Manninen | Status | assigned => feedback |
2020-10-15 02:15 | Juha Manninen | Note Added: 0126317 | |
2020-10-15 07:50 | Alfred | Note Added: 0126321 | |
2020-10-15 13:00 | Alfred | Note Added: 0126325 | |
2020-10-15 14:04 | Juha Manninen | Note Added: 0126328 | |
2020-10-15 14:12 | Alfred | Note Added: 0126333 | |
2020-10-15 21:24 | Juha Manninen | Status | feedback => resolved |
2020-10-15 21:24 | Juha Manninen | Resolution | open => fixed |
2020-10-15 21:24 | Juha Manninen | Fixed in Revision | => r64005 |
2020-10-15 21:24 | Juha Manninen | Note Added: 0126336 |