Hello community, here is the log from the commit of package itrace checked in at Tue May 9 00:34:04 CEST 2006. -------- --- arch/ppc/itrace/itrace.changes 2006-04-20 08:53:35.000000000 +0200 +++ STABLE/itrace/itrace.changes 2006-05-04 08:49:55.000000000 +0200 @@ -1,0 +2,5 @@ +Thu May 4 08:48:49 CEST 2006 - olh@suse.de + +- fix wrong use of %p (172541 - LTC23597) + +------------------------------------------------------------------- New: ---- itrace-post-main.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ itrace.spec ++++++ --- /var/tmp/diff_new_pack.PDcCkP/_old 2006-05-09 00:33:56.000000000 +0200 +++ /var/tmp/diff_new_pack.PDcCkP/_new 2006-05-09 00:33:56.000000000 +0200 @@ -12,7 +12,7 @@ Name: itrace Version: 0.9 -Release: 6 +Release: 9 BuildRequires: kernel-source kernel-syms %ifarch ppc64 BuildRequires: glibc-devel-32bit @@ -27,6 +27,7 @@ Patch1: itrace-0.9.modprobe.patch Patch2: itrace-0.9.m32.patch Patch3: itrace-dotsym.patch +Patch4: itrace-post-main.patch ExclusiveArch: ppc ppc64 Requires: itrace-kmp-ppc64 %suse_kernel_module_package kdump um xen xenpae default smp debug bigsmp iseries64 @@ -80,6 +81,7 @@ %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build autoreconf -i --force @@ -126,6 +128,8 @@ %{_mandir}/*/* %changelog -n itrace +* Thu May 04 2006 - olh@suse.de +- fix wrong use of %%p (172541 - LTC23597) * Thu Apr 20 2006 - olh@suse.de - handle symbol changes in ELF64 (166171 - LTC23205) * Tue Apr 11 2006 - olh@suse.de ++++++ itrace-post-main.patch ++++++ Bug 172541 - ITrace post processing program gets segmentation fault Under certain conditions, the ITrace post-processing program, 'post', will seg fault. I've determined that the cause of this is improper use of %p format in several fprintf calls. The format was being used with a uint64 argument, but when the post program is compiled as 32-bit, the %p format is interpreted as a 32-bit pointer. In certain cases, this misuse would cause corruption of the processes memory, resulting in a segmentation fault. --- src/post/main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) Index: itrace_ppc64-0.9/src/post/main.c =================================================================== --- itrace_ppc64-0.9.orig/src/post/main.c +++ itrace_ppc64-0.9/src/post/main.c @@ -771,6 +771,7 @@ void a2ntest(void) int pid; char mnm[100]; uint64 addr; //STJ64 + unsigned int *paddr = (unsigned int *)&addr; int size, rc; SYMDATA sd; SYMDATA * sdp = &sd; @@ -799,7 +800,7 @@ void a2ntest(void) OptMsg("\n *** JIT load Data\n"); OptMsg(" JIT load Data\n"); OptVMsg(" pid %x\n", pid); - OptVMsg(" stt_addr %p\n", addr); + OptVMsg(" stt_addr %08x%08x\n", paddr[0],paddr[1]); OptVMsg(" size %x\n", size); strcpy(mnm, "java/sun/io/writeByte(int c)Z;"); @@ -1802,7 +1803,8 @@ int count_inst(uint64 too, int bytes, SY { if (gv.showss == 1) { - fprintf(gd.arc, " %8s %p %s\n", "ss:", too, " :: 0 icnt"); + unsigned int *p = (unsigned int *)&too; + fprintf(gd.arc, " %8s %08x%08x %s\n", "ss:", p[0], p[1], " :: 0 icnt"); } } @@ -2431,8 +2433,12 @@ void call_flow(trace_t * tr) // show rc fr too sym_addr if (gv.db == 4) { - fprintf(gd.arc, " ## code %p rc %d symaddr %p fr %p too %p\n", - sd.code, rc, sd.sym_addr, fr, too); + unsigned int *paddr_sym = (unsigned int *)&sd.sym_addr; + unsigned int *paddr_from = (unsigned int *)&fr; + unsigned int *paddr_too = (unsigned int *)&too; + fprintf(gd.arc, " ## code %p rc %d symaddr %08x%08x fr %08x%08x too %08x%08x\n", + sd.code, rc, paddr_sym[0], paddr_sym[1], + paddr_from[0], paddr_from[1], paddr_too[0], paddr_too[1]); } } tcnt = dcnt; // pick trace cnt instead of disasm cont ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de