Re: Segmentation fault

François Dumont <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
I confirm that with this script (there is nothing else in the script except
this) :

   import netsnmp
>
>    profileNb = "25"
>    qosType = "0"
>    value = "rbQoSProfileType"
>
>    oid = netsnmp.Varbind(value, profileNb, qosType)
>    result = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community =
> "private", Version = 2)
>    print("%s") %(result)


It gives the segmentation fault.

I'm sorry if I didn't gave you the entire script but just parts of it and I
apologize, I understand this can be waste of time for you.

So here is the script I used to notice that WALK doesn't crash :

import netsnmp
>
> profileNb = raw_input("Which QoS Profile to edit ?\n")
>
> print("-----------")
> print("QoS Profile")
> print("-----------\n")
>
> value = "rbQoSProfileName"
> oid = netsnmp.Varbind(value, profileNb)
> resultName = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community =
> "private", Version = 2)
> print("Name = %s") %resultName
>
> value = "rbQoSProfileType"
> oid = netsnmp.Varbind(value, profileNb)
> resultType = netsnmp.snmpwalk(oid, DestHost = "10.0.0.1", Community =
> "private", Version = 2)
> print("Type = %s") % (resultType, )
>
> value = "rbQoSProfileParam1"
> oid = netsnmp.Varbind(value, profileNb)
> resultParam1 = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community =
> "private", Version = 2)
> print("CIR = %s Kbps") %resultParam1
>
> value = "rbQoSProfileParam2"
> oid = netsnmp.Varbind(value, profileNb)
> resultParam2 = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community =
> "private", Version = 2)
> print("MIR = %s Kbps") %resultParam2
>
> value = "rbQoSProfileParamTime"
> oid = netsnmp.Varbind(value, profileNb)
> resultParamTime = netsnmp.snmpwalk(oid, DestHost = "10.0.0.1", Community =
> "private", Version = 2)
> print("CT = %s") % (resultParamTime, )
>
> value = "rbAQoSProfileRowStatus"
> oid = netsnmp.Varbind(value, profileNb)
> resultRowStatus = netsnmp.snmpwalk(oid, DestHost = "10.0.0.1", Community =
> "private", Version = 2)
> print("Status = %s") % (resultRowStatus, )


And the result in the shell :

mesh@sumac-clusterhead-1:~$ python test2.py
> Which QoS Profile to edit ?
> 25
> -----------
> QoS Profile
> -----------
>
> Name = tests
>    rbQoSProfileType 25 = None ( None )
> Type = ()
> CIR = 1100 Kbps
> MIR = 0 Kbps
>    rbQoSProfileParamTime 25 = None ( None )
> CT = ()
>    rbAQoSProfileRowStatus 25 = None ( None )
> Status = ()


But now, I understand that do a WALK after a GET is not a good adea. So
let's forget this.

Going back to the simple script at the very top of this mail, I found on
this page http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=497656<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=497656>the
same problem as mine. This is a bug reported for Debian, and I am
under
Ubuntu 8.04 completely updated. So there should be a way to solve this
problem.

Thank you

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

> 2009/7/8 François Dumont <[email protected]>:
> > This is the initial GET that crashes.
>
> OK - it sounds as if a trivial script with *just* a single GET
> request should still crash.  Nothing else - no prompting,
> no SET requests, nothing.   Just something like:
>
>    import netsnmp
>
>    profileNb = "25"
>    qosType = "0"
>     value = "rbQoSProfileType"
>
>    oid = netsnmp.Varbind(value, profileNb, qosType)
>     result = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community =
> "private", Version = 2)
>    print("%s") %(result)
>
>
> Can you please confirm whether this is indeed the case.
> Does the above script (suitably tweaked to match your
> actual usage) crash or not?
>   It would probably be sensible if you posted the corrected version
> of the script as well, so I know *exactly* what you are working with.
>
>
>
> >                  In fact, I noticed that before, but I
> > used snmpwalk instead with the following line :
> >
> > print("Type = %s") %(result, )
>
> No - you are complicating things too much again.
> The next step after a GET request would be GETNEXT
> (not a full walk).
>
>
> > and it printed :
> >
> > rbQoSProfileType 25 = None ( None )
>
> I'm sorry - but it's impossible to offer sensible advice based on
> such fragmentary information.   Please can you always post
> the *FULL* text of the test scripts you are using, including all
> the information you provide, and the complete output.
> (both expected, and actual)
>
>   You say that you "used snmpwalk", but give no indication *how*
> you used it.   It's actually a waste of my time to have to keep
> guessing about the details that you don't mention.
>   (Sorry if that comes over a bit harshly, but it is very frustrating).
>
>
> > I am wondering why a GET crashes while a WALK doesn't
> > (but doesn't give the correct answer) ?
>
> Forget about the walk - there's no such request anyway.
> Concentrate on a single GET, and we can take it from there.
>
> 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.