[compiler-rt] r185150 - [sanitizer] Disable all ptrace-related definitions on Android.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Thu Jul 4 01:39:20 PDT 2013
Looks good.
On Thu, Jul 4, 2013 at 12:58 AM, Hal Finkel <hfinkel at anl.gov> wrote:
> Evgeniy,
>
> Investigating this further, user_regs_struct, user_fpregs_struct, PTRACE_GETFPXREGS and PTRACE_SETFPXREGS are x86-specific. Other architectures have different structures (and ptrace opcodes). In fact, if you look in lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc at void StopTheWorld(...), you'll see conditional compilation in this regard for ARM, PPC64, etc. which use a structure called pt_regs.
>
> I've attached a small patch which disables this ptrace code on non-x86 architectures. What do you think?
>
> Thanks again,
> Hal
>
> ----- Original Message -----
>> I think it is simply missing from Android NDK headers, and everyone
>> brings their own copy.
>> I wonder if it is the same on PPC64.
>>
>> On Tue, Jul 2, 2013 at 11:01 PM, Hal Finkel <hfinkel at anl.gov> wrote:
>> > ----- Original Message -----
>> >> Author: eugenis
>> >> Date: Fri Jun 28 09:18:10 2013
>> >> New Revision: 185150
>> >>
>> >> URL: http://llvm.org/viewvc/llvm-project?rev=185150&view=rev
>> >> Log:
>> >> [sanitizer] Disable all ptrace-related definitions on Android.
>> >
>> > Is this because user_regs_struct is x86-specific? It does not seem
>> > to exist on PPC64/Linux.
>> >
>> > -Hal
>> >
>> >>
>> >> Modified:
>> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
>> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
>> >>
>> >> Modified:
>> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
>> >> URL:
>> >> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc?rev=185150&r1=185149&r2=185150&view=diff
>> >> ==============================================================================
>> >> ---
>> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
>> >> (original)
>> >> +++
>> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
>> >> Fri Jun 28 09:18:10 2013
>> >> @@ -43,7 +43,6 @@
>> >> #include <sys/mount.h>
>> >> #include <sys/ptrace.h>
>> >> #include <sys/sysinfo.h>
>> >> -#include <sys/user.h>
>> >> #include <sys/vt.h>
>> >> #include <linux/cdrom.h>
>> >> #include <linux/fd.h>
>> >> @@ -66,6 +65,7 @@
>> >> #include <scsi/scsi.h>
>> >> #include <sys/mtio.h>
>> >> #include <sys/kd.h>
>> >> +#include <sys/user.h>
>> >> #include <linux/cyclades.h>
>> >> #include <linux/if_eql.h>
>> >> #include <linux/if_plip.h>
>> >> @@ -162,7 +162,7 @@ namespace __sanitizer {
>> >> return 0;
>> >> }
>> >>
>> >> -#if SANITIZER_LINUX
>> >> +#if SANITIZER_LINUX && !SANITIZER_ANDROID
>> >> unsigned struct_user_regs_struct_sz = sizeof(struct
>> >> user_regs_struct);
>> >> unsigned struct_user_fpregs_struct_sz = sizeof(struct
>> >> user_fpregs_struct);
>> >> #if __WORDSIZE == 64
>> >>
>> >> Modified:
>> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
>> >> URL:
>> >> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h?rev=185150&r1=185149&r2=185150&view=diff
>> >> ==============================================================================
>> >> ---
>> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
>> >> (original)
>> >> +++
>> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
>> >> Fri Jun 28 09:18:10 2013
>> >> @@ -180,7 +180,7 @@ namespace __sanitizer {
>> >> char **h_addr_list;
>> >> };
>> >>
>> >> -#if SANITIZER_LINUX
>> >> +#if SANITIZER_LINUX && !SANITIZER_ANDROID
>> >> extern unsigned struct_user_regs_struct_sz;
>> >> extern unsigned struct_user_fpregs_struct_sz;
>> >> extern unsigned struct_user_fpxregs_struct_sz;
>> >>
>> >>
>> >> _______________________________________________
>> >> llvm-commits mailing list
>> >> llvm-commits at cs.uiuc.edu
>> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> >>
>> >
>> > --
>> > Hal Finkel
>> > Assistant Computational Scientist
>> > Leadership Computing Facility
>> > Argonne National Laboratory
>>
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
More information about the llvm-commits
mailing list