Jump to page: 1 2
Thread overview
[Issue 13416] dead-lock in FreeBSD suspend handler
[Issue 13416] frequent auto-tester hangs in core.thread on freebsd 32 and 64
Sep 02, 2014
Brad Roberts
Sep 10, 2014
Sobirari Muhomori
Nov 22, 2014
Martin Nowak
Dec 05, 2014
Martin Nowak
Dec 07, 2014
Martin Nowak
Dec 07, 2014
Martin Nowak
May 12, 2015
Joakim
Oct 31, 2015
Martin Nowak
Oct 31, 2015
Martin Nowak
Aug 26, 2018
Joakim
Jan 18, 2022
Dlang Bot
Jan 20, 2022
Dlang Bot
Dec 30, 2022
Iain Buclaw
September 02, 2014
https://issues.dlang.org/show_bug.cgi?id=13416

Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
            Summary|frequent auto-tester hangs  |frequent auto-tester hangs
                   |in core.thread on freebsd   |in core.thread on freebsd
                   |64                          |32 and 64

--- Comment #1 from Brad Roberts <braddr@puremagic.com> ---
Same behavior and stacktraces on the new 8 core freebsd 32 bit box as well. Both are running freebsd 8.4, same as the other freebsd testers.

--
September 10, 2014
https://issues.dlang.org/show_bug.cgi?id=13416

--- Comment #2 from Sobirari Muhomori <dfj1esp02@sneakemail.com> ---
pthread_kill hangs? Shouldn't it be asynchronous?

--
October 10, 2014
https://issues.dlang.org/show_bug.cgi?id=13416

monarchdodra@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra@gmail.com
           Severity|critical                    |blocker

--- Comment #3 from monarchdodra@gmail.com ---
Upgraded to "BLOCKER", as this (relativelly frequently) trips up the
auto-testers.

--
November 22, 2014
https://issues.dlang.org/show_bug.cgi?id=13416

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code@dawg.eu

--- Comment #4 from Martin Nowak <code@dawg.eu> ---
That's a dead-lock in the pthread library.
Both pthread_attr_get_np and pthread_kill lock the same thread mutex.

_pthread_attr_get_np: https://github.com/freebsd/freebsd/blob/428b45aa532260e8c6ddf0217ec31db2234d29a8/lib/libthr/thread/thr_attr.c#L154 _pthread_kill: https://github.com/freebsd/freebsd/blob/428b45aa532260e8c6ddf0217ec31db2234d29a8/lib/libthr/thread/thr_kill.c#L64

_thr_find_thread: https://github.com/freebsd/freebsd/blob/428b45aa532260e8c6ddf0217ec31db2234d29a8/lib/libthr/thread/thr_list.c#L351

We should try to use pthread_suspend_np or pthread_suspend_all_np instead.
Without a signal handler we'd still need to obtain the stack top.
There seems to be a function on OpenBSD pthread_stackseg_np, not sure how to do
it on FreeBSD.

--
December 05, 2014
https://issues.dlang.org/show_bug.cgi?id=13416

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|frequent auto-tester hangs  |dead-lock in FreeBSD
                   |in core.thread on freebsd   |suspend handler
                   |32 and 64                   |

--
December 07, 2014
https://issues.dlang.org/show_bug.cgi?id=13416

--- Comment #5 from Martin Nowak <code@dawg.eu> ---
Fairly simple to reproduce the problem.

cat > bug.d << CODE
import core.thread, core.sys.posix.pthread, core.stdc.stdio;

void loop()
{
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  auto thr = pthread_self();
  while (true)
    pthread_attr_get_np(thr, &attr);
}

void main()
{
  auto thr = new Thread(&loop).start();
  while (true)
  {
      thread_suspendAll();
      thread_resumeAll();
      printf(".");
  }
}
CODE

dmd -run bug

--
December 07, 2014
https://issues.dlang.org/show_bug.cgi?id=13416

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #6 from Martin Nowak <code@dawg.eu> ---
Using pthread_suspend_np didn't work out, because there is no way to get the current stack top of a suspended thread. I also tried to override SIGCANCEL which is used for pthread_suspend_np but that didn't work.

https://github.com/D-Programming-Language/druntime/pull/1061

--
December 15, 2014
https://issues.dlang.org/show_bug.cgi?id=13416

--- Comment #7 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/ad8662d65fe8f24be2c64c721eabe4da7f78b31f fix Issue 13416 - dead-lock in FreeBSD suspend handler

- use pthread internal THR_IN_CRITICAL to retry suspend

https://github.com/D-Programming-Language/druntime/commit/513ba191f3e8b78aeb99336e27212dfdcacb39c5 Merge pull request #1061 from MartinNowak/fix13416

fix Issue 13416 - dead-lock in FreeBSD suspend handler

--
December 15, 2014
https://issues.dlang.org/show_bug.cgi?id=13416

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
February 19, 2015
https://issues.dlang.org/show_bug.cgi?id=13416

--- Comment #8 from github-bugzilla@puremagic.com ---
Commits pushed to 2.067 at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/ad8662d65fe8f24be2c64c721eabe4da7f78b31f fix Issue 13416 - dead-lock in FreeBSD suspend handler

https://github.com/D-Programming-Language/druntime/commit/513ba191f3e8b78aeb99336e27212dfdcacb39c5 Merge pull request #1061 from MartinNowak/fix13416

--
« First   ‹ Prev
1 2