<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 - AddressSanitizer: Thread limit (4194304 threads) exceeded. Dying."
   href="https://bugs.llvm.org/show_bug.cgi?id=47389">47389</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>AddressSanitizer: Thread limit (4194304 threads) exceeded. Dying.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>asan
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mvanotti@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We have noticed that the following program makes asan crash after some time:

```
#include <stdlib.h>
#include <pthread.h>

void * null_func(void* args) {
    return NULL;
}

int main(void) {
  for (size_t i = 0; i < 20000000ULL; i++) {
    pthread_t thread;
    pthread_create(&thread, NULL, null_func, NULL);
    pthread_join(thread, NULL);
  }
}
```

Compiling it with `clang -fsanitize=address fortune.c -o fortune -lpthread`

After some time, the program crashes with the following message:
==693500==AddressSanitizer: Thread limit (4194304 threads) exceeded. Dying.

After looking at the code, it seems like ThreadJoin and ThreadDetach and never
called for ASAN, which seems to indicate that the threads might never go into
quarantine.</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>