public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-patches@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH 0/2] Testsuite adjustment and relevant fix
Date: Wed, 19 Jul 2023 13:41:40 +0100	[thread overview]
Message-ID: <20230719124142.10310-1-jon.turney@dronecode.org.uk> (raw)

[1/2] has the side effect of flipping test stat06 from working to failing.
[2/2] fixes that

When run with TDIRECTORY set, libltp just uses that directory and assumes
something else will clean it up.

When TDIRECTORY is not set, libltp creates a subdirectory under /tmp, and when
the test is completed, removes the expected files and verifies that the
directory is empty.

stat06 fails that check, because it creates the a file named "file" there, and
tries stat("file", -1), testing that it returns the expected value EFAULT.

"file" is removed, but lingers in the STATUS_DELETE_PENDING state until the
Windows handle which stat_worker() leaks when an exception occurs is closed
(when the processes exits).

Future work: It looks like similar problems might generically occur in similar
code througout syscalls.cc.

Jon Turney (2):
  Cygwin: testsuite: Drop setting TDIRECTORY
  Cygwin: Fix Windows file handle leak in stat("file", -1)

 winsup/cygwin/syscalls.cc              | 6 +++---
 winsup/testsuite/Makefile.am           | 8 --------
 winsup/testsuite/cygrun.c              | 5 +----
 winsup/testsuite/winsup.api/winsup.exp | 4 +---
 4 files changed, 5 insertions(+), 18 deletions(-)

-- 
2.39.0


             reply	other threads:[~2023-07-19 12:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 12:41 Jon Turney [this message]
2023-07-19 12:41 ` [PATCH 1/2] Cygwin: testsuite: Drop setting TDIRECTORY Jon Turney
2023-07-19 12:41 ` [PATCH 2/2] Cygwin: Fix Windows file handle leak in stat("file", -1) Jon Turney
2023-07-19 15:33 ` [PATCH 0/2] Testsuite adjustment and relevant fix Corinna Vinschen
2023-07-20 12:55   ` Jon Turney
2023-07-20 15:14     ` Corinna Vinschen
2023-07-20 15:17       ` Corinna Vinschen
2023-07-21 12:26       ` Jon Turney

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=20230719124142.10310-1-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-patches@cygwin.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).