From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6745 invoked by alias); 5 Apr 2007 15:50:23 -0000 Received: (qmail 6735 invoked by uid 22791); 5 Apr 2007 15:50:22 -0000 X-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_20,SPF_HELO_PASS,SPF_PASS,TW_JB X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Apr 2007 16:50:15 +0100 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l35FoD31002304 for ; Thu, 5 Apr 2007 11:50:13 -0400 Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l35Fo7xN007247 for ; Thu, 5 Apr 2007 11:50:07 -0400 Received: from [10.34.32.30] (hridell.brq.redhat.com [10.34.32.30]) by pobox.stuttgart.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l35Fo6OH013677 for ; Thu, 5 Apr 2007 17:50:06 +0200 Message-ID: <46151AA8.4020401@redhat.com> Date: Thu, 05 Apr 2007 15:50:00 -0000 From: Petr Machata User-Agent: Thunderbird 1.5.0.10 (X11/20070302) MIME-Version: 1.0 To: frysk@sourceware.org Subject: A minor bug in slurp X-Enigmail-Version: 0.94.3.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigFD964A85C55F8B3EC84635A1" X-Virus-Checked: Checked by ClamAV on sourceware.org X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q2/txt/msg00012.txt.bz2 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFD964A85C55F8B3EC84635A1 Content-Type: multipart/mixed; boundary="------------070108080807020307080908" This is a multi-part message in MIME format. --------------070108080807020307080908 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 1102 Hi list, I found a minor bug in uslurp(int pid, const char* name). It doesn't append a NUL character. MapsBuilder.construct then throws an exception: Exception in thread "Thread-1" java.lang.RuntimeException: missing NUL at frysk.sys.proc.MapsBuilder.construct(fltrace) at frysk.sys.proc.MapsBuilder.construct(fltrace) at fltrace.updateAttached(fltrace) at frysk.proc.Task.notifyAttached(fltrace) at frysk.proc.LinuxPtraceTaskState$Attached.transitionToRunningState(fltrace) at frysk.proc.LinuxPtraceTaskState$StartMainTask$6.blockOrAttachContinue(fltra= ce) at frysk.proc.LinuxPtraceTaskState$StartMainTask$6.handleTrappedEvent(fltrace) at frysk.proc.Task.processTrappedEvent(fltrace) at frysk.proc.LinuxPtraceHost$PollWaitOnSigChld$5.stopped(fltrace) at frysk.sys.Wait.waitAllNoHang(fltrace) at frysk.proc.LinuxPtraceHost$PollWaitOnSigChld.execute(fltrace) at frysk.event.EventLoop.runEventLoop(fltrace) at frysk.event.EventLoop.run(fltrace) The attached patch fixes this problem, and introduces no regression. (Tested against fresh checkout.) Thanks, PM --------------070108080807020307080908 Content-Type: text/x-patch; name="frysk-slurp-pid.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="frysk-slurp-pid.patch" Content-length: 427 diff -u -r1.1 slurp.cxx --- frysk-imports/frysk/sys/proc/cni/slurp.cxx 8 Dec 2006 20:00:34 -0000 1.1 +++ frysk-imports/frysk/sys/proc/cni/slurp.cxx 5 Apr 2007 14:22:23 -0000 @@ -108,7 +108,7 @@ ::close(fd); =20 // Null terminate the buffer. - buf[current_offset] =3D '\0'; + buf[current_offset++] =3D '\0'; =20 jbyteArray jbuf =3D JvNewByteArray (current_offset); ::memcpy (elements (jbuf), buf, current_offset); --------------070108080807020307080908-- --------------enigFD964A85C55F8B3EC84635A1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 189 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGFRquT6tJy0SVQPIRAqHcAJ9ZkYbLKk4QKGM0EJG6deRQKJbSawCfeaYk KFGWLJ9xTo7fVDs33Jvzphs= =g8Bu -----END PGP SIGNATURE----- --------------enigFD964A85C55F8B3EC84635A1--