Very import, but rarely used, patch...

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Lee McLoughlin
Fecha:  
A: exim-users
Asunto: Very import, but rarely used, patch...
After a system crash on SunSITE UK the system started complaining about
lack of memory (BTW SunSITE is *big*)!

After much faffing around I found that the reason for running out of
memory was a rogue exim!

I eventully tracked it down to a corrupt q file. Basically a block of
nulls had been tacked onto the end of the file, probably as a result of
the system crash while writing. A couple of loops in spool_read_header
were not spotting the nulls and were infinitely looping.

Result no more swap!

The following patch overcomes the problem. I think the loops in
question need to be investigated more closely as my patch isn't a
general solution.

    Lee




--
Lee McLoughlin.                         Phone: +44 171 594 8388
IC-Parc, Imperial College,              Fax:   +44 171 594 8449
South Kensington, London. SW7 2BZ. UK.  Email: L.McLoughlin@???

*** spool_in.c.ORIG    Thu Apr 4 20:39:00 1996
--- spool_in.c    Thu Apr  4 20:34:50 1996
***************
*** 242,247 ****
--- 242,251 ----
    int nn;
    char *receiver;
    if (fgets(big_buffer, BIG_BUFFER_SIZE, f) == NULL) goto SPOOL_READ_ERROR;
+   /* LMJM: Look out for a block of nulls in a file - this can happen if
+    * the system crashes while writing a file.  If you get this skip the
+    * file */
+   if (big_buffer[0] == '\0') goto SPOOL_FORMAT_ERROR;
    nn = (int)strlen(big_buffer);
    receiver = store_malloc(nn);
    big_buffer[nn-1] = 0;
***************
*** 261,267 ****
    if (fgets(big_buffer, BIG_BUFFER_SIZE, f) == NULL) goto SPOOL_READ_ERROR;
    if (big_buffer[0] != '\n') goto SPOOL_FORMAT_ERROR;


!   while ((n = fgetc(f)) != EOF)
      {
      header_line *h;
      char flag[4]; 
--- 265,274 ----
    if (fgets(big_buffer, BIG_BUFFER_SIZE, f) == NULL) goto SPOOL_READ_ERROR;
    if (big_buffer[0] != '\n') goto SPOOL_FORMAT_ERROR;


!   /* LMJM: Look out for a block of nulls in a file - this can happen if
!    * the system crashes while writing a file.  If you get this skip the
!    * file */
!   while ((n = fgetc(f)) != EOF && n != 0)
      {
      header_line *h;
      char flag[4];