From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Marco Monguzzi" To: "Hugo 'NOx' Tyson" Cc: Subject: RE: [ECOS] problems with MBUFs (TCP/IP stack) Date: Tue, 11 Jul 2000 08:38:00 -0000 Message-id: References: X-SW-Source: 2000-07/msg00107.html > I've seen the out-of-mbufs issue in a variant of the ping test that I'm > playing with, but as usual, it was cured by remembering to close > the socket > when I'm done with it. That cures it anyway, it seems. > > Maybe it depends on what you do with the socket even if you do close it? > > Just a data point. Hello. Even the below (dummy) client works (running on target server_test.c that shows the MBUFs counter we got no problems). The problem (the MBUFs not freed that generate the panic/warning) occours using the telnet client via shell (or with this code if you comment the line "close(sockfd);"). In other words, when only the server closes the connection. We observed the same path running the Web server. The connection is established, the web server honours the HTTP request and it closes (two steps: shutdown() in SHUT_WR mode + close() ). But, at the end, the MBUF counter shows that one MBUF has not been freed for each request served. Regards, Marco %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #include #include #include #include #include #define SERVER_HOST_ADDR "192.168.0.116" //target IP #define SERVER_TCP_PORT 7734 #define NTIMES 100 int main(int argc, char* argv[]){ int sockfd, len, ii; struct sockaddr_in serv_addr; char out[256]; char in[256]; if(argc != 2){ printf("usage: client_test \"string to be sent\"\n"); exit(-1); } strcpy(out, argv[1]); bzero((char*) &serv_addr, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = inet_addr(SERVER_HOST_ADDR); serv_addr.sin_port = htons(SERVER_TCP_PORT); for(ii=0; ii