public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug threads/28065] FAIL: gdb.threads/access-mem-running-thread-exit.exp: all-stop: access mem (print global_var after writing again, inf=1, iter=354)
Date: Fri, 09 Jul 2021 21:53:03 +0000	[thread overview]
Message-ID: <bug-28065-4717-kjNMqu7gb7@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28065-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28065

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bp at alien8 dot de

--- Comment #19 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Pedro Alves from comment #18)
> Created attachment 13554 [details]
> attach-2.c
> 
> Adjusted version of testcase that:
> 
>  - closes fd
>  - does not have main thread call pthread_exit.  
>  - also expects ESRCH.  I saw that a couple times.
> 
> Otherwise, still fails the same way.

Hi Boris,

We're seeing this reproducer fail like this:
...
$ gcc -pthread access-2.c
$ ./a.out 
pread64 res: 0
a.out: access-2.c:45: get_global_var: Assertion `res == 4' failed.
Aborted (core dumped)
...
and we're trying to understand if this is a kernel bug or not.

What happens:
- we do an open ("/proc/$pid/task/$tid/mem"), and this succeeds, so
  we get a file descriptor.
- then we try to read from the file descriptor, but this returns 0, in other
  words we have EOF.

The fact that read doesn't complete could be explained by tid exiting
before/during the read.

The question is then whether EOF is the correct failure mode.  Shouldn't we
expect read to return -1, with errno set to EBADF or EINVAL or some such?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-07-09 21:53 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08  9:57 [Bug threads/28065] New: " vries at gcc dot gnu.org
2021-07-08 10:01 ` [Bug threads/28065] " vries at gcc dot gnu.org
2021-07-08 10:01 ` vries at gcc dot gnu.org
2021-07-08 10:06 ` vries at gcc dot gnu.org
2021-07-08 10:41 ` vries at gcc dot gnu.org
2021-07-08 10:41 ` vries at gcc dot gnu.org
2021-07-08 10:45 ` pedro at palves dot net
2021-07-08 11:03 ` vries at gcc dot gnu.org
2021-07-08 11:23 ` vries at gcc dot gnu.org
2021-07-08 12:06 ` pedro at palves dot net
2021-07-08 13:20 ` vries at gcc dot gnu.org
2021-07-08 13:34 ` pedro at palves dot net
2021-07-09  9:41 ` vries at gcc dot gnu.org
2021-07-09  9:44 ` vries at gcc dot gnu.org
2021-07-09 13:33 ` vries at gcc dot gnu.org
2021-07-09 16:19 ` vries at gcc dot gnu.org
2021-07-09 16:40 ` pedro at palves dot net
2021-07-09 17:11 ` pedro at palves dot net
2021-07-09 18:57 ` vries at gcc dot gnu.org
2021-07-09 19:06 ` pedro at palves dot net
2021-07-09 19:10 ` pedro at palves dot net
2021-07-09 20:32 ` pedro at palves dot net
2021-07-09 21:53 ` vries at gcc dot gnu.org [this message]
2021-07-09 22:55 ` pedro at palves dot net
2021-07-10 12:24 ` simark at simark dot ca
2021-10-05 11:27 ` vries at gcc dot gnu.org
2021-11-05 17:58 ` cvs-commit at gcc dot gnu.org
2021-11-05 18:02 ` pedro at palves dot net

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=bug-28065-4717-kjNMqu7gb7@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).