Hello community, here is the log from the commit of package ltrace checked in at Wed May 31 02:52:16 CEST 2006. -------- --- ltrace/ltrace.changes 2006-05-18 13:03:26.000000000 +0200 +++ ltrace/ltrace.changes 2006-05-30 23:16:02.000000000 +0200 @@ -1,0 +2,5 @@ +Tue May 30 19:12:11 CEST 2006 - bk@suse.de + +- fix crash of every process traced with -p on ltrace exit (138568) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ltrace.spec ++++++ --- /var/tmp/diff_new_pack.vVQTdC/_old 2006-05-31 02:51:58.000000000 +0200 +++ /var/tmp/diff_new_pack.vVQTdC/_new 2006-05-31 02:51:58.000000000 +0200 @@ -17,7 +17,7 @@ Autoreqprov: on Summary: Trace the Library and System Calls a Program Makes Version: 0.3.36 -Release: 21 +Release: 22 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: ftp://ftp.debian.org/debian/pool/main/l/ltrace/%{name}_%{version}.orig.tar.gz Source1: ltrace-acl+xattr.conf @@ -70,7 +70,15 @@ %patch7 -p1 %patch8 -p1 %patch9 -p1 +# ltrace-fix_-p_bug.diff has a side effect which causes a regression +# for non-ppc archs. What it addresses works on all other archs +# and ltrace mainline does things better than this patch. This patch +# is only a kludge which only helps on ppc/ppc64, and even there, +# it's not getting it done as it should, and it hurts all others. +# See the header of the patch and bug 138568 for more information: +%ifarch ppc ppc64 %patch10 -p1 +%endif %patch11 %patch12 -p1 %patch13 @@ -105,6 +113,8 @@ %config /etc/ltrace.conf %changelog -n ltrace +* Tue May 30 2006 - bk@suse.de +- fix crash of every process traced with -p on ltrace exit (138568) * Thu May 18 2006 - olh@suse.de - update man page to ltrace 0.4 version (176209 - LTC23913) * Tue May 02 2006 - olh@suse.de ++++++ ltrace-fix_-p_bug.diff ++++++ --- /var/tmp/diff_new_pack.vVQTdC/_old 2006-05-31 02:51:58.000000000 +0200 +++ /var/tmp/diff_new_pack.vVQTdC/_new 2006-05-31 02:51:58.000000000 +0200 @@ -1,6 +1,49 @@ +An anonymous coward wrote: + This patch fixes a couple of problems with the '-p' option: break-points where not being inserted after attaching to the process. Now they are. +--- +Indeed they were, but the above it only true for ppc/ppc64. On all +other architecture, it was already done right and this patch caused +ltrace -p to crash other programs to which it attached with it +detaches after a Ctrl-C from this user. + +See https://bugzilla.novell.com/show_bug.cgi?id=138568 for more info. + +Detailed description follows: + +Unfortunately, with this patch as it was, breakpoints were enabled +twice. So when the user presses Ctrl-C or kills ltrace with SIGTERM, +not the original program code was restored at the breakpoint addresses, +but the saved breakpoint code from the last round of enabling breakpoints +was restored which means that the program was still breakpointed after +ltrace detached and this led to the program to crash as soon as it hit +a breakpoint. + +Also, enabling breakpoints this early has a bad side effect, +which causes that the SIGSTOPs which ltrace uses to modify +the process are shown: + +--- SIGSTOP (Stopped (signal)) --- +--- SIGSTOP (Stopped (signal)) --- + +This may also mean that the program may still be running when +ltrace enables the breakpoints, which does not follow the orignal +design of stopping the program while modifying it to be safe from +crashes because of doing things on-the-fly. + +To fix the crash after detach, you must correctly set +proc->breakpoints_enabled to 1 (breakpoints are now enabled) +and not keep it set at -1 which means that they should be still +enabled after they aready are. + +So this change makes this patch for ltrace -p work on ppc/ppc64 +work as it should, but I am not applying this on other architectures +because there, ltrace -p works fine without this patch and without +the side effect introduced by it. + +Bernhard Kaindl, bk@suse.de - 31 May 2006 ================================================================================ --- ltrace-0.3.36/ltrace.c @@ -51,5 +94,5 @@ - proc = open_program(filename); - proc->pid = pid; + proc = open_program(filename,pid); -+ proc->breakpoints_enabled = -1; ++ proc->breakpoints_enabled = 1; } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de