Github messages for mblaze
 help / color / mirror / Atom feed
From: nmeum <nmeum@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [ISSUE] mpick: multi redir test hangs on Alpine
Date: Sat, 13 Mar 2021 20:27:37 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-203@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1733 bytes --]

New issue by nmeum on mblaze repository

https://github.com/leahneukirchen/mblaze/issues/203

Description:
While trying to get the mblaze test suite running on Alpine Linux, I noticed that the `multi redir` test from `2000-mpick.t` does not terminate, even with current git HEAD. To reproduce:

```
$ cat /tmp/input
inbox/cur/1:2,S
inbox/cur/2:2,ST
inbox/cur/3:2,SRT
inbox/cur/4:2,SRFT
inbox/cur/5:2,T
inbox/cur/6:2,SRF
inbox/cur/7:2,SR
inbox/cur/8:2,SF
inbox/cur/9:2,
$ cat expr
let foo = from.addr == "peter@example.org"
let bar = from.disp == "Peter Example"
in
  foo |"sed ""s/^/1:&/""" && bar |"sed ""s/^/2:&/""" && skip
$ mpick -F ./expr < /tmp/input
1:inbox/cur/1:2,S
1:inbox/cur/9:2,
2:inbox/cur/1:2,S
2:inbox/cur/9:2,
<process does not terminate>
```

I debugged this a bit with `strace(1)`. The output of the 3 processes (mpick, sed, and sed) is available here:

* [sed.25493.txt](https://github.com/leahneukirchen/mblaze/files/6135400/sed.25493.txt)
* [sed.25494.txt](https://github.com/leahneukirchen/mblaze/files/6135401/sed.25494.txt)
* [sed.25495.txt](https://github.com/leahneukirchen/mblaze/files/6135402/sed.25495.txt)

I am a bit confused as to what is happening here. The mpick process (PID 25493) blocks because it waits for the first sed process (PID 25494) to terminate (since mpick uses `pclose(3)`). The sed process on the other hand doesn't terminate because it is still reading from the reading end of the pipe. However, I would expect that read to return with an EOF because the mpick process already closed the writing end of the pipe. Yet for some reason, it is stuck in a read system call. Maybe I am missing something obvious here, any idea what might be causing this?

             reply	other threads:[~2021-03-13 19:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-13 19:27 nmeum [this message]
2021-03-13 21:07 ` Duncaen
2021-03-13 21:08 ` Duncaen
2021-03-13 21:40 ` nmeum
2021-03-14 16:08 ` nmeum
2021-06-25 23:06 ` [ISSUE] [CLOSED] " nmeum
2021-06-25 23:06 ` nmeum
2021-06-25 23:06 ` nmeum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-203@inbox.vuxu.org \
    --to=nmeum@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).