Date: Fri, 16 Aug 2002 11:52:26 -0700 (PDT) From: Harsha Bellur <hbellur@utstar.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/41717: Memory Leak in FreeBSD Message-ID: <200208161852.g7GIqQJe053007@www.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 41717 >Category: misc >Synopsis: Memory Leak in FreeBSD >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Aug 16 12:00:04 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Harsha Bellur >Release: ??? Freebsd version used in RTEMS 4.5 >Organization: >Environment: RTEMS 4.5 >Description: | | ---------- ---------- | | | | | ETH | | NODE A | PT-PT LINK | NODE B |----------| 172.16.40.1 | |---------------------- | | | ---------- ---------- | | Node A IP : 172.16.17.124 NODE B IP : 172.16.40.122 NODE A adds NODE B's IP as its default gateway Here's the routing table for NODE B Destination Gateway/Mask/Hw Flags Refs Use Interface default 172.16.40.122 UGSW 1744 289 serial0 127.0.0.1/0 127.0.0.1 UHb 0 0 lo0 172.16.17.124/32 127.0.0.1 UH 0 0 lo0 172.16.40.0/24 172.16.40.122 UGW 1 7 serial0 172.16.40.122/32 172.16.17.124 UH 1746 0 serial0 TEST EXECUTED: . NODE B is reset every 30-40 seconds. Everytime the PT-PT interface goes down NODE A deletes the default gateway and the routes associated with it and Adds it when the interface is back up and running PROBLEM REPORT: This process of adding and deleting routes is causing memory loss in NODE A I found out the places in the freebsd code where the memory is allocated but not freed. (which may be of some help) Memory leak doesnot happen everytime these lines of code are executed. 1. route.c rtrequest() makeroute: R_Malloc(rt, struct rtentry *, sizeof(*rt)); if (rt == 0) senderr(ENOBUFS); Bzero(rt, sizeof(*rt)); 2. route.c rt_setgate() if (rt->rt_gateway == 0 || glen > ROUNDUP(rt->rt_gateway->sa_len)) { old = (caddr_t)rt_key(rt); R_Malloc(new, caddr_t, dlen + glen); if (new == 0) return ENOBUFS; 3. in.c in_control() case SIOCSIFDSTADDR: if (p && (error = suser(p)) != 0) return error; if (ifp == 0) return (EADDRNOTAVAIL); if (ia == (struct in_ifaddr *)0) { ia = (struct in_ifaddr *) malloc(sizeof *ia, M_IFADDR, M_WAITOK); if (ia == (struct in_ifaddr *)NULL) return (ENOBUFS); >How-To-Repeat: NODE B is reset every 30-40 seconds. Everytime the PT-PT interface goes down NODE A deletes the default gateway and the routes associated with it and Adds it when the interface is back up and running >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208161852.g7GIqQJe053007>