2 thoughts on “Broken pipe is generally error caused by what causes”

  1. There are many reasons:
    1, in the network communication, the connection accident interruption, such as being pulled out of the network;
    2, the pipeline breaks in the inter -process communication, such as the process of a pipeline, the process is deadlocked;
    3, the file description of the file description The end of the rune is more common in*nix. When the login is exited, the virtual terminal is disconnected, causing the file descriptor 1 and 2 to disappear;
    extension information:
    First I will say why I should write such an article. There are two reasons. One reason is that the following problems are indeed some representative. Although it is not a high problem, it is always good to understand and use the Linux system. The second reason is that I am bored by more and more brainless questions that I know, and this question itself extend some of my views.
    It more than once expressed my views on asking questions on different occasions, such as:
    Is drunk lying sand field: How to treat Zhihu's homework and personal tasks?
    Windows system collapse blue screen, how can I see whether the following problem is the system problem or hardware problem?
    The people who want to ask questions can understand the thinking angle and the process of solving the problem. A question from phenomenon to essential analysis is not that you said, "Doctor, I have a fever, uncomfortable", and then the doctor directly prescribes you with some antipyretic medicine. One problem from the phenomenon to the essence, from the "obvious" of ordinary people's eyes to the "can be discussed and solved" of professionals' "can be discussed and solved."
    The beginning of a question
    The Bash script suddenly working abnormal in the past two days. On the surface, a program that would not fail suddenly began to fail. After viewing the error output, it can be found that a statement that should not be executed has been executed, and then it shows that a judgment statement that should not be established suddenly "established" suddenly. Because of the nested nested by many functions, in order to explain the convenience, the judgment statement simplifies the following (note that it is extremely simplified sentence):
    if! Mkfs.xfs -f /dev /loop0 | GREP -q crc = 1; then
    do_something
    fi
    Mo_something statement is not expected to be executed, but it is executed, indicating that the judgment statement of if is established. Literally, GREP should not find the keyword of CRC = 1 from the output of mkfs.xfs, so the conditions are established and the Do_SOMETHING is executed. But when I actually viewed the output of mkfs.xfs alone, I could get CRC = 1:
    # mkfs.xfs -F /dev /Loop0 | GREP CRC = 1
    = CRC = 1 Finobt = 1. Sparse = 1, RMAPBT = 0
    can see that GREP finds CRC = 1.

    So I started to doubt whether the bug of mkfs.xfs caused Mkfs.xfs to return errors after successful operation. However, it is no different to execute mkfs.xfs separately:
    # MKFS.XFS -F/dev/LOOP0 R R
    Meta -Data =/dev/loop0 isize = 512 agcount = 4, AGSIZE = 983040 BLKS
    = SECTSZ = 512 ATTR = 2, = 1
    = CRC = 1 Finobt = 1, Spars = 1, RMAPBT = 0
    = Reflink = 1
    data = 4096 Blocks = 3932160, IMAXPCTCT = 25
    = sunit = 0 swidth = 0 BLKS
    naming = Version 2 bsize = 4096 ascii-ci = 0, FTYPE = 1
    log = Internet = 4096 Blocks = 2560, Ver service
    = sectsz = 512 sunit = 0 BLKS, lazy-count = 1
    one extsz = 4096 blocks = 0, RtextENTS = 0
    blocks ... do.
    # echo $?
    0
    The is a bug in GREP. But after testing, GREP is not different:
    # echo "CRC = 1 Finobt = 1, spars = 1, RMAPBT = 0" | GREP -Q CRC = 1
    # echo $ {[1]}}
    0
    ical

  2. There are many reasons:
    1, in the network communication, the connection accident interruption, such as being pulled out of the network;
    2, the pipeline breaks in the inter -process communication, such as the process of a pipeline, the process is deadlocked;
    3, the file description of the file description The rune terminal is more common in*nix. When the login is exited, the virtual terminal is disconnected, resulting in the disappearance of file descriptors 1 and 2;

Leave a Comment

Shopping Cart