[OpenSER-Devel] [ openser-Bugs-1933666 ] leftover timer structures during shutdown

SourceForge.net noreply at sourceforge.net
Thu Apr 3 21:49:40 CEST 2008


Bugs item #1933666, was opened at 2008-04-03 15:06
Message generated for change (Comment added) made by osas
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1933666&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: ver devel
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ovidiu Sas (osas)
Assigned to: Nobody/Anonymous (nobody)
Summary: leftover timer structures during shutdown

Initial Comment:
Whenever a timer is set, the allocated memory is not released on shutdown:
0. N  address=0x81abe2c frag=0x81abe14 size=28 used=1 
      alloc'd from timer.c: new_sr_timer(151) 
  start check=f0f0f0f0, end check= c0c0c0c0, abcdefed 
...
6. N  address=0x81abfd0 frag=0x81abfb8 size=28 used=1 
      alloc'd from timer.c: new_sr_timer(151) 
  start check=f0f0f0f0, end check= c0c0c0c0, abcdefed

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

>Comment By: Ovidiu Sas (osas)
Date: 2008-04-03 15:49

Message:
Logged In: YES 
user_id=1395524
Originator: YES

The following patch seems to cure the issue:
Index: timer.c
===================================================================
--- timer.c	(revision 3974)
+++ timer.c	(working copy)
@@ -130,6 +130,33 @@
 
 void destroy_timer(void)
 {
+	struct sr_timer_process *tpl = timer_proc_list;
+	struct sr_timer_process *next_tpl;
+	struct sr_timer *t;
+	struct sr_timer *next_t;
+
+	while (tpl) {
+		next_tpl = tpl->next;
+
+		t = tpl->timer_list;
+		while (t) {
+			next_t = t->next;
+			pkg_free(t);
+			t = next_t;
+		}
+
+		t = tpl->utimer_list;
+		while (t) {
+			next_t = t->next;
+			pkg_free(t);
+			t = next_t;
+		}
+
+		pkg_free(tpl);
+		tpl = next_tpl;
+	}
+	timer_proc_list = NULL;
+
 	if (jiffies){
 #ifdef SHM_MEM
 		shm_free(jiffies); jiffies=0;


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

Comment By: Ovidiu Sas (osas)
Date: 2008-04-03 15:11

Message:
Logged In: YES 
user_id=1395524
Originator: YES

Same for the timer_process_list:
251. N  address=0x81b436c frag=0x81b4354 size=16 used=1 
        alloc'd from timer.c: new_timer_process_list(70) 
    start check=f0f0f0f0, end check= c0c0c0c0, abcdefed

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1933666&group_id=139143



More information about the Devel mailing list