Error when debugging programs on Linux with Lazarus version 3.0.0 lazarus / 21-General ---------------------------------------------------------------------- esdonis · 2024-01-11 16:32 The following procedure up to the previous version of Lazarus 2.2.6 works ok. But now in Linux when I run the program from the IDE it tells me that I have another application running and for this reason it doesn't let me debug the program. But it compiles well for me. And if I run the compiled program, it works ok. The problem is that it doesn't let me debug the program and I can't find what the problem could be. procedure Tdmm.DataModuleCreate(Sender: TObject); var   x: THandle; begin   strVal:='';   struser := '';   {$IFDEF UNIX}       x := FileOpen(ParamStr(0), fmOpenRead or fmShareExclusive);       if (x <> -1) then        IniSis()       else begin    Application.MessageBox('Ya existe en ejecusión una instancia de la aplicación.', pchar(Application.Title), 0);    Application.Terminate;     end;   {$ELSE}    x := Crea]"]>Blockedtex(nil, False, 'SisConGeAFT');         if WaitForSingleObject(x, 0) <> wait_Timeout then       IniSis()    else         Application.Terminate;   {$ENDIF} end; ---------------------------------------------------------------------- Martin_fr · 2024-01-11 17:19 It could be the file is opened by the debugger. 1) Try with "external debug info" (in project options). 2) Tools > Options > Debugger Backend: Switch to gdb. ---------------------------------------------------------------------- esdonis · 2024-01-11 20:44 Perfect, works ok Thank you ---------------------------------------------------------------------- Martin_fr · 2024-01-11 21:09 Out of interest, which of the two worked? ---------------------------------------------------------------------- Martin_fr · 2024-01-11 21:12 Btw, if I understand your code correct: You prevent double execution by opening the exe itself with Exclusive access. 1) That may not work on all OS - but I don't know 2) A user can just make a copy of the exe, and start that.