Jeff King <peff@xxxxxxxx> writes: > I don't offhand know of a good portable way to ask the system about > available libraries. But I guess just doing something like: > > err=$(LD_PRELOAD=libc_malloc.so.0 git version 2>&1 >/dev/null) > if test -z "$err" > then > ...seemed to work... > fi > > would do it? I do not necessarily view it as "asking the system about available libraries"; we are checking if we can sensibly run things with this set to LD_PRELOAD. And presumably the answer was "no" in the original report, so it is a very direct way to ensure that we are setting it to a sensible value. I like it. The above did not work for me until I did "s/malloc/&_debug/" on the command line. At this point in the start-up sequence in the test framework, we should be able to run "git" from the PATH just fine, so it would be a good way to check if we can trigger the malloc check with the way how we expect to be able to trigger it. Thanks.