Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Elizabeth Chastain <mec@shout.net>
To: ezannoni@redhat.com
Cc: gdb@sources.redhat.com
Subject: Bug in testsuite/gdb.base/tls.c
Date: Tue, 29 Jul 2003 20:07:00 -0000	[thread overview]
Message-ID: <200307292007.h6TK79up016297@duracef.shout.net> (raw)

I'm seeing a lot of test suite hangs with the new tls.c.
I tracked it down to this code:

  for( i = 0; i < N_THREADS; i++ )
    {
      do
	{
	  errno = 0;

	  if (sem_wait (&tell_main) == -1)
	    {
	      if (errno != EINTR)
		{
		  ...
		  return;
		}
	      ...
	    }
	  }
	  while (errno == EINTR);
    }

It turns out that errno can be EINTR even when the return value is 0!
That screws up the loop counter.

This happened with Red Hat Linux 8, glibc 2.2.93-5-rh.  It is sensitive
to the placement of breakpoints, which is not surprising.

I think it's normal Unix semantics that when the return value is zero,
errno has no meaning.

I'll code up a patch for tls.c, on those lines.

Michael C


             reply	other threads:[~2003-07-29 20:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-29 20:07 Michael Elizabeth Chastain [this message]
2003-07-29 20:56 ` Elena Zannoni

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=200307292007.h6TK79up016297@duracef.shout.net \
    --to=mec@shout.net \
    --cc=ezannoni@redhat.com \
    --cc=gdb@sources.redhat.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