buglwIP - A Lightweight TCP/IP stack - Bugs: bug #18969, crashes in udp_bind

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #18969: crashes in udp_bind

Submitted by:  Tim Shirley <tims>
Submitted on:  Tue 06 Feb 2007 05:45:50 AM UTC  
 
Category:  UDP Severity:  3 - Normal
Item Group:  Crash Error Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  None

( Jump to the original submission)

Thu 08 Feb 2007 07:56:17 AM UTC, comment #7: 

I'm going to close this bug as the original problem is resolved.  If you could file new bugs for the additional problems you've come across that would be great.  Otherwise we end up tracking many issues in one bug report, which can lead to confusion.

Kieran Mansley <kieranm>
Project Member
Thu 08 Feb 2007 07:55:04 AM UTC, comment #6: 

You can't SNMP-GET iso.org.dod.internet.mgmt.mib-2.system.3
you can only get iso.org.dod.internet.mgmt.mib-2.system.3.0

Scalars identifiers for simple objects (non-tabular) must be terminated with .0 !

Christiaan Simons <christiaans>
Project Member
Thu 08 Feb 2007 03:43:38 AM UTC, comment #5: 

ok... I had the ident values wrong.  For some reason I assumed you would pack the values (which I realize doens't make much sense)... After evaluating the ident values correctly I can now see that I am getting the whole get request for iso.org.dod.2.1.1.x.  However, it still decides that the ...dod.2 isn't found and returns a null...

What I'm wondering is why the node is of type MIB_NODE_SC when it should probably be something else.  The SC type is for the leaf right?  So who do the node types get set... I haven't quite figured that one out. 

Or am I asking the wrong questions still?  Perhaps the only issue is that I haven't enabled the mib (even thought I populate sysContact and other sys vals per the short snmp doc/directions, I guess that doesn't mean that they are "live")

Tim Shirley <tims>
Thu 08 Feb 2007 02:02:58 AM UTC, comment #4: 

Made quite a bit more progress...

udp_bind() is ok... it turns out that it really was hanging at the call to snmp_cold_trap().  I commented that out (work on that another day) and started working on the snmp get stuff.

sending get to my lwIP SNMP embedded system:

  receives udp packet... good
  starts doing various tests .... good
  completes recognition of iso.org.dod.internet ... good
  when processing snmp_search_tree() always returns NULL

Good thing - it no longer crashes
Bad thing - I haven't figured out why it won't do the search tree.  I'm trying to send get iso.org.dod.internet.mgmt.mib-2.system.3, and .4 (which it looks like the code should respond to).  The ident length that is passed to snmp_search_tree is 4 (which I expect).  The ident value is 02 00 00 00 (I have a routine to print as bytes)... I'm guessing each time through the while loop will drill down to the next level so that isn't too odd (I double checked that I was sending the right info with a packet sniffer).  It takes the MIB_NODE_SC branch and then returns NULL...

Any new words of wisdom on what to look @ next?

Thx,

TimS

Tim Shirley <tims>
Wed 07 Feb 2007 10:52:15 AM UTC, comment #3: 

Maybe you need to increment #define MEMP_NUM_UDP_PCB in lwipopts.h ... The SNMP code needs an extra PCB, and the udp_new() may choke on that if this setting is too low.

Christiaan Simons <christiaans>
Project Member
Wed 07 Feb 2007 10:22:23 AM UTC, comment #2: 

ok... yes I've seen the previous post.

I tried a little experiment to just create a udb_pcb and pass it to udp_bind().  It runs - but the udp_pcb is not allocated (or at least it doesn't seem to be).

Here's the relevant code for getting the udp_pcb:

struct udp_pcb *my_udp_pcb = NULL;
my_udp_pcb = udp_new();

Huh - now that I think about it, that's really strange.  I have blocking code around the udp_bind() call which makes sure the udp_pcb != NULL.

Thanks for the help thus far, any other thoughts?

TimS

Tim Shirley <tims>
Tue 06 Feb 2007 10:50:46 AM UTC, comment #1: 

I think the SNMP server is pretty new in 1.2.0 - perhaps one of the
other developers who knows more about it can comment?

Did you (or the porter) see this:

http://lists.gnu.org/archive/html/lwip-users/2007-01/msg00016.html

Kieran Mansley <kieranm>
Project Member
Tue 06 Feb 2007 05:45:50 AM UTC, original submission:  

Vers 1.2.0.  Crashes during snmp_init call to udp_bind.  causes SWI vector (for LPC23xx ARM7TDMI - a port by Kurt Sterckx).  Not sure if it is something from the port of or some other issue.

Tim Shirley <tims>

 

Attached Files
file #11928:  udp.c added by tims (21KiB - text/plain - yes - I know it looks like hackery (at least the main.c portion) - that's my fault... I'm just trying to get it to work.)
file #11929:  main.c added by tims (6KiB - text/plain - yes - I know it looks like hackery (at least the main.c portion) - that's my fault... I'm just trying to get it to work.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by christiaans (Posted a comment)
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by tims (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-02-08 kieranm StatusNone => Invalid
        Open/ClosedOpen => Closed
    2007-02-06 tims Attached File- => Added udp.c, #11928
        Attached File- => Added main.c, #11929

    Back to the top


    Powered by Savane 3.5