[kernel] bug#32: marked as done (pipe test program causes hang)

PA-RISC Linux bug Tracking System daniel_frazier@hp.com
Fri, 16 Mar 2001 21:48:01 -0700 (MST)


X-PA-RISC Linux-PR-Message: closed 32

Your message dated Fri, 16 Mar 2001 21:40:43 -0700
with message-id <20010316214043.D3743@zumpano.fc.hp.com>
and subject line Fixed
has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

dann frazier
(administrator, PA-RISC Linux bugs database)

--------------------------------------
Received: (at submit) by bugs.parisc-linux.org; 22 Feb 2001 17:46:30 +0000
>From bame@fc.hp.com  Thu Feb 22 10:46:30 2001
Received: from atlrel2.hp.com (atlrel2.hp.com [156.153.255.202])
	by dsl2.external.hp.com (Postfix) with ESMTP id 03BCA4A19
	for <submit@bugs.parisc-linux.org>; Thu, 22 Feb 2001 10:46:29 -0700 (MST)
Received: from hpfcla.fc.hp.com (hpfcla.fc.hp.com [15.254.48.2])
	by atlrel2.hp.com (Postfix) with ESMTP id 02F4530B
	for <submit@bugs.parisc-linux.org>; Thu, 22 Feb 2001 12:46:28 -0500 (EST)
Received: from noam.fc.hp.com (mail@noam.fc.hp.com [15.1.52.69])
	by hpfcla.fc.hp.com (8.9.1/8.9.3 SMKit7.01) with ESMTP id KAA04715
	for <submit@bugs.parisc-linux.org>; Thu, 22 Feb 2001 10:46:28 -0700 (MST)
Received: from localhost
	([127.0.0.1] helo=fc.hp.com ident=bame)
	by noam.fc.hp.com with esmtp (Exim 3.12 #1 (Debian))
	id 14Vzox-0007aK-00
	for <submit@bugs.parisc-linux.org>; Thu, 22 Feb 2001 10:46:27 -0700
To: submit@bugs.parisc-linux.org
Subject: pipe test program causes hang
Date: Thu, 22 Feb 2001 10:46:27 -0700
From: Paul Bame <bame@fc.hp.com>
Message-Id: <E14Vzox-0007aK-00@noam.fc.hp.com>


Version: 21Feb2001
Package: kernel

The appended test program causes the kernel to wedge (narrow and wide)
though I think 'ping' still works.  I tried a TOC which caught the
kernel in __down_interruptible but that's not necessarily abnormal
or repeatable.


#include <stdio.h>
#include <unistd.h>

#define READ 0
#define WRITE 1
#define SIZE 4096

int
main(int argc, char *argv[])
{
    int p[2];
    char data[SIZE];
    char rdbuf[SIZE];
    int i;
    int pid;

    if (pipe(p) != 0)
    {
	perror("pipe");
	return 3;
    }

    for (i = 0; i < SIZE; i++)
    {
	data[i] = rand() & 0xff;
    }

    if ((pid = fork()) < 0)
    {
	perror("fork");
	return 3;
    }

    for(i = 0; i < 10000; i++)
    {
	int sendoffset = rand() % SIZE;
	int sendsize = rand() % (SIZE - sendoffset);
	int wr, rd;

	/* Don't bother sending 0 bytes */
	if (sendoffset == SIZE - 1)
	    continue;

	if (pid > 0)
	{
	    wr = write(p[WRITE], data + sendoffset, sendsize);
	    printf("%d: write(data + %d, %d) = %d\n",
		i, sendoffset, sendsize, wr);
	    if (wr != sendsize)
	    {
		fprintf(stderr, "write returns %d expected %d\n", wr, sendsize);
		if (wr < 0)
			perror("write");
	    }
	}
	else
	{
	    rd = read(p[READ], rdbuf, sendsize);
	    printf("%d: read(%d) = %d\n", i, sendsize, rd);
	    if (rd != sendsize)
	    {
		fprintf(stderr, "read returns %d expected %d\n", rd, sendsize);
		if (rd < 0)
		    perror("read");
	    }

	    if (memcmp(data + sendoffset, rdbuf, rd) != 0)
	    {
		fprintf(stderr, "readback compare failed\n");
	    }
	}
    }
}

---------------------------------------
Received: (at 32-close) by bugs.parisc-linux.org; 17 Mar 2001 04:40:44 +0000
>From willy@ldl.fc.hp.com  Fri Mar 16 21:40:44 2001
Received: from atlrel1.hp.com (atlrel1.hp.com [156.153.255.210])
	by dsl2.external.hp.com (Postfix) with ESMTP id 437BC4A19
	for <32-close@bugs.parisc-linux.org>; Fri, 16 Mar 2001 21:40:44 -0700 (MST)
Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.1.50.190])
	by atlrel1.hp.com (Postfix) with ESMTP id A421CB0C
	for <32-close@bugs.parisc-linux.org>; Fri, 16 Mar 2001 23:40:43 -0500 (EST)
Received: by ldl.fc.hp.com (Postfix, from userid 22224)
	id 44D6B5A995; Fri, 16 Mar 2001 21:40:43 -0700 (MST)
Date: Fri, 16 Mar 2001 21:40:43 -0700
To: 32-close@bugs.parisc-linux.org
Subject: Fixed
Message-ID: <20010316214043.D3743@zumpano.fc.hp.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
From: willy@ldl.fc.hp.com (Matthew Wilcox)


The CVS checkin described by

http://lists.parisc-linux.org/pipermail/parisc-linux-cvs/2001-March/028794.html

and with patch at

http://lists.parisc-linux.org/pipermail/parisc-linux-cvs/2001-March/028793.html

fixes this bug.  More detail about what the bug was can be found at

http://lists.parisc-linux.org/pipermail/parisc-linux/2001-March/012015.html

and

http://lists.parisc-linux.org/pipermail/parisc-linux/2001-March/012030.html