<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - libc++abi should report forced unwinding on thread termination."
   href="https://bugs.llvm.org/show_bug.cgi?id=41396">41396</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>libc++abi should report forced unwinding on thread termination.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++abi
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>7.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>eric@efcs.ca
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>libstdc++ throws an exception when forced unwinding occurs, for example by a
call to pthread_exit.

This allows the library to detect and avoid certain classes of bugs. For
example, libc++ hangs forever on this test, libstdc++ reports the promise as
broken.

#include <future>
#include <stdexcept>
#include <pthread.h>
#include <cassert>

void f() { pthread_exit(nullptr); }

int main()
{
 auto fut = std::async(std::launch::async, f);
 try
 {
  fut.get();
  throw std::logic_error("Unreachable");
 }
 catch (const std::future_error& e)
 {
  assert( e.code() == std::future_errc::broken_promise );
 }
}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>