If I change to snmp_close(), actually it won't core-dump, but I think that is not right to do. Any thoughts?

From: "Haizhu Liu" <[EMAIL PROTECTED]>
To: [email protected]
Subject: RE: snmp_sess_close()
Date: Tue, 08 Nov 2005 16:23:48 -0500

I have a member function closeSession() and destructor that calls closeSession()

void mySession::closeSession()
{
 if(sessp != NULL && session_openned == true) {
   snmp_sess_close(sessp);
   sessp = NULL;
   SOCK_CLEANUP; // probably should not be here
   session_openned = false;
 }
}  // end closeSession

and

mySession::~mySession()
{
 if( sessp != NULL && session_openned == true)
  closeSession();
}  // end ~Session

If I comment out the actions in destructor, the code runs fine. I don't understand why. The core seems to yell on double free.

From: "Haizhu Liu" <[EMAIL PROTECTED]>
To: [email protected]
Subject: snmp_sess_close()
Date: Tue, 08 Nov 2005 12:32:42 -0500

Hi,

I am using the signle session API for multi-threaded application. I am calling SOCK_STARTUP and SOCK_CLEANUP from mainthread, the stack frame shows:


(gdb) where
#0  0x402ed4f9 in free () from /lib/libc.so.6
#1  0x40065360 in snmp_free_session () from /usr/lib/libnetsnmp.so.5
#2  0x400654a4 in snmp_sess_close () from /usr/lib/libnetsnmp.so.5

anybody can give a hint what could be wrong.

Thank you.




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to