This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.15-328-g48aff77


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  48aff7765b16851c4c3c5b7beb44c878d0d24ae8 (commit)
      from  aea5d7277a2ebd2f432bc3196e4a0e2afe8d5878 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=48aff7765b16851c4c3c5b7beb44c878d0d24ae8

commit 48aff7765b16851c4c3c5b7beb44c878d0d24ae8
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Thu Mar 8 09:33:12 2012 +0100

    Fix 9554ebf2d4da22591e974d3cf2ed09a2b8dbdbd8.
    
    | Invalid timeouts in i386 sem_timedwait.
    |
    | We adjusted nwaiters even though this isn't necessary.

diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index dd6f334..6cf6b3f 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-08  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* tst-sem13.c (do_test): Add another test case.
+	* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
+	Fix updating nwaiters.
+
 2012-03-07  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #10545]
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
index 4740aee..0389243 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005, 2007, 2009, 2011-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -64,7 +64,7 @@ sem_timedwait:
 	/* Check for invalid nanosecond field.  */
 	cmpl	$1000000000, 4(%edi)
 	movl	$EINVAL, %esi
-	jae	6f
+	jae	.Lerrno_exit
 
 	LOCK
 	incl	NWAITERS(%ecx)
@@ -146,6 +146,10 @@ sem_timedwait:
 .Lafter_ret:
 3:	negl	%esi
 6:
+	movl	28(%esp), %ebx	/* Load semaphore address.  */
+	LOCK
+	decl	NWAITERS(%ebx)
+.Lerrno_exit:
 #ifdef PIC
 	SETUP_PIC_REG(bx)
 #else
@@ -162,7 +166,6 @@ sem_timedwait:
 	movl	%esi, %gs:(%edx)
 #endif
 
-	movl	28(%esp), %ebx	/* Load semaphore address.  */
 	orl	$-1, %eax
 	jmp	10b
 	.size	sem_timedwait,.-sem_timedwait
diff --git a/nptl/tst-sem13.c b/nptl/tst-sem13.c
index 8756b22..068d79e 100644
--- a/nptl/tst-sem13.c
+++ b/nptl/tst-sem13.c
@@ -30,12 +30,31 @@ do_test (void)
     }
   if (errno != EINVAL)
     {
-      puts ("sem_timedwait did not fail with EINVAL");
+      perror ("sem_timedwait did not fail with EINVAL");
       return 1;
     }
   if (u.ns.nwaiters != 0)
     {
-      puts ("nwaiters modified");
+      printf ("sem_timedwait modified nwaiters: %ld\n", u.ns.nwaiters);
+      return 1;
+    }
+
+  ts.tv_sec = /* Invalid.  */ -2;
+  ts.tv_nsec = 0;
+  errno = 0;
+  if (sem_timedwait (&u.s, &ts) >= 0)
+    {
+      puts ("2nd sem_timedwait did not fail");
+      return 1;
+    }
+  if (errno != ETIMEDOUT)
+    {
+      perror ("2nd sem_timedwait did not fail with ETIMEDOUT");
+      return 1;
+    }
+  if (u.ns.nwaiters != 0)
+    {
+      printf ("2nd sem_timedwait modified nwaiters: %ld\n", u.ns.nwaiters);
       return 1;
     }
 

-----------------------------------------------------------------------

Summary of changes:
 nptl/ChangeLog                                     |    6 +++++
 .../unix/sysv/linux/i386/i486/sem_timedwait.S      |    9 +++++--
 nptl/tst-sem13.c                                   |   23 ++++++++++++++++++-
 3 files changed, 33 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]