Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Apr 2007 17:28:17 +0400 (MSD)
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/112118: [PATCH] sysutils/pipemeter: fix crashes
Message-ID:  <20070425132817.12E8C4098@hades.panopticon>
Resent-Message-ID: <200704251330.l3PDU99O027549@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         112118
>Category:       ports
>Synopsis:       [PATCH] sysutils/pipemeter: fix crashes
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 25 13:30:03 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 6.1-RELEASE-p12 i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 6.1-RELEASE-p12 FreeBSD 6.1-RELEASE-p12 #0: Tue Jan 16 23:12:21 MSK 2007 amdmi3@hades.panopticon:/usr/obj/usr/src/sys/HADES i386


>Description:
Pipemeter crashes after some data passes through it:

% pipemeter </dev/zero >/dev/null
[1]    44929 alarm      pipemeter < /dev/zero > /dev/null

Crash happens because sigaction structure is not filled with zeroes before usage, thus may not be repeatable in some cases (but it crashes under my pentium3, pentiom4 and celeron boxes). Attached patch fixes the crashes.

Patch also sent upstream some time ago, but I've got no response.

>How-To-Repeat:
pipemeter </dev/zero >/dev/null
>Fix:
--- pipemeter.patch begins here ---
diff -ruN pipemeter.orig/files/patch-pipemeter.c pipemeter/files/patch-pipemeter.c
--- pipemeter.orig/files/patch-pipemeter.c	Thu Jan  1 03:00:00 1970
+++ pipemeter/files/patch-pipemeter.c	Wed Apr 25 17:16:27 2007
@@ -0,0 +1,10 @@
+--- pipemeter.c.orig	Fri Nov 24 17:59:35 2006
++++ pipemeter.c	Fri Nov 24 18:00:55 2006
+@@ -236,6 +236,7 @@
+   progressfill[i]=PBRIGHT;
+   progressfill[i+1]='\0';
+   
++  memset(&sa, 0, sizeof(struct sigaction));
+   sa.sa_handler= filesize ? show_progress : show_just_rate;
+   sigaction(SIGTERM, &sa, &sa_orig);
+   sigaction(SIGINT,  &sa, &sa_orig);
--- pipemeter.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070425132817.12E8C4098>