Send inn-workers mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/inn-workers
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-workers digest..."


Today's Topics:

   1. Re: INN 2.5.4 strange crash (Julien ?LIE)
   2. Re: INN 2.5.4 strange crash (Julien ?LIE)
   3. Re: INN 2.5.4 strange crash (Petr Novopashenniy)
   4. Re: INN 2.5.4 strange crash (Petr Novopashenniy)


----------------------------------------------------------------------

Message: 1
Date: Wed, 21 Jan 2015 21:24:33 +0100
From: Julien ?LIE <[email protected]>
To: [email protected]
Subject: Re: INN 2.5.4 strange crash
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252

Hi Petr,

>> Are you still regularly seeing segfaults?
> 
> Yes, frequently:
> 
> ftp://ftp.neva.ru/tmp/innd_check.log

Still when news.daily runs (as you already told us).


>> No line like
>>   "%s number of descriptors (%d) exceeding or equaling FD_SETSIZE (%d)"
>>   "free but was in WMASK"
>>   "free but was in RMASK"
>> in your news logs?
> 
> Hardly ever - "free:-1 20 free but was in SMASK"

Which indicates there is somewhere a bug in channel handling.
For a reason I still do not know, a sleeping channel is closed without updating
its state in the global variable that tracks the currently opened sleeping 
channels.


>> Well, though cp->Waker should not be NULL at that line, could you please try
>> the following change and tell us whether the issue is still present?
> 
> Thanks, Julien, I apply this patch and wait now...

I hope it will solve the segfaults.

Incidentally, I have a better patch that will log "%s %d sleeping without Waker"
when the issue occurs.  It will normally not segfault.
I also fixed a bug in the count of sleeping channels; it was not always updated,
and the newly highest file descriptor related to a sleeping channel wasn't also
always updated.

If you could use that patch and report us occurrences of "%s %d sleeping 
without Waker",
it would be great.  It will maybe give a hint about what is happening.


--- chan.c      (r?vision 9776)
+++ chan.c      (copie de travail)
@@ -571,6 +571,21 @@
 
 
 /*
+**  When removing a channel from the sleep mask, we want to lower the last
+**  file descriptor if we removed the highest one.  Called from SCHANremove.
+*/
+static void
+CHANresetlastsleeping(int fd)
+{
+    if (fd == channels.max_sleep_fd) {
+        while (   !FD_ISSET(channels.max_sleep_fd, &channels.sleep_set)
+               && channels.max_sleep_fd > 1)
+            channels.max_sleep_fd--;
+    }
+}
+
+
+/*
 **  Mark a channel as an active reader.
 */
 void
@@ -629,8 +644,6 @@
 void
 SCHANremove(CHANNEL *cp)
 {
-    int fd;
-
     if (!CHANsleeping(cp))
         return;
     FD_CLR(cp->fd, &channels.sleep_set);
@@ -638,12 +651,7 @@
     cp->Waketime = 0;
 
     /* If this was the highest descriptor, get a new highest. */
-    if (cp->fd == channels.max_sleep_fd) {
-        fd = channels.max_sleep_fd;
-        while (!FD_ISSET(fd, &channels.sleep_set) && fd > 1)
-            fd--;
-        channels.max_sleep_fd = fd;
-    }
+    CHANresetlastsleeping(cp->fd);
 }
 
 
@@ -1276,12 +1284,18 @@
                 if (cp->Type == CTfree) {
                     warn("%s %d free but was in SMASK", CHANname(cp), fd);
                     FD_CLR(fd, &channels.sleep_set);
+                    channels.sleep_count--;
+                    CHANresetlastsleeping(fd);
                     close(fd);
                     cp->fd = -1;
                 } else {
                     cp->LastActive = Now.tv_sec;
                     SCHANremove(cp);
-                    (*cp->Waker)(cp);
+                    if (cp->Waker != NULL) {
+                        (*cp->Waker)(cp);
+                    } else {
+                        warn("%s %d sleeping without Waker", CHANname(cp), fd);
+                    }
                 }
             }
 



-- 
Julien ?LIE

? M?me avec Dieu, il ne faut pas tenter le Diable. ? (Raymond
  Devos)


------------------------------

Message: 2
Date: Wed, 21 Jan 2015 21:34:12 +0100
From: Julien ?LIE <[email protected]>
To: [email protected]
Subject: Re: INN 2.5.4 strange crash
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed

>>> No line like
>>>    "%s number of descriptors (%d) exceeding or equaling FD_SETSIZE (%d)"
>>>    "free but was in WMASK"
>>>    "free but was in RMASK"
>>> in your news logs?
>>
>> Hardly ever - "free:-1 20 free but was in SMASK"

Also, do you have occurrences of "internal closing free channel" in your
logs?

-- 
Julien ?LIE

? M?me avec Dieu, il ne faut pas tenter le Diable. ? (Raymond
   Devos)


------------------------------

Message: 3
Date: Thu, 22 Jan 2015 13:19:59 +0300 (MSK)
From: Petr Novopashenniy <[email protected]>
To: Julien ?LIE <[email protected]>
Cc: [email protected]
Subject: Re: INN 2.5.4 strange crash
Message-ID: <[email protected]>
Content-Type: TEXT/PLAIN; charset=US-ASCII



On Wed, 21 Jan 2015, Julien ?LIE wrote:

