tags 581731 confirmed kthxbye On sab, mag 15, 2010 at 01:26:02 +0200, Goswin von Brederlow wrote: > Package: valgrind > Version: 1:3.5.0-3 > Severity: normal > > Hi, > > I'm trying to track down uninitialized memory in some code so I > would like it to have some nice recognisable values. Luckily valgrind > has an option to initialize malloced memory, --malloc-fill. But trying > to use it I always get this error: > > % valgrind --malloc-fill=0xcafebabe /bin/sh > valgrind: Bad option '--malloc-fill=0xcafebabe'; aborting. > valgrind: Use --help for more information. > > This error is misleading. What it actualy tries to tell me is that > --malloc-fill expects a ONE BYTE hex constant. It should say something > like: > > valgrind: Value out of range '--malloc-fill=0xcafebabe'; aborting.
AFAICT if you only pass --malloc-fill=0xcafe it says:
> valgrind: Bad option: --malloc-fill=0xcafe
> valgrind: '--malloc-fill' argument must be between 0 and 255
But I don't know why it doesn't with 4 bytes. I'll look into this.
> Even better would be if it would accept 1, 2, 4 and 8 byte constants.
I don't think this would make much sense. AFAICT the current implementation
uses memset to replace the memory byte-by-byte, so it wouldn't make sense to
replace 1 byte with 2, 4 or 8 bytes.
Cheers
--
perl -E '$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'
signature.asc
Description: Digital signature

