View Issue Details

IDProjectCategoryView StatusLast Update
0002607Double CommanderFile operationspublic2021-05-24 14:37
Reporterbbt Assigned ToAlexx2000  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
ProjectionnoneETAnone 
Product Version1.0.0 (trunk) 
Target Version1.0.0Fixed in Version1.0.0 
Summary0002607: Named pipes creation error in FreeBSD
DescriptionDouble Commander crashes at launch in FreeBSD if temp directory exists (for example if you try to open a second instance):

[FORMS.PP] ExceptionOccurred
  Sender=EIPCError
  Exception=Failed to create named pipe: /tmp/doublecmd-1001/doublecmd.pipe

I think the current code in upipeserver.pas is correct only for MacOS, the rest of the BSD family should use Xdg as Linux does.

I have attached a patch with the fix. Tested only under FreeBSD.
Steps To Reproduce1. Launch first instance of Double Commander.
2. Without deleting the temporary directory (/tmp/doublecmd-1001), launch a second instance of Double Commander. The second instance will fail with an unhandled exception. Does not matter if first instance is running still or not.
TagsNo tags attached.
Attached Files
upipeserver.patch (1,190 bytes)   
Index: src/platform/unix/upipeserver.pas
===================================================================
--- src/platform/unix/upipeserver.pas	(revision 9666)
+++ src/platform/unix/upipeserver.pas	(working copy)
@@ -32,7 +32,7 @@
 
 uses
   SimpleIPC, BaseUnix, uPollThread
-{$IF DEFINED(LINUX)}
+{$IF NOT DEFINED(DARWIN)}
   , uXdg
 {$ENDIF}
   ;
@@ -65,7 +65,7 @@
 
 function GetPipeFileName(const FileName: String; Global : Boolean): String;
 begin
-{$IF DEFINED(LINUX)}
+{$IF NOT DEFINED(DARWIN)}
   Result:= IncludeTrailingBackslash(GetUserRuntimeDir) + FileName;
 {$ELSE}
   Result:= GetTempDir(Global) + ApplicationName + '-' + IntToStr(fpGetUID) + PathDelim + FileName;
@@ -89,7 +89,7 @@
 end;
 
 constructor TPipeServerComm.Create(AOWner: TSimpleIPCServer);
-{$IF NOT DEFINED(LINUX)}
+{$IF DEFINED(DARWIN)}
 var
   Info: TStat;
   Directory: String;
@@ -101,7 +101,7 @@
     FFileName:= FFileName + '-' + IntToStr(fpGetPID);
   if FFileName[1] <> '/' then
     FFileName:= GetPipeFileName(FFileName, Owner.Global);
-{$IF NOT DEFINED(LINUX)}
+{$IF DEFINED(DARWIN)}
   // Verify directory owner
   Directory:= ExtractFileDir(FFileName);
   if not DirectoryExists(Directory) then
upipeserver.patch (1,190 bytes)   
Fixed in Revision9793
Operating systemBSD
Widgetset
Architecture

Activities

Issue History

Date Modified Username Field Change
2021-02-18 16:48 bbt New Issue
2021-02-18 16:48 bbt File Added: upipeserver.patch
2021-03-22 14:01 Alexx2000 Status new => acknowledged
2021-03-22 14:01 Alexx2000 Target Version => 1.0.0
2021-05-24 14:37 Alexx2000 Fixed in Revision => 9793
2021-05-24 14:37 Alexx2000 Status acknowledged => resolved
2021-05-24 14:37 Alexx2000 Fixed in Version => 1.0.0
2021-05-24 14:37 Alexx2000 Resolution open => fixed
2021-05-24 14:37 Alexx2000 Assigned To => Alexx2000