public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] SNMP package memory leak
@ 2002-06-03  7:15 Roland Caßebohm
  2002-06-03  7:24 ` Roland Caßebohm
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Caßebohm @ 2002-06-03  7:15 UTC (permalink / raw)
  To: ecos-discuss

I have found a memory leak in the SNMP package and put the patches as 
attachments to this mail.

Another problem seems to be SNMP package is not thread save. If I want to use 
the SNMP as agent and as client, both of them want to use the same resources.
As an example there is one global list of users (userList). If the client 
wants to send a request to the agent (over localhost with v3), the client 
looks at the global user list and found the user in it with the corresponding 
password key (it's the one from the agent). The request uses this one instead 
of the self generated key and of course get a positive answer.
Maybe I change the source code so that the userList is a part of a session 
structure. Because of the client and the agent have different sessions they 
allthough have then different userlists.

If somebody has made something like this please let me know.


Thanks,
Roland


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] SNMP package memory leak
  2002-06-03  7:15 [ECOS] SNMP package memory leak Roland Caßebohm
@ 2002-06-03  7:24 ` Roland Caßebohm
  2002-06-03  7:35   ` Gary Thomas
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Caßebohm @ 2002-06-03  7:24 UTC (permalink / raw)
  To: ecos-discuss

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

On Monday, 3. June 2002 16:15, Roland Caßebohm wrote:
> I have found a memory leak in the SNMP package and put the patches as
> attachments to this mail.
>
> Another problem seems to be SNMP package is not thread save. If I want to
> use the SNMP as agent and as client, both of them want to use the same
> resources. As an example there is one global list of users (userList). If
> the client wants to send a request to the agent (over localhost with v3),
> the client looks at the global user list and found the user in it with the
> corresponding password key (it's the one from the agent). The request uses
> this one instead of the self generated key and of course get a positive
> answer.
> Maybe I change the source code so that the userList is a part of a session
> structure. Because of the client and the agent have different sessions they
> allthough have then different userlists.
>
> If somebody has made something like this please let me know.
>
>
> Thanks,
> Roland

Have forget the attachments!

[-- Attachment #2: snmp_agent.diff --]
[-- Type: text/x-diff, Size: 469 bytes --]

--- /opt/ecos/ecoscvs_old/packages/net/snmp/agent/current/src/snmp_agent.c	Thu Jan 24 12:29:42 2002
+++ /opt/ecos/ecoscvs/packages/net/snmp/agent/current/src/snmp_agent.c	Thu May 30 17:25:22 2002
@@ -367,6 +370,9 @@
             asp->pdu->command = SNMP_MSG_RESPONSE;
             snmp_increment_statistic(STAT_SNMPOUTPKTS);
             snmp_send( asp->session, asp->pdu );
+	    free(asp);
             return 1;
         } else {
             /* drop the request */

[-- Attachment #3: agent_trap.diff --]
[-- Type: text/x-diff, Size: 492 bytes --]

--- /opt/ecos/ecoscvs_old/packages/net/snmp/agent/current/src/agent_trap.c	Thu Jan 24 12:29:41 2002
+++ /opt/ecos/ecoscvs/packages/net/snmp/agent/current/src/agent_trap.c	Thu May 30 17:47:47 2002
@@ -388,7 +388,13 @@
 		break;
 	case SNMP_TRAP_AUTHFAIL:
 		if (snmp_enableauthentraps == SNMP_AUTHENTICATED_TRAPS_DISABLED)
+		{
+		    snmp_free_pdu( template_pdu );
 		    return;
+		}
+
 		snmp_set_var_value( &snmptrap_var,
 				    (u_char *)auth_fail_oid,
 				    sizeof(auth_fail_oid));

[-- Attachment #4: Type: text/plain, Size: 146 bytes --]

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] SNMP package memory leak
  2002-06-03  7:24 ` Roland Caßebohm
@ 2002-06-03  7:35   ` Gary Thomas
  2002-06-03  8:35     ` Roland Caßebohm
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Thomas @ 2002-06-03  7:35 UTC (permalink / raw)
  To: Roland Caßebohm; +Cc: eCos Discussion

