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

Re: RFS: failmalloc



Jonathan Nieder wrote:

> --- a/debian/scripts/failmalloc
> +++ b/debian/scripts/failmalloc
> @@ -1,11 +1,11 @@
>  #!/bin/bash
>  
>  usage () {
> -cat - >&2 <<EOF
> +cat >&2 <<EOF
>  failmalloc, memory allocation failure crash-test tool.
>     usage: failmalloc [-p|--probability probability] [-t|--times times]
>                       [-i|--interval interval] [-s|--space space]
> -		     [-h|--help] [-v|--version]
> +                     [-h|--help] [-v|--version]
>                       -- [command]
>  EOF
>    exit 1
> @@ -29,25 +29,26 @@ if test "$?" -ne 0; then
>    usage
>  fi
>  
> -FAIL_COMMAND="LD_PRELOAD=/usr/lib/libfailmalloc.so "
> +LD_PRELOAD="/usr/lib/libfailmalloc.so${LD_PRELOAD:+ $LD_PRELOAD}"
> +export LD_PRELOAD

Agh, setting LD_PRELOAD this early is asking for trouble; for
example, "failmalloc -v" would be likely to fail when 'cat' tries
to allocate memory.

Sorry for the nonsense.  Hopefully the idea is clear, anyway.


Reply to: