1 |
I've got an old problem with clamd, which creates a bunch of threads. |
2 |
Every so often the logs will show e.g., |
3 |
|
4 |
Jul 31 06:01:41 mx1 clamd[24070]: pthread_create failed |
5 |
Jul 31 06:01:41 mx1 clamd[24070]: pthread_create failed |
6 |
Jul 31 06:01:41 mx1 clamd[24070]: pthread_create failed |
7 |
Jul 31 06:01:41 mx1 clamd[24070]: pthread_create failed |
8 |
|
9 |
It doesn't cause any noticeable problems, so I've sort of left it alone |
10 |
but tonight I dug in a little. The problem seems (somehow) related to |
11 |
that box's hardening. |
12 |
|
13 |
I'm using a test program that creates a bunch of threads and then just |
14 |
kills them. On the box in question, |
15 |
|
16 |
# uname -a |
17 |
Linux mx1 3.4.2-hardened #1 SMP Wed Jul 11 13:41:57 EDT 2012 i686 |
18 |
Intel(R) Xeon(TM) CPU 3.06GHz GenuineIntel GNU/Linux |
19 |
# ./pthread_test 25 |
20 |
Creating 25 threads |
21 |
Created thread #0... |
22 |
Created thread #1... |
23 |
Created thread #2... |
24 |
Created thread #3... |
25 |
pthread_create failed: Resource temporarily unavailable |
26 |
|
27 |
Disabling all paxctl protections helps, but doesn't allow me to get all |
28 |
the way to 25. I tried doing the protections one-at-a-time; it doesn't |
29 |
really help: |
30 |
|
31 |
# paxctl -pemrxs pthread_test |
32 |
# ./pthread_test 25 |
33 |
Creating 25 threads |
34 |
Created thread #0... |
35 |
Created thread #1... |
36 |
Created thread #2... |
37 |
Created thread #3... |
38 |
Created thread #4... |
39 |
Created thread #5... |
40 |
Created thread #6... |
41 |
Created thread #7... |
42 |
Created thread #8... |
43 |
Created thread #9... |
44 |
pthread_create failed: Resource temporarily unavailable |
45 |
|
46 |
I get nothing in my dmesg, which otherwise records most limit-based denials. |
47 |
|
48 |
Is there some way I can troubleshoot this? It works on amd64 with the |
49 |
same kernel hardening options. |