Bug 773050

Summary: ltrace source code compiling gives more failures
Product: [Fedora] Fedora Reporter: IBM Bug Proxy <bugproxy>
Component: ltraceAssignee: Petr Machata <pmachata>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 16CC: jkachuck, mnewsome, pmachata, wgomerin
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-08 16:35:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
32bit log
none
64bit test result
none
[PATCH] Check return value of PTRACE_PEEKTEXT for ppc64
none
make -k check file for ltrace in 32 bit
none
make -k check file for ltrace in 64 bit
none
make -k check file for ltrace in 32 bit
none
make -k check file for ltrace in 64 bit none

Description IBM Bug Proxy 2012-01-10 19:04:09 UTC
I redid ltrace source code compiling for Fedora Alpha release. I found the following for 32 bit and 64 bit compiling, there are many failures espetially on 64bit/ I sent the results to the developer Thiago and open this bug to track this issue. See attachments for detail logs.

32bit:

                ===  Summary ===

# of expected passes            84
# of unexpected failures        5
make[4]: *** [check-DEJAGNU] Error 1
make[4]: Leaving directory `/root/rpmbuild/BUILD/ltrace-0.6.0/testsuite'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/root/rpmbuild/BUILD/ltrace-0.6.0/testsuite'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/root/rpmbuild/BUILD/ltrace-0.6.0/testsuite'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/root/rpmbuild/BUILD/ltrace-0.6.0/testsuite'
make: *** [check-recursive] Error 1



64bit:

                ===  Summary ===

# of expected passes            36
# of unexpected failures        53
make[4]: *** [check-DEJAGNU] Error 1
make[4]: Leaving directory `/root/rpmbuild/BUILD/ltrace-0.6.0/testsuite'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/root/rpmbuild/BUILD/ltrace-0.6.0/testsuite'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/root/rpmbuild/BUILD/ltrace-0.6.0/testsuite'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/root/rpmbuild/BUILD/ltrace-0.6.0/testsuite'
make: *** [check-recursive] Error 1


[PATCH] Check return value of PTRACE_PEEKTEXT for ppc64

ltrace wasn't checking the return value of a PTRACE_PEEKTEXT call on ppc64 and it was including a breakpoint at a wrong address. This was a bug existing also on upstream code:

This patch fixes mostly of the failures on ppc64, reducing the number of failures to 9 on upstream ltrace:

# of expected passes            88
# of unexpected failures        9

I've sent this patch to the ltrace-devel mailing list and now I'm waiting for some feedback from the developers:

http://lists.alioth.debian.org/pipermail/ltrace-devel/2011-December/000538.html

The ltrace maintainer has already replied my message in the mailing list, mentioning that the patch will be included upstream soon.

http://lists.alioth.debian.org/pipermail/ltrace-devel/2011-December/000539.html

Comment 1 IBM Bug Proxy 2012-01-10 19:04:21 UTC
Created attachment 551913 [details]
32bit log

Comment 2 IBM Bug Proxy 2012-01-10 19:04:33 UTC
Created attachment 551914 [details]
64bit test result

Comment 3 IBM Bug Proxy 2012-01-10 19:04:41 UTC
Created attachment 551915 [details]
[PATCH] Check return value of PTRACE_PEEKTEXT for ppc64

Comment 4 Petr Machata 2012-01-13 18:57:45 UTC
Thanks.  I was the person promising to apply the patch, but it appears that ltrace on ppc is still rather broken.  The patch makes the situation less bad, but we still frequently miss return from a function, and sometimes fail to trace any functions at all.  I'm working on fixing it all first.

Comment 5 IBM Bug Proxy 2012-02-03 19:41:23 UTC
------- Comment From emachado.ibm.com 2012-02-03 14:34 EDT-------
(In reply to comment #18)
> Thanks.  I was the person promising to apply the patch, but it appears that
> ltrace on ppc is still rather broken.  The patch makes the situation less bad,
> but we still frequently miss return from a function, and sometimes fail to
> trace any functions at all.  I'm working on fixing it all first.

Hi Petr,
any news regarding this issue against ppc? Please let me know if there is something I can do in order to help.
Thanks for your support.

Comment 6 Petr Machata 2012-02-07 17:42:25 UTC
I had a chance to look into this today and yesterday.  The reason your patch was necessary was that we were a bit impatient about doing ptraces over a process that wasn't ready yet.  There's now a safety latch on process start.  There are also several changes in the early process start that will hopefully make the whole scheme easier to understand and extend in future.  This fixes the first problem.  That's on pmachata/startup upstream branch, I'll port it back to RHEL6 when it's all done.

I'll now look into the second problem, viz. missing function returns, that is still present.

Comment 7 Petr Machata 2012-02-07 22:22:22 UTC
Ok, pmachata/startup upstream branch now mostly works, sans a couple failures in parameters.exp that probably have to do with some alignment issues.  I'll skip looking into those for now, as I have some other effort in this area that this would conflict this.

I didn't realize this was filed against Fedora, that reduces the porting effort to close to nil, so I'll be able to include these fixes really soon now.

Comment 8 Petr Machata 2012-02-08 16:35:04 UTC
One additional failing test is vfork on PPC64, that's caused by bug 753130.

I added the patch to F 16, F 17 and rawhide branches.  I don't suppose it's necessary to build this in mainstream Fedora, as the primary arches are not affected by this bug.  I'm going to close this now.  Feel free to reopen if necessary.

Comment 9 IBM Bug Proxy 2012-02-09 04:01:32 UTC
------- Comment From emachado.ibm.com 2012-02-08 22:58 EDT-------
Hi Petr,
I noticed your patches were already commited to upstream ltrace today. Thank you very much for working on this.

Comment 10 IBM Bug Proxy 2012-04-19 21:00:53 UTC
------- Comment From emachado.com 2012-04-19 20:59 EDT-------
Hi Petr,

I had the chance to rerun the testsuite on Fedora 17 (using ltrace-0.6.0-4.fc17.src.rpm) and still got bad results on ppc64:

# of expected passes            47
# of unexpected failures        50

It seems ltrace is still failing to collect most of the syscalls due to the problem previously mentioned with PTRACE_PEEKTEXT call.

I also checked the results from upstream ltrace and noticed they look much better:

# of expected passes            95
# of unexpected failures        10

Could you please take a look at this?

Thanks for your support.

Comment 11 Petr Machata 2012-04-20 00:10:05 UTC
Actually I spent about the last month fixing tracing on PPC.  The design of PLT tables on PPC doesn't make it easy to actually trace what we need to trace, viz calls to dynamic libraries.  In the past we've been tracing function entry points instead.

That work is on the branch pmachata/libs, because it was rolled into tracing of calls made from DSOs.  I intend to send a note upstream and merge soonish.

As of a couple hours ago, PPC64/PPC64 and PPC32/PPC32 test suite have one failure each, PPC64/PPC32 has one extra failure, and PPC32/PPC32BSS and PPC64/PPC32BSS have additional two failures each.  So there's some work left still, but overall we are in the best shape ever (BSS-style PPC32 PLT in particular has not been supported at all, or maybe had been, but it was lost along the way as we added support for new-style secure PLT).

A taste of tracing xclock on F16 PPC64 (edited to fit):

$ ./ltrace -e* xclock 
[...]
xclock->XCopyArea(0x18315380, 0x260000c, 0x260000b)             = 1
libXt.so.6->XEventsQueued(0x18315380, 1, 0x260000b <unfinished ...>
libX11.so.6->_XEventsQueued(0x18315380, 1, 0x260000b <unfinished ...>
libX11.so.6->xcb_poll_for_event(0x18316810, 1, 0x260000b <unfinished ...>
libxcb.so.1->pthread_mutex_lock(0x18316828, 1, 0x260000b)       = 0
libxcb.so.1->read(4, 0x18316884, 4096)                          = -1
libxcb.so.1->__errno_location(-1, 0x18316884, 4096)             = 0x80440ac7f0
libxcb.so.1->pthread_mutex_unlock(0x18316828, 0x18316884, 4096) = 0
<... xcb_poll_for_event resumed> )                              = 0
libX11.so.6->xcb_connection_has_error(0x18316810, 0, 0)         = 0
<... _XEventsQueued resumed> )                                  = 0
<... XEventsQueued resumed> )                                   = 0
[...]

I intend to update ltrace in F17 time frame with this patch set.  I will consider adding it to F16 as well, the tracing of DSO calls has been long missing.

Comment 12 Petr Machata 2012-04-20 00:52:14 UTC
(In reply to comment #10)
> I had the chance to rerun the testsuite on Fedora 17 (using
> ltrace-0.6.0-4.fc17.src.rpm) and still got bad results on ppc64:

I just noticed this.  That version doesn't have the necessary patches yet.  With recent ltrace, I get:

# of expected passes		90
# of unexpected failures	7

Unfortunately that ltrace version (ltrace-0.6.0-7) has been stuck in Fedora update system because I forgot to request a push.  I did that now.

Comment 13 IBM Bug Proxy 2012-04-20 01:50:41 UTC
------- Comment From emachado.com 2012-04-20 01:43 EDT-------
(In reply to comment #28)
> Unfortunately that ltrace version (ltrace-0.6.0-7) has been stuck in Fedora
> update system because I forgot to request a push.  I did that now.

Thanks again for your help, Petr. I'll retest this once the new version becomes available.

Comment 14 IBM Bug Proxy 2012-05-07 11:51:08 UTC
Created attachment 582630 [details]
make -k check file for ltrace in 32 bit


------- Comment (attachment only) From sanpatr1.com 2012-05-07 11:42 EDT-------

Comment 15 IBM Bug Proxy 2012-05-07 11:51:22 UTC
Created attachment 582631 [details]
make -k check file for ltrace in 64 bit


------- Comment (attachment only) From sanpatr1.com 2012-05-07 11:42 EDT-------

Comment 16 Petr Machata 2012-05-07 22:48:40 UTC
(In reply to comment #14)
(In reply to comment #15)
Those are GDB test runs.

Comment 17 IBM Bug Proxy 2012-05-08 06:56:26 UTC
Created attachment 582871 [details]
make -k check file for ltrace in 32 bit


------- Comment (attachment only) From sanpatr1.com 2012-05-08 06:44 EDT-------

Comment 18 IBM Bug Proxy 2012-05-08 06:56:37 UTC
Created attachment 582872 [details]
make -k check file for ltrace in 64 bit


------- Comment (attachment only) From sanpatr1.com 2012-05-08 06:44 EDT-------

Comment 19 Petr Machata 2012-05-11 20:48:23 UTC
(In reply to comment #18)
> Created attachment 582872 [details]
> make -k check file for ltrace in 64 bit
> 
> 
> ------- Comment (attachment only) From sanpatr1.com 2012-05-08 06:44
> EDT-------

This is much more broken than it should be.  Please provide configuration details and ltrace version so that I can reproduce and fix the issues.  Thanks.

Comment 20 IBM Bug Proxy 2012-05-14 11:41:08 UTC
------- Comment From emachado.com 2012-05-14 11:35 EDT-------
Hi Petr,

sorry for the confusion with the previous comments.

I had the chance to test ltrace-0.6.0-11.fc17 on Power and got the following results:

32-bit:
# of expected passes            94
# of unexpected failures        3

64-bit:
# of expected passes            92

which means the high number of failures was fixed on Fedora 17. Thus, I'm closing this bugzilla for now.

Thanks for your support.