Bug 247510

Summary: [OS X 10.6] Memcheck reports unaddressable bytes passed to [f]chmod_extended
Product: [Developer tools] valgrind Reporter: Alexander Potapenko <glider>
Component: memcheckAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 3.6 SVN   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: macOS   
Latest Commit: Version Fixed In:

Description Alexander Potapenko 2010-08-12 13:58:38 UTC
$ cat copyfile.c
#include <copyfile.h>
#include <stdlib.h>

int main(int argc, char* argv[]) {
  copyfile(argv[0], "copy", NULL, COPYFILE_ALL);
  return 0;
}

  $ gcc copyfile.c -o copyfile
  $ valgrind ./copyfile

==57776== 
--57776-- /Users/glider/src/chmod/copyfile:
--57776-- dSYM directory is missing; consider using --dsymutil=yes
==57776== Syscall param chmod_extended(xsecurity) points to unaddressable byte(s)
==57776==    at 0x1000B158E: __chmod_extended (in /usr/lib/libSystem.B.dylib)
==57776==    by 0x1000B1308: chmodx_np (in /usr/lib/libSystem.B.dylib)
==57776==    by 0x1000B0871: copyfile (in /usr/lib/libSystem.B.dylib)
==57776==    by 0x100000F1F: main (in /Users/glider/src/chmod/copyfile)
==57776==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==57776== 
==57776== Syscall param fchmod_extended(xsecurity) points to unaddressable byte(s)
==57776==    at 0x1000B243A: __fchmod_extended (in /usr/lib/libSystem.B.dylib)
==57776==    by 0x1000B241F: fchmodx_np (in /usr/lib/libSystem.B.dylib)
==57776==    by 0x1000B21E4: copyfile_internal (in /usr/lib/libSystem.B.dylib)
==57776==    by 0x1000B10F8: copyfile (in /usr/lib/libSystem.B.dylib)
==57776==    by 0x100000F1F: main (in /Users/glider/src/chmod/copyfile)
==57776==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==57776==
Comment 1 Julian Seward 2010-10-07 17:38:23 UTC
Fixed, r11412.