bugMibble MIB Parser - Bugs: bug #16825, Imported mibs implicitly loaded in...

 
 

bug #16825: Imported mibs implicitly loaded in MibLoader.load() are loaded multiple times

Submitter:  Bernd Sorgenfrei <berndsorgenfrei>
Submitted:  Mon 12 Jun 2006 06:55:20 AM UTC
   
 
Severity:  5 - Major Item Group:  Software
Status:  Fixed Privacy:  Public
Assigned to:  cederberg Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 10 Jan 2007 05:52:28 PM UTC, comment #2: 

Version 2.8, including a fix for this issue, has been released.

Per Cederberg <cederberg>
Group administrator
Sun 25 Jun 2006 12:27:47 PM UTC, comment #1: 

Again, thanks for the bug report! Your fix seems 100% correct and will be available in 2.8.alpha1.

The cause for this was that the code expected that ArrayList.contains() called equals in the other order, i.e. listItem.equals(obj) and not obj.equals(listItem).

Per Cederberg <cederberg>
Group administrator
Mon 12 Jun 2006 06:55:20 AM UTC, original submission:  

Error is in Mibble 2.7. This causes a higher loading time, more memory usage and MibLoader.getAllMibs() returns duplicate mibs.

The cause is that mibs.contains(String) and mibs.contains(File) return always false. This is because method ArrayList.contains() uses internally String.equals(mibs[xxx]) and File.equals(mibs[xxx]) that can never be true. There are methods MibLoader.getMib(String) and MibLoader.getMib(File) that do the correct behaviour.


Fixes:

(1) The following code in MibLoader.scheduleLoad(String)
     if (!mibs.contains(name) && !queue.contains(name))
should be changed to
     if (getMib(name) == null && !queue.contains(name))
.

(2) The following code in MibLoader.loadQueue()
     else if (!mibs.contains(obj))
should be changed to
     else if (getMib((String) obj) == null)
.

(3) The following code in MibLoader.loadQueue()
     if (src != null && !mibs.contains(src.getFile()))
should be changed to
     if (src != null && getMib(src.getFile()) == null)
.


Example:
---------

Current behaviour:
If the mib IF-MIB is explicitly loaded, these mibs are implicitly loaded multiple times:
- 2x SNMPv2-CONF
- 2x SNMPv2-TC
- 3x SNMPv2-SMI

Bernd Sorgenfrei <berndsorgenfrei>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cederberg (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-01-10 cederberg Open/ClosedOpen Closed
    2006-06-25 cederberg StatusNone Fixed
        Assigned toNone cederberg

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code