From 305d34a8f6fa2b873a5e0668210360e59a6d0a38 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 22 Jan 2023 22:19:52 +0100 Subject: [PATCH] Darwin: fix make cycle unix.fpexecv takes a rawbytestring as first parameter, so inside the child it was converting the pchar back to an ansistring and also converting it to the OS file system code page. Since Darwin uses vfork/execv in SysUtils.Executeprocess, this could result in (exception)stack corruption and for some reason only since d1b2fe16 it actually caused issues. Use execve instead, which takes a pchar as first argument and doesn't do any further conversions --- rtl/unix/sysutils.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtl/unix/sysutils.pp b/rtl/unix/sysutils.pp index 6fee73e4cc..65e7bdc2da 100644 --- a/rtl/unix/sysutils.pp +++ b/rtl/unix/sysutils.pp @@ -1583,7 +1583,7 @@ Begin if pid=0 then begin {The child does the actual exec, and then exits} - fpexecv(pchar(pointer(LPath)),Cmdline2); + fpexecve(pchar(pointer(LPath)),Cmdline2,envp); { If the execve fails, we return an exitvalue of 127, to let it be known} fpExit(127); end