Re: Segmentation fault

François Dumont <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
This is the initial GET that crashes. In fact, I noticed that before, but I
used snmpwalk instead with the following line :

print("Type = %s") %(result, )

and it printed :

rbQoSProfileType 25 = None ( None )

I am wondering why a GET crashes while a WALK doesn't (but doesn't give the
correct answer) ?

Thank you

2009/7/8 Dave Shield <[email protected]>

> 2009/7/8 François Dumont <[email protected]>:
> > I reduced the python script to this :
> >
> >> qosType = raw_input("Enter the new type (0 = rbCG, 1 = rbRT, 2 = rbNRT,
> 3
> >> = rbBE) :\n")
> >> value = "rbQoSProfileType"
> >> oid = netsnmp.Varbind(value, profileNb, qosType)
> >> resultSet = netsnmp.snmpset(oid, DestHost = "10.0.0.1", Community =
> >> "private", Version = 2)
> >> #resultGet = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community =
> >> "private", Version = 2)
> >> print("get result : %s") %(resultSet)
> >> #print("%s = %s") %(value,resultGet)
> >
> > If I run this python script, it returns (resultSet) 0, so the set didn't
> > succeed. If I uncomment the two commented lines, it returns a
> segmentation
> > fault. I followed step by step what does the script with the pdb
> debogger,
> > and I found that this is when it enters the get function that it fails
> (and
> > gives the segmentation fault).
>
> OK - that's progress.
>
> How about reducing it further.   Something like:
>
>     qosType = "0"
>     profileNb = "1      ;     # or whatever index you are using
>      value = "rbQoSProfileType"
>
>     oid = netsnmp.Varbind(value, profileNb, qosType)
>      r = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community
> ="private", Version = 2)
>      print ("Get1: %s")  %(r)
>
>     oid = netsnmp.Varbind(value, profileNb, qosType)
>      r = netsnmp.snmpset(oid, DestHost = "10.0.0.1", Community
> ="private", Version = 2)
>      print ("Set: %s")  %(r)
>
>     #oid = netsnmp.Varbind(value, profileNb, qosType)
>      r = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community
> ="private", Version = 2)
>      print ("Get2: %s")  %(r)
>
>
> Does the initial GET crash?  Or is it just the GET *following* the SET
> request?
> Does it make a difference if you uncomment the line that re-sets the
> oid variable
> befor the second GET?
>
>
>
> Dave
>

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.