Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ClamAV: devel

pthread_create failed

 

 

ClamAV devel RSS feed   Index | Next | Previous | View Threaded


george at galis

Jun 19, 2007, 9:57 AM

Post #1 of 3 (1512 views)
Permalink
pthread_create failed

A week or so ago clamd stopped working for me,
after upgrading to 0.90.3 --experimental I still get
an unusable system.

Linux ohm 2.4.20-ohm #1 Sat Jan 11 01:41:24 EST 2003 i586 unknown

2007-06-19 00:46:18.927419500 Reading databases from /usr/local/share/clamav
2007-06-19 00:46:20.709107500 /var/qmail/prequeue/1182228387.M945008P19386.ohm: OK
2007-06-19 00:49:44.064874500 Database correctly reloaded (127862 signatures)
2007-06-19 00:49:44.090803500 ERROR: pthread_create failed
2007-06-19 00:49:44.094281500 ERROR: pthread_create failed
2007-06-19 00:49:44.096545500 ERROR: pthread_create failed
2007-06-19 00:49:44.098762500 ERROR: pthread_create failed
2007-06-19 00:51:30.004529500 ERROR: pthread_create failed


I thought this was resolved? What should I do?
Any additional info I can provide?

// George


--
George Georgalis, information systems scientist <IXOYE><
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net


edwintorok at gmail

Jun 19, 2007, 11:23 AM

Post #2 of 3 (1420 views)
Permalink
Re: pthread_create failed [In reply to]

On 6/19/07, George Georgalis <george [at] galis> wrote:
> A week or so ago clamd stopped working for me,
> after upgrading to 0.90.3 --experimental I still get
> an unusable system.
>
> Linux ohm 2.4.20-ohm #1 Sat Jan 11 01:41:24 EST 2003 i586 unknown
>
> 2007-06-19 00:46:18.927419500 Reading databases from /usr/local/share/clamav
> 2007-06-19 00:46:20.709107500 /var/qmail/prequeue/1182228387.M945008P19386.ohm: OK
> 2007-06-19 00:49:44.064874500 Database correctly reloaded (127862 signatures)
> 2007-06-19 00:49:44.090803500 ERROR: pthread_create failed
> 2007-06-19 00:49:44.094281500 ERROR: pthread_create failed
> 2007-06-19 00:49:44.096545500 ERROR: pthread_create failed
> 2007-06-19 00:49:44.098762500 ERROR: pthread_create failed
> 2007-06-19 00:51:30.004529500 ERROR: pthread_create failed
>

Do you have some limits on number of processes (ulimit -a)?
What is your MaxThreads setting in clamd.conf?
If you think those limits are ok, open a bugreport on the bugzilla,
and attach the above info,
and possibly an strace output.
Also try running the program below to find out reason of failure:


/* gcc -o pthread_test.c -pthread pthread_test.c
* Run as:
* pthread_test MaxThreads
* where MaxThreads is your setting from clamd.conf
*/

#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sched.h>

static pthread_mutex_t cond_mut;
static pthread_cond_t cond;
static pthread_attr_t attr;

static size_t tcnt=0;
static void* idle_func(void* arg)
{
pthread_mutex_lock(&cond_mut);
tcnt++;
pthread_cond_wait(&cond,&cond_mut);
pthread_mutex_unlock(&cond_mut);
return NULL;
}

int main(int argc, char* argv[])
{
pthread_t* threads;
size_t cnt, i;


if(argc!=2) {
fprintf(stderr,"Usage:%s <number of threads>\n",argv[0]);
return 1;
}
cnt = atoi(argv[1]);
threads = malloc(cnt*sizeof(*threads));
if(!threads) {
perror("Malloc failed");
return 2;
}
pthread_mutex_init(&cond_mut,NULL);
pthread_cond_init(&cond, NULL);
if(pthread_attr_init(&attr)) {
fprintf(stderr,"pthread_attr_init failed\n");
return 3;
}
if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)) {
fprintf(stderr,"pthread_attr_setdetachstate failed\n");
return 4;
}
printf("Creating %u threads\n",cnt);
for(i=0;i<cnt;i++) {
int rc = pthread_create(&threads[i],&attr,idle_func,NULL);
if(rc) {
fprintf(stderr,"pthread_create failed:%s\n",strerror(rc));
return 5;
}
}
printf("Waiting for threads to start\n");
while(tcnt!=cnt)
sched_yield();
printf("Signaling threads\n");
pthread_mutex_lock(&cond_mut);
pthread_cond_broadcast(&cond);
pthread_mutex_unlock(&cond_mut);
free(threads);
return 0;
}
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net


george at galis

Jun 22, 2007, 11:28 AM

Post #3 of 3 (1409 views)
Permalink
Re: pthread_create failed [In reply to]

On Tue, Jun 19, 2007 at 09:23:45PM +0300, T?r?k Edvin wrote:
>On 6/19/07, George Georgalis <george [at] galis> wrote:
>> A week or so ago clamd stopped working for me,
>> after upgrading to 0.90.3 --experimental I still get
>> an unusable system.
>>
>> Linux ohm 2.4.20-ohm #1 Sat Jan 11 01:41:24 EST 2003 i586 unknown
>>
>> 2007-06-19 00:46:18.927419500 Reading databases from /usr/local/share/clamav
>> 2007-06-19 00:46:20.709107500 /var/qmail/prequeue/1182228387.M945008P19386.ohm: OK
>> 2007-06-19 00:49:44.064874500 Database correctly reloaded (127862 signatures)
>> 2007-06-19 00:49:44.090803500 ERROR: pthread_create failed
>> 2007-06-19 00:49:44.094281500 ERROR: pthread_create failed
>> 2007-06-19 00:49:44.096545500 ERROR: pthread_create failed
>> 2007-06-19 00:49:44.098762500 ERROR: pthread_create failed
>> 2007-06-19 00:51:30.004529500 ERROR: pthread_create failed
>>
>
>Do you have some limits on number of processes (ulimit -a)?

The only limit I have is 42006000 bytes memory. Prior to recent
problems (and I think fresh clam was disabled in cron since ???)
it was 40000000.

Do you think that was it?

I had max 5 tcp:25 connections, I've bumped that down to 3 (that
didn't fix anything even at 2).

>What is your MaxThreads setting in clamd.conf?

default. (20?)

>If you think those limits are ok, open a bugreport on the bugzilla,
>and attach the above info,
>and possibly an strace output.

it may be hard to reproduce at this point. I was never able to
cause it, nor could I identify anything particular about the
messages other than they where short spam/junk. I would get the
clamd warnings in log, and 5 clamdscan process hung with their
respective files from ps. The files themselves where typically
.5 to 1.5 kbytes header and some garbage message. it would take
from 1 minute to 6 hours for the problem mails to stop the system
(process about 1000 port 25 connections per day). The mails would
be from different IPs and I didn't check envelope info.

Haven't had one problem with
ClamAV 0.91rc1/3493/Fri Jun 22 05:18:44 2007
which I built shortly after my message.

thanks for the program, please let me know if the above info would
be useful in bugzilla, I'll detail out the context and post there.

// George



--
George Georgalis, information systems scientist <IXOYE><
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

ClamAV devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.