--- Begin Message ---
From: CAI Qian <[email protected]>
Subject: Re: ptrace06 is not being compiled (temporary fix)
Date: Fri, 15 May 2009 22:08:43 +0800 (CST)

> From: rohit verma <[email protected]>
> Subject: ptrace06 is not being compiled (temporary fix)
> Date: Fri, 15 May 2009 14:17:15 +0530
> 
>> Hi,
>> PFA the patch which can be a possible solution to the compilation problems
>> that you had mentioned about regarding the ptrace06 compilation on PPC64 and
>> IA-64. I haven't tested on PPC64 and IA-64 as I do not have access to them.
>> Let me know if it work fine, and can be integrated into the LTP tree.
>> 
>> link to mailing list entry --
>> 
>> http://www.nabble.com/ptrace06-is-not-being-compiled-td23035203.html#a23328058
>> 
>> Regards,
>> rohit
>> 
>> 
> 
> I have no access to PPC64 and IA-64 machines at the moment either. I am
> going to test this patch next Monday.
>

PPC64 is fine now, but still have problem on IA-64.

# uname -r
2.6.18-128.el5

# rpm -q glibc
glibc-2.5-34

# make
cc -I../../../../include -Wall    ptrace01.c  -L../../../../lib -lltp -o 
ptrace01
cc -I../../../../include -Wall    ptrace02.c  -L../../../../lib -lltp -o 
ptrace02
cc -I../../../../include -Wall    ptrace03.c  -L../../../../lib -lltp -o 
ptrace03
cc -I../../../../include -Wall    ptrace04.c  -L../../../../lib -lltp -o 
ptrace04
cc -I../../../../include -Wall    ptrace06.c  -L../../../../lib -lltp -o 
ptrace06
In file included from /usr/include/asm/ptrace.h:58,
                 from /usr/include/linux/ptrace.h:49,
                 from ptrace06.c:20:
/usr/include/asm/fpu.h:57: error: redefinition of ‘struct ia64_fpreg'
In file included from /usr/include/linux/ptrace.h:49,
                 from ptrace06.c:20:
/usr/include/asm/ptrace.h:208: error: redefinition of ‘struct pt_all_user_regs'
make: *** [ptrace06] Error 1

However, if I remove those two lines,

- #include <linux/ptrace.h>
- #include <asm/ptrace.h>

it works fine here, but it will skip a lot of tests here,

#ifdef PTRACE_GETREGS
        {
        PTRACE_GETREGS,.data = 0}, {
        PTRACE_GETREGS,.data = 1}, {
        PTRACE_GETREGS,.data = 2}, {
        PTRACE_GETREGS,.data = 3}, {
        PTRACE_GETREGS,.data = -1}, {
        PTRACE_GETREGS,.data = -2}, {
        PTRACE_GETREGS,.data = -3}, {
        PTRACE_GETREGS,.data = -4},
#endif
#ifdef PTRACE_GETFGREGS
        {
        PTRACE_GETFGREGS,.data = 0}, {
        PTRACE_GETFGREGS,.data = 1}, {
        PTRACE_GETFGREGS,.data = 2}, {
        PTRACE_GETFGREGS,.data = 3}, {
        PTRACE_GETFGREGS,.data = -1}, {
        PTRACE_GETFGREGS,.data = -2}, {
        PTRACE_GETFGREGS,.data = -3}, {
        PTRACE_GETFGREGS,.data = -4},
#endif
#ifdef PTRACE_SETREGS
        {
        PTRACE_SETREGS,.data = 0}, {
        PTRACE_SETREGS,.data = 1}, {
        PTRACE_SETREGS,.data = 2}, {
        PTRACE_SETREGS,.data = 3}, {
        PTRACE_SETREGS,.data = -1}, {
        PTRACE_SETREGS,.data = -2}, {
        PTRACE_SETREGS,.data = -3}, {
        PTRACE_SETREGS,.data = -4},
#endif
#ifdef PTRACE_SETFGREGS
        {
        PTRACE_SETFGREGS,.data = 0}, {
        PTRACE_SETFGREGS,.data = 1}, {
        PTRACE_SETFGREGS,.data = 2}, {
        PTRACE_SETFGREGS,.data = 3}, {
        PTRACE_SETFGREGS,.data = -1}, {
        PTRACE_SETFGREGS,.data = -2}, {
        PTRACE_SETFGREGS,.data = -3}, {
        PTRACE_SETFGREGS,.data = -4},
#endif

In addition, some tests are failed for me on RHEL5 x86_64,

...
ptrace06   57  FAIL  :  ptrace(SETREGS, ..., (nil), (nil)) returned 0 instead 
of -1
ptrace06   58  FAIL  :  ptrace(SETREGS, ..., (nil), 0x1) returned 0 instead of 
-1
ptrace06   59  FAIL  :  ptrace(SETREGS, ..., (nil), 0x2) returned 0 instead of 
-1
ptrace06   60  FAIL  :  ptrace(SETREGS, ..., (nil), 0x3) returned 0 instead of 
-1
...

But that might be actually a bug for kernels.,

# strace ./ptrace06
...
ptrace(PTRACE_SETREGS, 22834, 0, 0)     = 0
ptrace(PTRACE_SETREGS, 22834, 0, 0x1)   = 0
ptrace(PTRACE_SETREGS, 22834, 0, 0x2)   = 0
ptrace(PTRACE_SETREGS, 22834, 0, 0x3)   = 0
...

Fedora IA-32 kernel returns those,

# uname -r
2.6.27.5-117.fc10.i686

...
ptrace(PTRACE_SETREGS, 5799, 0, 0)      = -1 EFAULT (Bad address)
ptrace(PTRACE_SETREGS, 5799, 0, 0x1)    = -1 EFAULT (Bad address)
ptrace(PTRACE_SETREGS, 5799, 0, 0x2)    = -1 EFAULT (Bad address)
ptrace(PTRACE_SETREGS, 5799, 0, 0x3)    = -1 EFAULT (Bad address)
...

CAI Qian

--- End Message ---
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to