Re: make hangs reading pipe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 3, 2009 at 9:47 PM, John David Anglin
<dave@xxxxxxxxxxxxxxxxxx> wrote:
>> Yes, it's not make's fault, it's waiting for the read to complete.
>> What is the process on the other side of the pipe?
>
> Thanks for explaining the inode numbers.
>
> The process on the other side is /bin/sh:
>
> root@hiauly6:/proc/14971# ps -ef|grep 14971
> dave     14971     1  0 Dec01 ?        00:00:00 /bin/sh
>
> It's fd's are:
>
> root@hiauly6:/proc/14971/fd# ls -l
> total 0
> lr-x------ 1 dave dave 64 Dec  3 21:20 0 -> pipe:[1401596]
> l-wx------ 1 dave dave 64 Dec  3 21:20 1 -> pipe:[1401597]
> l-wx------ 1 dave dave 64 Dec  3 21:20 2 -> /home/dave/gnu/gcc-4.5/objdir/build.log
> lr-x------ 1 dave dave 64 Dec  3 21:20 3 -> pipe:[1383769]
> l-wx------ 1 dave dave 64 Dec  3 21:20 4 -> pipe:[1383769]
> lr-x------ 1 dave dave 64 Dec  3 21:20 5 -> /usr/include/sys/stat.h
> lr-x------ 1 dave dave 64 Dec  3 21:20 6 -> pipe:[1401596]
> l-wx------ 1 dave dave 64 Dec  3 21:20 7 -> pipe:[1401596]
> l-wx------ 1 dave dave 64 Dec  3 21:20 9 -> pipe:[1401597]
>
> It's stuck reading 0:

It's stuck reading standard input, which happens to be attached to another pipe.

> root@hiauly6:/proc/14971# strace -p14971
> Process 14971 attached - interrupt to quit
> read(0,
>
> The only process using inode 1401596 is 14971.  As seen above, it
> seems to be talking to itself.  That probably would explain the hang.

Odd, is this normal for bash e.g. stdin -> pipe <- other fd.

> It's backtrace is:
>
> 0x4058607c in read () from /lib/libc.so.6
> (gdb) bt
> #0  0x4058607c in read () from /lib/libc.so.6
> #1  0x0009051c in zread ()
> #2  0x000618ac in buffered_getchar ()
> #3  0x0002c71c in ?? ()
> #4  0x0002ef74 in ?? ()
> #5  0x00032ebc in yyparse ()
> #6  0x00029e30 in parse_command ()
> #7  0x00029f30 in read_command ()
> #8  0x0002a0d0 in reader_loop ()
> #9  0x000292b8 in main ()

I don't know what to say at this point, it might be a bug in bash, or
a bug in pipefs for hppa where the same inode is given out incorrectly
under certain circumstances.

What does the normal behaviour look like, what is fd 6 being used for?
You should be able to use strace to observe the correct operation.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux