Bug#923802: pthread: dead-lock while pthread_cond_destroy()

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#923802: pthread: dead-lock while pthread_cond_destroy()

Joël Krähemann-2
Package: libc0.1-dev
Version: 2.25-2
Severity: normal
File: pthread

Dear Maintainer,

As checking why GSequencer's test didn't continue, I have discovered a dead-lock
as calling pthread_cond_destroy()

http://salsa.debian.org/multimedia-team/gsequencer

Here is the command to reproduce:

joel@kbsd:~/gsequencer-2.1.64$ libtool --mode=execute gdb ags_condition_manager_test
GNU gdb (Debian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-kfreebsd-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joel/gsequencer-2.1.64/.libs/ags_condition_manager_test...done.
(gdb) r
Starting program: /home/joel/gsequencer-2.1.64/.libs/ags_condition_manager_test


     CUnit - A unit testing framework for C - Version 2.1-3
     http://cunit.sourceforge.net/


Suite: AgsConditionManagerTest
  Test: test of AgsConditionManager insert ...passed
  Test: test of AgsConditionManager remove ...^Z
Program received signal SIGTSTP, Stopped (user).
__syscall__umtx_op () at ../sysdeps/unix/syscall-template.S:76
76 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) bt
#0  0x000000080360f1da in __syscall__umtx_op () at ../sysdeps/unix/syscall-template.S:76
#1  0x000000080360d8cc in __lll_lock_wait_private (futex=0x12479a0) at ../sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/lowlevellock.c:31
#2  0x000000080360aa9b in __pthread_cond_destroy (cond=cond@entry=0x12479a0) at pthread_cond_destroy.c:34
#3  0x00000008018982f2 in ags_condition_manager_remove (condition_manager=0x12410a0, lock_object=0x12444d0)
    at ags/thread/ags_condition_manager.c:176
#4  0x000000000102229e in ags_condition_manager_test_remove () at ags/test/thread/ags_condition_manager_test.c:136
#5  0x0000000801ab130f in  () at /usr/lib/x86_64-kfreebsd-gnu/libcunit.so.1
#6  0x0000000801ab154d in  () at /usr/lib/x86_64-kfreebsd-gnu/libcunit.so.1
#7  0x0000000801ab19be in CU_run_all_tests () at /usr/lib/x86_64-kfreebsd-gnu/libcunit.so.1
#8  0x0000000001021fc0 in main (argc=<optimized out>, argv=<optimized out>) at ags/test/thread/ags_condition_manager_test.c:218


-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 10.3-0-amd64
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libc0.1-dev:kfreebsd-amd64 depends on:
ii  kfreebsd-kernel-headers  10.3~8
ii  libc-dev-bin             2.25-2
ii  libc0.1                  2.25-2

libc0.1-dev:kfreebsd-amd64 recommends no packages.

Versions of packages libc0.1-dev:kfreebsd-amd64 suggests:
pn  glibc-doc     <none>
ii  manpages-dev  4.16-1

-- no debconf information

Reply | Threaded
Open this post in threaded view
|

Bug#923802: Acknowledgement (pthread: dead-lock while pthread_cond_destroy())

Joël Krähemann-2
Hi,

This happens as you call pthread_cond_destroy() twice on the very same
cond variable.

Just attached a file to reproduce.

Bests,
Joël

On Tue, Mar 5, 2019 at 4:27 PM Debian Bug Tracking System
<[hidden email]> wrote:

>
> Thank you for filing a new Bug report with Debian.
>
> You can follow progress on this Bug here: 923802: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923802.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  GNU Libc Maintainers <[hidden email]>
>
> If you wish to submit further information on this problem, please
> send it to [hidden email].
>
> Please do not send mail to [hidden email] unless you wish
> to report a problem with the Bug-tracking system.
>
> --
> 923802: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923802
> Debian Bug Tracking System
> Contact [hidden email] with problems

simple_pthread_cond_test.c (372 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#923802: Acknowledgement (pthread: dead-lock while pthread_cond_destroy())

Florian Weimer-4
* Joël Krähemann:

> This happens as you call pthread_cond_destroy() twice on the very same
> cond variable.

Surely that's an application bug.  Why do you think this is a glibc
issue?

Thanks,
Florian

Reply | Threaded
Open this post in threaded view
|

Bug#923802: Acknowledgement (pthread: dead-lock while pthread_cond_destroy())

Joël Krähemann-2
Hi,

Yes, it is an application bug. So, I fixed my upstream source. Just recognized
calling pthread_cond_destroy() twice, later.

Best regards,
Joël

On Wed, Mar 6, 2019 at 11:44 AM Florian Weimer <[hidden email]> wrote:

>
> * Joël Krähemann:
>
> > This happens as you call pthread_cond_destroy() twice on the very same
> > cond variable.
>
> Surely that's an application bug.  Why do you think this is a glibc
> issue?
>
> Thanks,
> Florian