J?? Hi Petr,
J?? 
J?? >> Are you still regularly seeing segfaults?
J?? > 
J?? > Yes, frequently:
J?? > 
J?? > ftp://ftp.neva.ru/tmp/innd_check.log
J?? 
J?? Still when news.daily runs (as you already told us).

Yes.

J?? 
J?? 
J?? >> No line like
J?? >>   "%s number of descriptors (%d) exceeding or equaling FD_SETSIZE (%d)"
J?? >>   "free but was in WMASK"
J?? >>   "free but was in RMASK"
J?? >> in your news logs?
J?? > 
J?? > Hardly ever - "free:-1 20 free but was in SMASK"
J?? 
J?? Which indicates there is somewhere a bug in channel handling.
J?? For a reason I still do not know, a sleeping channel is closed without 
updating
J?? its state in the global variable that tracks the currently opened sleeping 
channels.
J?? 
J?? 
J?? >> Well, though cp->Waker should not be NULL at that line, could you please 
try
J?? >> the following change and tell us whether the issue is still present?
J?? > 
J?? > Thanks, Julien, I apply this patch and wait now...
J?? 
J?? I hope it will solve the segfaults.

No crashes after 2 day run.

J?? 
J?? Incidentally, I have a better patch that will log "%s %d sleeping without 
Waker"
J?? when the issue occurs.  It will normally not segfault.
J?? I also fixed a bug in the count of sleeping channels; it was not always 
updated,
J?? and the newly highest file descriptor related to a sleeping channel wasn't 
also
J?? always updated.
J?? 
J?? If you could use that patch and report us occurrences of "%s %d sleeping 
without Waker",
J?? it would be great.  It will maybe give a hint about what is happening.
J?? 
J?? 
J?? --- chan.c  (r?vision 9776)
J?? +++ chan.c  (copie de travail)
J?? @@ -571,6 +571,21 @@
J??  
J??  
J??  /*
J?? +**  When removing a channel from the sleep mask, we want to lower the last
J?? +**  file descriptor if we removed the highest one.  Called from 
SCHANremove.
J?? +*/
J?? +static void
J?? +CHANresetlastsleeping(int fd)
J?? +{
J?? +    if (fd == channels.max_sleep_fd) {
J?? +        while (   !FD_ISSET(channels.max_sleep_fd, &channels.sleep_set)
J?? +               && channels.max_sleep_fd > 1)
J?? +            channels.max_sleep_fd--;
J?? +    }
J?? +}
J?? +
J?? +
J?? +/*
J??  **  Mark a channel as an active reader.
J??  */
J??  void
J?? @@ -629,8 +644,6 @@
J??  void
J??  SCHANremove(CHANNEL *cp)
J??  {
J?? -    int fd;
J?? -
J??      if (!CHANsleeping(cp))
J??          return;
J??      FD_CLR(cp->fd, &channels.sleep_set);
J?? @@ -638,12 +651,7 @@
J??      cp->Waketime = 0;
J??  
J??      /* If this was the highest descriptor, get a new highest. */
J?? -    if (cp->fd == channels.max_sleep_fd) {
J?? -        fd = channels.max_sleep_fd;
J?? -        while (!FD_ISSET(fd, &channels.sleep_set) && fd > 1)
J?? -            fd--;
J?? -        channels.max_sleep_fd = fd;
J?? -    }
J?? +    CHANresetlastsleeping(cp->fd);
J??  }
J??  
J??  
J?? @@ -1276,12 +1284,18 @@
J??                  if (cp->Type == CTfree) {
J??                      warn("%s %d free but was in SMASK", CHANname(cp), fd);
J??                      FD_CLR(fd, &channels.sleep_set);
J?? +                    channels.sleep_count--;
J?? +                    CHANresetlastsleeping(fd);
J??                      close(fd);
J??                      cp->fd = -1;
J??                  } else {
J??                      cp->LastActive = Now.tv_sec;
J??                      SCHANremove(cp);
J?? -                    (*cp->Waker)(cp);
J?? +                    if (cp->Waker != NULL) {
J?? +                        (*cp->Waker)(cp);
J?? +                    } else {
J?? +                        warn("%s %d sleeping without Waker", CHANname(cp), 
fd);
J?? +                    }
J??                  }
J??              }
J??  

I apply your patch (from your private mail, for INN 2.5.4, I see two new 
lines channels.sleep_count--; and CHANresetlastsleeping(fd); ), 
and waiting results.

Thanks, Julien!

--pety



------------------------------

Message: 4
Date: Thu, 22 Jan 2015 13:22:39 +0300 (MSK)
From: Petr Novopashenniy <[email protected]>
To: Julien ?LIE <[email protected]>
Cc: [email protected]
Subject: Re: INN 2.5.4 strange crash
Message-ID: <[email protected]>
Content-Type: TEXT/PLAIN; charset=US-ASCII



On Wed, 21 Jan 2015, Julien ?LIE wrote:

J?? > > > No line like
J?? > > >    "%s number of descriptors (%d) exceeding or equaling FD_SETSIZE
J?? > > > (%d)"
J?? > > >    "free but was in WMASK"
J?? > > >    "free but was in RMASK"
J?? > > > in your news logs?
J?? > > 
J?? > > Hardly ever - "free:-1 20 free but was in SMASK"
J?? 
J?? Also, do you have occurrences of "internal closing free channel" in your
J?? logs?

No, I have no such lines in my logs.

--pety



------------------------------

_______________________________________________
inn-workers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/inn-workers

End of inn-workers Digest, Vol 68, Issue 3
******************************************

Reply via email to