Can you test with current CVS HEAD? I have a device with four TCP servers 
(HTTP, Telnet, audio a video server), and I never got such problem... 
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : [EMAIL PROTECTED] 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Nicolas Pinault
Envoyé : mercredi 13 juin 2007 13:39
À : [email protected]
Objet : [lwip-users] Sys.c bug


Hi all,

I have the following :
- 2 tasks that use a socket each in server mode.
- System starts up : ok
- Each task waits for a connection (accept) : ok
- Connections are established by a client : ok
- Both connections are stopped by client : ok
- Both tasks close connection and wait for another connection (accept): ok
- After 70 seconds the system crashes because of a NULL pointer access.
- If a client reconnects before 70sec, it is ok.
- When connection is closed, the system crashes 70sec after the 
connection has been closed (task are waiting for a connection).

All versions of lwip are concerned.
I am currently using lwip V1.2.0

I have solved the problem by modifying sys_mbox_fetch function in sys.c 
module :

.
.
.
    if (time == SYS_ARCH_TIMEOUT) {
      /* If time == SYS_ARCH_TIMEOUT, a timeout occured before a message
   could be fetched. We should now call the timeout handler and
   deallocate the memory allocated for the timeout. */
      tmptimeout = timeouts->next;
      if (tmptimeout != NULL)                           /* ADDED */
      {
        timeouts->next = tmptimeout->next;
        h = tmptimeout->h;
        arg = tmptimeout->arg;
        memp_free(MEMP_SYS_TIMEOUT, tmptimeout);
        if (h != NULL) {
          LWIP_DEBUGF(SYS_DEBUG, ("smf calling h=%p(%p)\n", (void *)h, 
(void *)arg));
            h(arg);
        }
      }
      /* We try again to fetch a message from the mbox. */
      goto again;
    } else {
.
.
.

I'm afraid this hides a more serious problem.

Nicolas


_______________________________________________
lwip-users mailing list
[email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
BEGIN:VCARD
VERSION:2.1
N:BERNON;Frédéric;;M.
FN:Frédéric BERNON
ORG:HYMATOM SA;Recherche et Développement
TITLE:Chef de projet informatique
TEL;WORK;VOICE:04-67-87-61-10
TEL;WORK;FAX:04-67-70-85-44
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;23;Zone Industrielle=0D=0A175 rue de Massacan;VENDARGUES;;34740;FRANCE;
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:23=0D=0AZone Industrielle=0D=0A175 rue de Massacan=0D=0AVENDARGUES 34740=0D=
=0AFrance
URL;WORK:http://www.hymatom.fr
ROLE:Chef de projet informatique
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20020404T083210Z
END:VCARD
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to