Can bogofilter run by multiprocess at the same time

陈治璋 john.chen at net263.com
Wed Oct 13 12:37:49 CEST 2004



> .™...’. <john.chen at net263.com> writes:
> 
> > The folloing code can produce a deadlock in bogofilter : 
> 
> Does it produce an actual deadlock or just make slow progress?
It's an actual deadlock. There are many bogofilter processes and they
process id remains the same for ever.



> 
> > uname -a : 
> > Linux xmail 2.4.2-2smp #1 SMP Sun Apr 8 20:21:34 EDT 2001 i686 unknown
> > gcc -v :
> > gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)
> >
> >
> > My question is: Can bogofilter run by multiprocess at the same time?
> 
> Yes, it can.
> 
> I have fixed some bugs in the locking implementation of the TXN variant
> but these have apparently not had any practical impact except running
> recovery a bit more often...
> 
> I have run your test program on Solaris 8 afterwards (with the
> alternative pthreads implementation) without seeing any deadlocks.
> 
> Note that older glibc (2.1.X, 2.2.3 and older) are broken in that their
> popen isn't thread-safe - and you may have this very problem as you're
> running a very old distribution of which I'd think it has glibc 2.1.
Yes, I'm using glibc 2.1 in Linux. But in Solaris 2.8, I tested it again
by replacing the following function and it blocks:

void* bogo_check(void* p)
{
                                                                                
   for(int i = 0; i < 10000; i ++){
      const char* s_email = "ham.eml";
      if (i%2){
         s_email= "spam.eml";
      }
      string email = get_email(s_email);
      FILE* file = popen("bogofilter", "w");
      signal(SIGPIPE,   SIG_IGN);
      if (file == NULL)
      {
         perror("popen");
      }
      fputs(email.c_str(), file);
      int   status = pclose(file);
   }
   return NULL;
}

The libraries it used:

        libpthread.so.1 =>       /usr/lib/libpthread.so.1
        libstdc++.so.2.10.0 =>   /usr/local/lib/libstdc++.so.2.10.0
        libm.so.1 =>     /usr/lib/libm.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libthread.so.1 =>        /usr/lib/libthread.so.1
        /usr/platform/SUNW,Ultra-60/lib/libc_psr.so.1

And it blocks at vfork().



> 
> Which BerkeleyDB version BTW?
In solaris, the BerkeyDB is 4.2. In Linux it's libdb-3.1.so =>
/lib/libdb-3.1.so (0x40046000)






More information about the bogofilter-dev mailing list