Bug#434294: libc6: buggy unlocking of an unlocked pthread_rwlock_t
Package: libc6
Version: 2.6-2
Severity: normal
according to it's man page, pthread_rwlock_unlock should return EPERM, if the current thread
doesn't hold the lock.
the actual behavior is different, though:
see:
#include "pthread.h"
#include "errno.h"
#include "assert.h"
int main(void)
{
pthread_rwlock_t rwlock;
pthread_rwlock_init(&rwlock, NULL);
pthread_rwlock_rdlock(&rwlock);
pthread_rwlock_rdlock(&rwlock);
pthread_rwlock_unlock(&rwlock);
pthread_rwlock_unlock(&rwlock);
assert( pthread_rwlock_unlock(&rwlock) == EPERM );
pthread_rwlock_destroy(&rwlock);
}
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (990, 'unstable'), (500, 'testing'), (500, 'stable'), (10, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.22.1-rt1 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libc6 depends on:
ii libgcc1 1:4.2.1-0 GCC support library
libc6 recommends no packages.
-- no debconf information
Reply to: