tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Proposed update to bmake-20240711



On Sat, 13 Jul 2024 06:09:13 +0200, Roland Illig writes:
>> The test suite isn't 100% clean on macOS, but I think that this is
>> mostly due to output differences when using mksh:
>>
>>    https://gist.github.com/jperkin/a46993a5ee6b680fc7308087daf13f80
>
>The "Abort trap" and "exit status 134" cases look strange to me. Do you

134 is from the SIGABRT

>have a ktrace/strace or gdb backtrace available for that case? To run
>that test in isolation:

I don't have mksh on Darwin, on FreBSD with mksh as .SHELL shell-csh seg
faults due to:

frame #5: 0x000000000021a57c bmake`Job_ParseShell(line="name=\"csh\"
path=\"/bin/csh\"") at job.c:2500:3
   2497                         }
   2498                 }
   2499         } else {
-> 2500                 free(shellPath);

(lldb) p shellPath
(char *) 0x00000000002068b0 "/usr/local/bin/mksh"

does not look like a malloc'd string

Ok fix is

Index: job.c
===================================================================
RCS file: /volume/cvs/bmake/job.c,v
retrieving revision 1.173
diff -u -p -r1.173 job.c
--- job.c	7 Jul 2024 16:34:32 -0000	1.173
+++ job.c	13 Jul 2024 05:21:08 -0000
@@ -2156,7 +2156,7 @@ InitShellNameAndPath(void)
 	}
 #endif
 #ifdef DEFSHELL_PATH
-	shellPath = DEFSHELL_PATH;
+	shellPath = bmake_strdup(DEFSHELL_PATH);
 #else
 	shellPath = str_concat3(_PATH_DEFSHELLDIR, "/", shellName);
 #endif


Home | Main Index | Thread Index | Old Index