On Mon, 2002-06-03 at 08:24, Roland Caßebohm wrote:
> On Monday, 3. June 2002 16:15, Roland Caßebohm wrote:
> > I have found a memory leak in the SNMP package and put the patches as
> > attachments to this mail.
> >
> > Another problem seems to be SNMP package is not thread save. If I want to
> > use the SNMP as agent and as client, both of them want to use the same
> > resources. As an example there is one global list of users (userList). If
> > the client wants to send a request to the agent (over localhost with v3),
> > the client looks at the global user list and found the user in it with the
> > corresponding password key (it's the one from the agent). The request uses
> > this one instead of the self generated key and of course get a positive
> > answer.
> > Maybe I change the source code so that the userList is a part of a session
> > structure. Because of the client and the agent have different sessions they
> > allthough have then different userlists.
> >
> > If somebody has made something like this please let me know.
> >
> >
> > Thanks,
> > Roland

Can you check these against the latest anonymous CVS sources?  There 
have been changes in this area recently, especially wrt memory leaks.



--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] SNMP package memory leak
  2002-06-03  7:35   ` Gary Thomas
@ 2002-06-03  8:35     ` Roland Caßebohm
  2002-06-03  8:39       ` Gary Thomas
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Caßebohm @ 2002-06-03  8:35 UTC (permalink / raw)
  To: Gary Thomas; +Cc: eCos Discussion

On Monday, 3. June 2002 16:35, Gary Thomas wrote:
> On Mon, 2002-06-03 at 08:24, Roland Caßebohm wrote:
> > On Monday, 3. June 2002 16:15, Roland Caßebohm wrote:
> > > I have found a memory leak in the SNMP package and put the patches as
> > > attachments to this mail.
> > >
> > > Another problem seems to be SNMP package is not thread save. If I want
> > > to use the SNMP as agent and as client, both of them want to use the
> > > same resources. As an example there is one global list of users
> > > (userList). If the client wants to send a request to the agent (over
> > > localhost with v3), the client looks at the global user list and found
> > > the user in it with the corresponding password key (it's the one from
> > > the agent). The request uses this one instead of the self generated key
> > > and of course get a positive answer.
> > > Maybe I change the source code so that the userList is a part of a
> > > session structure. Because of the client and the agent have different
> > > sessions they allthough have then different userlists.
> > >
> > > If somebody has made something like this please let me know.
> > >
> > >
> > > Thanks,
> > > Roland
>
> Can you check these against the latest anonymous CVS sources?  There
> have been changes in this area recently, especially wrt memory leaks.

Last friday I have checked against the cvs sources at 
ftp://ftp.skynet.ie/cvs/ecos/, but the leaks were still there.

Roland

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] SNMP package memory leak
  2002-06-03  8:35     ` Roland Caßebohm
@ 2002-06-03  8:39       ` Gary Thomas
  0 siblings, 0 replies; 5+ messages in thread
From: Gary Thomas @ 2002-06-03  8:39 UTC (permalink / raw)
  To: Roland Caßebohm; +Cc: eCos Discussion

On Mon, 2002-06-03 at 09:35, Roland Caßebohm wrote:
> On Monday, 3. June 2002 16:35, Gary Thomas wrote:
> > On Mon, 2002-06-03 at 08:24, Roland Caßebohm wrote:
> > > On Monday, 3. June 2002 16:15, Roland Caßebohm wrote:
> > > > I have found a memory leak in the SNMP package and put the patches as
> > > > attachments to this mail.
> > > >
> > > > Another problem seems to be SNMP package is not thread save. If I want
> > > > to use the SNMP as agent and as client, both of them want to use the
> > > > same resources. As an example there is one global list of users
> > > > (userList). If the client wants to send a request to the agent (over
> > > > localhost with v3), the client looks at the global user list and found
> > > > the user in it with the corresponding password key (it's the one from
> > > > the agent). The request uses this one instead of the self generated key
> > > > and of course get a positive answer.
> > > > Maybe I change the source code so that the userList is a part of a
> > > > session structure. Because of the client and the agent have different
> > > > sessions they allthough have then different userlists.
> > > >
> > > > If somebody has made something like this please let me know.
> > > >
> > > >
> > > > Thanks,
> > > > Roland
> >
> > Can you check these against the latest anonymous CVS sources?  There
> > have been changes in this area recently, especially wrt memory leaks.
> 
> Last friday I have checked against the cvs sources at 
> ftp://ftp.skynet.ie/cvs/ecos/, but the leaks were still there.

Sorry, my mistake, I was thinking about the DNS code (which did have 
some memory leak problems fixed recently).


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-06-03 15:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-03  7:15 [ECOS] SNMP package memory leak Roland Caßebohm
2002-06-03  7:24 ` Roland Caßebohm
2002-06-03  7:35   ` Gary Thomas
2002-06-03  8:35     ` Roland Caßebohm
2002-06-03  8:39       ` Gary Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).