[SNMP4J] Unsubscribe

Omair-Inam Abdul-Matin omairkhawaja at gmail.com
Mon Sep 27 12:01:25 CEST 2010


Unsubscribe

Sent from my iPhone

On 2010-09-27, at 7:00 AM, snmp4j-request at agentpp.org wrote:

> Send SNMP4J mailing list submissions to
>    snmp4j at agentpp.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>    http://lists.agentpp.org/mailman/listinfo/snmp4j
> or, via email, send a message with subject or body 'help' to
>    snmp4j-request at agentpp.org
> 
> You can reach the person managing the list at
>    snmp4j-owner at agentpp.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of SNMP4J digest..."
> 
> 
> Today's Topics:
> 
>   1. Remove row in table using the oid (Paulo Abreu)
>   2. SNMPv3 response is null when switch is rebooted (Wadood Ahmed)
>   3. Re: SNMPv3 response is null when switch is rebooted (Frank Fock)
>   4. Re: Another race condition fix    forDefaultUdpTransportMapping
>      (Tosoni)
>   5. Re: Another race condition fix    forDefaultUdpTransportMapping
>      (Paul Marquis)
>   6. Re: Another race condition fix    forDefaultUdpTransportMapping
>      (Tosoni)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sun, 26 Sep 2010 14:47:40 +0100
> From: "Paulo Abreu" <pauloabreu83 at gmail.com>
> Subject: [SNMP4J] Remove row in table using the oid
> To: <snmp4j at agentpp.org>
> Message-ID:
>    <!&!AAAAAAAAAAAYAAAAAAAAABdAwzuUoBNPrDNqPO2OCTwCgQAAEAAAAE/pD8wF+zpJkbDBuWutThEBAAAAAA==@gmail.com>
>    
> Content-Type: text/plain;    charset="us-ascii"
> 
> Can you help me using an example of how to remove a row from a table using
> the oid of this line?
> 
> 
> 
> Thanks
> 
> Paulo
> 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Sun, 26 Sep 2010 18:25:07 +0000 (UTC)
> From: Wadood Ahmed <ahsan_wadood at yahoo.com>
> Subject: [SNMP4J] SNMPv3 response is null when switch is rebooted
> To: snmp4j at agentpp.org
> Message-ID: <825317.60934.qm at web50302.mail.re2.yahoo.com>
> Content-Type: text/plain; charset=utf-8
> 
> Hello All,
> 
> I am newbie in SNMP domain. I have an issue with SNMPv3
> 
> I have SNMPv3 user and it works perfectly (read/write). But when i reboot the 
> switch - I get null response in snmp4j code. When I do a wireshark it shows 
> messages being sent/received - REPORT messages are being sent by the switch with 
> different authorization engine time and boot time.
> 
> Why does snmp4j not throw a REPORT error instead of response being null? Is this 
> a bug in snmp4j? If so, in which version is this fixed.
> 
> thanks
> Wadood
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Sun, 26 Sep 2010 20:32:26 +0200
> From: Frank Fock <fock at agentpp.com>
> Subject: Re: [SNMP4J] SNMPv3 response is null when switch is rebooted
> To: snmp4j at agentpp.org
> Message-ID: <4C9F91BA.4020105 at agentpp.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Hi,
> 
> Most likely, it is a bug in the switch. It does not increase
> its boot counter when it is rebooted. SNMP4J behaves
> as required by the USM standard.
> 
> Best regards,
> Frank
> 
> On 26.09.2010 20:25, Wadood Ahmed wrote:
>> Hello All,
>> 
>> I am newbie in SNMP domain. I have an issue with SNMPv3
>> 
>> I have SNMPv3 user and it works perfectly (read/write). But when i reboot the
>> switch - I get null response in snmp4j code. When I do a wireshark it shows
>> messages being sent/received - REPORT messages are being sent by the switch with
>> different authorization engine time and boot time.
>> 
>> Why does snmp4j not throw a REPORT error instead of response being null? Is this
>> a bug in snmp4j? If so, in which version is this fixed.
>> 
>> thanks
>> Wadood
>> 
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/snmp4j
> 
> -- 
> AGENT++
> http://www.agentpp.com
> http://www.snmp4j.com
> http://www.mibexplorer.com
> http://www.mibdesigner.com
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Mon, 27 Sep 2010 09:38:18 +0200
> From: "Tosoni" <jp.tosoni at acksys.fr>
> Subject: Re: [SNMP4J] Another race condition fix
>    forDefaultUdpTransportMapping
> To: "'Paul Marquis'" <paul at viridity.com>, "'Frank Fock'"
>    <fock at agentpp.com>
> Cc: snmp4j at agentpp.org
> Message-ID: <3C8870992A3A4AD0A0DA144178DD73F4 at acksys.local>
> Content-Type: text/plain;    charset="us-ascii"
> 
> Sorry guys, but I don't believe your tries fix the race for real.
> 
> The problem is that a socket.close() can occur just before the
> socket.receive()
> If you just test the socket value, this does not forbit a socket.close()
> happening *after*
> your test and *before* the socket.receive().> >           try {
>>>            DatagramSocket socketCopy = socket;
>>>            if (socketCopy == null) {
>>>              stop = true;
>>>              continue;
>>>            }
>    *** what if another thread closes at this point ? ***
>>>            socketCopy.receive(packet);
>>>          }
> 
> The real fix must use some semaphore or mutex which embraces:
>    on one hand, both the test of 'socket==null' and the receive()
>    on the other hand, both the change 'socket=null' and the close()
> 
> My own try (I do not suggest it as a correct fix) is a quick-and-dirty:
>          try {
>            socket.receive(packet);
>          }
>          catch (InterruptedIOException iiox) {
>            if (iiox.bytesTransferred <= 0) {
>              continue;
>            }
>          }
> +          // UGLY FIX: socket close/receive synchro
> +          catch (NullPointerException iiox) {
> +              // This handles the close race (stop=false but socket=null)
> +              continue;
> +        }
> 
> 
> Hmm, also, there is another race condition which happens sometimes, here:
>          public void run() {
>            try {
>    here===>    socket.setSoTimeout(getSocketTimeout());
> Really I guess it can happen everywhere 'socket' is used in a thread
> different than the closing thread...
> 
> Regards
> 
>> -----Original Message-----
>> From: snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org]On
>> Behalf Of Paul Marquis
>> Sent: Friday, September 24, 2010 1:32 AM
>> To: Frank Fock
>> Cc: snmp4j at agentpp.org
>> Subject: Re: [SNMP4J] Another race condition fix
>> forDefaultUdpTransportMapping
>> 
>> 
>> Thanks for fixing this!
>> 
>> Any idea when there will be an official release with this fix
>> in it?
>> I just joined the list, so if you've already discussed when the next
>> release will be available, I apologize.
>> 
>> On Sep 23, 2010, at 7:24 PM, Frank Fock wrote:
>> 
>>> Hi Paul,
>>> 
>>> Thank you for the bug report. If fixed it a bit different:
>>> 
>>>          try {
>>>            DatagramSocket socketCopy = socket;
>>>            if (socketCopy == null) {
>>>              stop = true;
>>>              continue;
>>>            }
>>>            socketCopy.receive(packet);
>>>          }
>>> 
>>> Best regards,
>>> Frank
>>> 
>>> On 23.09.2010 23:44, Paul Marquis wrote:
>>>> Version 1.11.1 of SNMP4J included a fix for a race condition in
>>>> DefautlUdpTrasnportMapping which caused a NullPointerException.
>>>> However, there is still one that remains while attempting to read a
>>>> packet and I see this from time to time.  Below is a patch
>> that fixes
>>>> the problem for me that I'd like to submit for review.
>>>> 
>>>> Index: src/org/snmp4j/transport/DefaultUdpTransportMapping.java
>>>> ===================================================================
>>>> ---
>> src/org/snmp4j/transport/DefaultUdpTransportMapping.java
>>>> (revision
>>>> 215)
>>>> +++
>> src/org/snmp4j/transport/DefaultUdpTransportMapping.java    (working
>>>> copy)
>>>> @@ -337,7 +337,11 @@
>>>> 
>>>> udpAddress.getPort());
>>>>          try {
>>>>            try {
>>>> -            socket.receive(packet);
>>>> +            DatagramSocket readingSocket = socket;
>>>> +            if (readingSocket == null) {
>>>> +              continue;
>>>> +            }
>>>> +            readingSocket.receive(packet);
>>>>            }
>>>>            catch (InterruptedIOException iiox) {
>>>>              if (iiox.bytesTransferred<= 0) {
>>>> 
>>>> _______________________________________________
>>>> SNMP4J mailing list
>>>> SNMP4J at agentpp.org
>>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>> 
>>> --
>>> AGENT++
>>> http://www.agentpp.com
>>> http://www.snmp4j.com
>>> http://www.mibexplorer.com
>>> http://www.mibdesigner.com
>>> 
>>> _______________________________________________
>>> SNMP4J mailing list
>>> SNMP4J at agentpp.org
>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>> 
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>> 
> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Mon, 27 Sep 2010 05:20:45 -0400
> From: Paul Marquis <paul at viridity.com>
> Subject: Re: [SNMP4J] Another race condition fix
>    forDefaultUdpTransportMapping
> To: "Tosoni" <jp.tosoni at acksys.fr>
> Cc: snmp4j at agentpp.org
> Message-ID: <D1D90FD7-E416-4FF9-ABF2-0D5549D075D5 at viridity.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
> 
> If another thread closes where you say, you should get an IOException  
> or SocketException, not a NullPointerException, when receive() is  
> called.  The socket member variable may change to null, but socketCopy  
> will not.
> 
> On Sep 27, 2010, at 3:38 AM, Tosoni wrote:
> 
>> Sorry guys, but I don't believe your tries fix the race for real.
>> 
>> The problem is that a socket.close() can occur just before the
>> socket.receive()
>> If you just test the socket value, this does not forbit a  
>> socket.close()
>> happening *after*
>> your test and *before* the socket.receive().> >           try {
>>>>           DatagramSocket socketCopy = socket;
>>>>           if (socketCopy == null) {
>>>>             stop = true;
>>>>             continue;
>>>>           }
>>    *** what if another thread closes at this point ? ***
>>>>           socketCopy.receive(packet);
>>>>         }
>> 
>> The real fix must use some semaphore or mutex which embraces:
>>    on one hand, both the test of 'socket==null' and the receive()
>>    on the other hand, both the change 'socket=null' and the close()
>> 
>> My own try (I do not suggest it as a correct fix) is a quick-and- 
>> dirty:
>>         try {
>>           socket.receive(packet);
>>         }
>>         catch (InterruptedIOException iiox) {
>>           if (iiox.bytesTransferred <= 0) {
>>             continue;
>>           }
>>         }
>> +          // UGLY FIX: socket close/receive synchro
>> +          catch (NullPointerException iiox) {
>> +              // This handles the close race (stop=false but  
>> socket=null)
>> +              continue;
>> +        }
>> 
>> 
>> Hmm, also, there is another race condition which happens sometimes,  
>> here:
>>          public void run() {
>>           try {
>>    here===>    socket.setSoTimeout(getSocketTimeout());
>> Really I guess it can happen everywhere 'socket' is used in a thread
>> different than the closing thread...
>> 
>> Regards
>> 
>>> -----Original Message-----
>>> From: snmp4j-bounces at agentpp.org [mailto:snmp4j- 
>>> bounces at agentpp.org]On
>>> Behalf Of Paul Marquis
>>> Sent: Friday, September 24, 2010 1:32 AM
>>> To: Frank Fock
>>> Cc: snmp4j at agentpp.org
>>> Subject: Re: [SNMP4J] Another race condition fix
>>> forDefaultUdpTransportMapping
>>> 
>>> 
>>> Thanks for fixing this!
>>> 
>>> Any idea when there will be an official release with this fix
>>> in it?
>>> I just joined the list, so if you've already discussed when the next
>>> release will be available, I apologize.
>>> 
>>> On Sep 23, 2010, at 7:24 PM, Frank Fock wrote:
>>> 
>>>> Hi Paul,
>>>> 
>>>> Thank you for the bug report. If fixed it a bit different:
>>>> 
>>>>         try {
>>>>           DatagramSocket socketCopy = socket;
>>>>           if (socketCopy == null) {
>>>>             stop = true;
>>>>             continue;
>>>>           }
>>>>           socketCopy.receive(packet);
>>>>         }
>>>> 
>>>> Best regards,
>>>> Frank
>>>> 
>>>> On 23.09.2010 23:44, Paul Marquis wrote:
>>>>> Version 1.11.1 of SNMP4J included a fix for a race condition in
>>>>> DefautlUdpTrasnportMapping which caused a NullPointerException.
>>>>> However, there is still one that remains while attempting to read a
>>>>> packet and I see this from time to time.  Below is a patch
>>> that fixes
>>>>> the problem for me that I'd like to submit for review.
>>>>> 
>>>>> Index: src/org/snmp4j/transport/DefaultUdpTransportMapping.java
>>>>> ===================================================================
>>>>> ---
>>> src/org/snmp4j/transport/DefaultUdpTransportMapping.java
>>>>> (revision
>>>>> 215)
>>>>> +++
>>> src/org/snmp4j/transport/DefaultUdpTransportMapping.java    (working
>>>>> copy)
>>>>> @@ -337,7 +337,11 @@
>>>>> 
>>>>> udpAddress.getPort());
>>>>>         try {
>>>>>           try {
>>>>> -            socket.receive(packet);
>>>>> +            DatagramSocket readingSocket = socket;
>>>>> +            if (readingSocket == null) {
>>>>> +              continue;
>>>>> +            }
>>>>> +            readingSocket.receive(packet);
>>>>>           }
>>>>>           catch (InterruptedIOException iiox) {
>>>>>             if (iiox.bytesTransferred<= 0) {
>>>>> 
>>>>> _______________________________________________
>>>>> SNMP4J mailing list
>>>>> SNMP4J at agentpp.org
>>>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>>> 
>>>> --
>>>> AGENT++
>>>> http://www.agentpp.com
>>>> http://www.snmp4j.com
>>>> http://www.mibexplorer.com
>>>> http://www.mibdesigner.com
>>>> 
>>>> _______________________________________________
>>>> SNMP4J mailing list
>>>> SNMP4J at agentpp.org
>>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>> 
>>> _______________________________________________
>>> SNMP4J mailing list
>>> SNMP4J at agentpp.org
>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>> 
>> 
> 
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Mon, 27 Sep 2010 11:47:19 +0200
> From: "Tosoni" <jp.tosoni at acksys.fr>
> Subject: Re: [SNMP4J] Another race condition fix
>    forDefaultUdpTransportMapping
> To: "'Paul Marquis'" <paul at viridity.com>,    "Jean-Pierre TOSONI"
>    <TOSONI at acksys.local>
> Cc: snmp4j at agentpp.org
> Message-ID: <3FD5E79EF2714973BCDD233631F0C742 at acksys.local>
> Content-Type: text/plain;    charset="us-ascii"
> 
> Oh yes, you are correct and I am wrong ! I apologize.
> But then we should catch IOException or ClosedChannelException ?
> And do the same for the other uses of 'socket' in this function ?
> 
>> From: Paul Marquis [mailto:paul at viridity.com]
> (snip) 
>> 
>> If another thread closes where you say, you should get an 
>> IOException or SocketException, not a NullPointerException,
>> when receive() is called.  The socket member variable may
>> change to null, but socketCopy will not.
>> 
>> On Sep 27, 2010, at 3:38 AM, Tosoni wrote:
>> 
>>> Sorry guys, but I don't believe your tries fix the race for real.
>>> 
>>> The problem is that a socket.close() can occur just before the
>>> socket.receive()
>>> If you just test the socket value, this does not forbit a  
>>> socket.close()
>>> happening *after*
>>> your test and *before* the socket.receive().> >           try {
>>>>>           DatagramSocket socketCopy = socket;
>>>>>           if (socketCopy == null) {
>>>>>             stop = true;
>>>>>             continue;
>>>>>           }
>>>    *** what if another thread closes at this point ? ***
>>>>>           socketCopy.receive(packet);
>>>>>         }
>>> 
>>> The real fix must use some semaphore or mutex which embraces:
>>>    on one hand, both the test of 'socket==null' and the receive()
>>>    on the other hand, both the change 'socket=null' and the close()
>>> 
>>> My own try (I do not suggest it as a correct fix) is a quick-and- 
>>> dirty:
>>>         try {
>>>           socket.receive(packet);
>>>         }
>>>         catch (InterruptedIOException iiox) {
>>>           if (iiox.bytesTransferred <= 0) {
>>>             continue;
>>>           }
>>>         }
>>> +          // UGLY FIX: socket close/receive synchro
>>> +          catch (NullPointerException iiox) {
>>> +              // This handles the close race (stop=false but  
>>> socket=null)
>>> +              continue;
>>> +        }
>>> 
>>> 
>>> Hmm, also, there is another race condition which happens 
>> sometimes,  
>>> here:
>>>          public void run() {
>>>           try {
>>>    here===>    socket.setSoTimeout(getSocketTimeout());
>>> Really I guess it can happen everywhere 'socket' is used in a thread
>>> different than the closing thread...
>>> 
>>> Regards
>>> 
>>>> -----Original Message-----
>>>> From: snmp4j-bounces at agentpp.org [mailto:snmp4j- 
>>>> bounces at agentpp.org]On
>>>> Behalf Of Paul Marquis
>>>> Sent: Friday, September 24, 2010 1:32 AM
>>>> To: Frank Fock
>>>> Cc: snmp4j at agentpp.org
>>>> Subject: Re: [SNMP4J] Another race condition fix
>>>> forDefaultUdpTransportMapping
>>>> 
>>>> 
>>>> Thanks for fixing this!
>>>> 
>>>> Any idea when there will be an official release with this fix
>>>> in it?
>>>> I just joined the list, so if you've already discussed 
>> when the next
>>>> release will be available, I apologize.
>>>> 
>>>> On Sep 23, 2010, at 7:24 PM, Frank Fock wrote:
>>>> 
>>>>> Hi Paul,
>>>>> 
>>>>> Thank you for the bug report. If fixed it a bit different:
>>>>> 
>>>>>         try {
>>>>>           DatagramSocket socketCopy = socket;
>>>>>           if (socketCopy == null) {
>>>>>             stop = true;
>>>>>             continue;
>>>>>           }
>>>>>           socketCopy.receive(packet);
>>>>>         }
>>>>> 
>>>>> Best regards,
>>>>> Frank
>>>>> 
>>>>> On 23.09.2010 23:44, Paul Marquis wrote:
>>>>>> Version 1.11.1 of SNMP4J included a fix for a race condition in
>>>>>> DefautlUdpTrasnportMapping which caused a NullPointerException.
>>>>>> However, there is still one that remains while 
>> attempting to read a
>>>>>> packet and I see this from time to time.  Below is a patch
>>>> that fixes
>>>>>> the problem for me that I'd like to submit for review.
>>>>>> 
>>>>>> Index: src/org/snmp4j/transport/DefaultUdpTransportMapping.java
>>>>>> 
>> ===================================================================
>>>>>> ---
>>>> src/org/snmp4j/transport/DefaultUdpTransportMapping.java
>>>>>> (revision
>>>>>> 215)
>>>>>> +++
>>>> src/org/snmp4j/transport/DefaultUdpTransportMapping.java    (working
>>>>>> copy)
>>>>>> @@ -337,7 +337,11 @@
>>>>>> 
>>>>>> udpAddress.getPort());
>>>>>>         try {
>>>>>>           try {
>>>>>> -            socket.receive(packet);
>>>>>> +            DatagramSocket readingSocket = socket;
>>>>>> +            if (readingSocket == null) {
>>>>>> +              continue;
>>>>>> +            }
>>>>>> +            readingSocket.receive(packet);
>>>>>>           }
>>>>>>           catch (InterruptedIOException iiox) {
>>>>>>             if (iiox.bytesTransferred<= 0) {
>>>>>> 
>>>>>> _______________________________________________
>>>>>> SNMP4J mailing list
>>>>>> SNMP4J at agentpp.org
>>>>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>>>> 
>>>>> --
>>>>> AGENT++
>>>>> http://www.agentpp.com
>>>>> http://www.snmp4j.com
>>>>> http://www.mibexplorer.com
>>>>> http://www.mibdesigner.com
>>>>> 
>>>>> _______________________________________________
>>>>> SNMP4J mailing list
>>>>> SNMP4J at agentpp.org
>>>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>>> 
>>>> _______________________________________________
>>>> SNMP4J mailing list
>>>> SNMP4J at agentpp.org
>>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>>> 
>>> 
>> 
>> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
> 
> 
> End of SNMP4J Digest, Vol 80, Issue 15
> **************************************



More information about the SNMP4J mailing list