[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#882586: marked as done (libc6-dev:amd64: pthread_rwlock_unlock segfaults in statically linked executable)



Your message dated Fri, 10 Jan 2025 20:39:13 +0100
with message-id <Z4F3YdWY18iwVBL2@aurel32.net>
and subject line Re: Bug#882586: libc6-dev:amd64: pthread_rwlock_unlock segfaults in statically linked executable
has caused the Debian Bug report #882586,
regarding libc6-dev:amd64: pthread_rwlock_unlock segfaults in statically linked executable
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
882586: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=882586
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libc6-dev
Version: 2.24-11+deb9u1
Severity: important

A minimal program that exercises R/W locks crashes when linked statically:

$ cat test-rwlock.c
#include <pthread.h>
int main() {
    pthread_rwlock_t rw;
    if (pthread_rwlock_init(&rw, NULL)) return -1;
    if (pthread_rwlock_wrlock(&rw))     return -2;
    if (pthread_rwlock_unlock(&rw))     return -3;
    if (pthread_rwlock_destroy(&rw))    return -4;
    return 0;
}

$ cc -pthread         -O0 -g test-rwlock.c ; ./a.out ; echo $?
0

$ cc -pthread -static -O0 -g test-rwlock.c ; ./a.out ; echo $?
Illegal instruction
132

Most likely, the problem is not in pthread_rwlock_unlock, but in
pthread_rwlock_wrlock: gdb shows that when the latter returns, 
    rw.__data.__writer == pid_of_the_process
in the dynamic case, and 
    rw.__data.__writer == 0 
in the static case.

Best regards,
	g.



-- System Information:
Debian Release: 9.1
  APT prefers stable-debug
  APT policy: (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libc6-dev:amd64 depends on:
ii  libc-dev-bin    2.24-11+deb9u1
ii  libc6           2.24-11+deb9u1
ii  linux-libc-dev  4.9.51-1

libc6-dev:amd64 recommends no packages.

Versions of packages libc6-dev:amd64 suggests:
ii  glibc-doc     2.24-11+deb9u1
ii  manpages-dev  4.10-2

-- no debconf information

--- End Message ---
--- Begin Message ---
Version: 2.25-1

Hi,

On 2017-11-24 10:28, g1 wrote:
> Package: libc6-dev
> Version: 2.24-11+deb9u1
> Severity: important
> 
> A minimal program that exercises R/W locks crashes when linked statically:
> 
> $ cat test-rwlock.c
> #include <pthread.h>
> int main() {
>     pthread_rwlock_t rw;
>     if (pthread_rwlock_init(&rw, NULL)) return -1;
>     if (pthread_rwlock_wrlock(&rw))     return -2;
>     if (pthread_rwlock_unlock(&rw))     return -3;
>     if (pthread_rwlock_destroy(&rw))    return -4;
>     return 0;
> }
> 
> $ cc -pthread         -O0 -g test-rwlock.c ; ./a.out ; echo $?
> 0
> 
> $ cc -pthread -static -O0 -g test-rwlock.c ; ./a.out ; echo $?
> Illegal instruction
> 132
> 
> Most likely, the problem is not in pthread_rwlock_unlock, but in
> pthread_rwlock_wrlock: gdb shows that when the latter returns, 
>     rw.__data.__writer == pid_of_the_process
> in the dynamic case, and 
>     rw.__data.__writer == 0 
> in the static case.

This bug got fixed in glibc 2.25. Closing the bug accordingly.

Regards
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                     http://aurel32.net

--- End Message ---

Reply to: