Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/1] app: handle concatenated argv name-value correctly
Date: Thu, 20 Feb 2020 00:09:08 +0100	[thread overview]
Message-ID: <e5d1ecdd-ba9f-1726-8373-9b68f0260d8a@tarantool.org> (raw)
In-Reply-To: <20200219085410.GA6469@tarantool.org>

Hi! Thanks for the review!

On 19/02/2020 09:54, Igor Munkin wrote:
> Vlad,
> 
> Thanks for the patch it LGTM.
> 
> However, the Travis job failed on the newly added test[1]. It looks like
> the wait underneath the pclose has failed. I can't reproduce the problem
> on my machine, but I guess the strace output for the failed child:close
> might shed some light on the issue. Nevertheless, what do you think
> regarding omitting the close call since the resourses will be
> automatically released considering the doc[2]?

It is good that you noticed. The problem has nothing to do with Lua as
I found. It is because of libev, which automatically calls wait() every
time when a SIGCHILD is received. We compile with EV_CHILD_ENABLE 1,
which activates that behaviour, and breaks Lua popen. I am not sure
whether it is a bug. But yeah, we can omit :close() I suppose. Then it
will work regardless of EV_CHILD_ENABLE. We probably will need to
disable or properly handle that flag for our own popen.

I changed the test:

================================================================================

diff --git a/test/app/gh-4775-crash-args-l-e.result b/test/app/gh-4775-crash-args-l-e.result
index eff1ee763..88169f700 100644
--- a/test/app/gh-4775-crash-args-l-e.result
+++ b/test/app/gh-4775-crash-args-l-e.result
@@ -9,7 +9,6 @@ child:read()
  | ---
  | - '100'
  | ...
-child:close()
- | ---
- | - true
- | ...
+-- :close() is omitted, because SIGCHILD may be handled by
+-- libev instead of Lua. In that case :close() with fail with
+-- ECHILD, but it does not matter for this test.
diff --git a/test/app/gh-4775-crash-args-l-e.test.lua b/test/app/gh-4775-crash-args-l-e.test.lua
index 1cccb78a4..7dff8e894 100644
--- a/test/app/gh-4775-crash-args-l-e.test.lua
+++ b/test/app/gh-4775-crash-args-l-e.test.lua
@@ -3,4 +3,6 @@
 --
 child = io.popen('tarantool -e"print(100) os.exit()"')
 child:read()
-child:close()
+-- :close() is omitted, because SIGCHILD may be handled by
+-- libev instead of Lua. In that case :close() with fail with
+-- ECHILD, but it does not matter for this test.

  reply	other threads:[~2020-02-19 23:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 23:08 Vladislav Shpilevoy
2020-02-19  8:54 ` Igor Munkin
2020-02-19 23:09   ` Vladislav Shpilevoy [this message]
2020-02-20  6:24 ` Kirill Yukhin

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=e5d1ecdd-ba9f-1726-8373-9b68f0260d8a@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=imun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/1] app: handle concatenated argv name-value correctly' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox