Hi everybody,
I'm using Ubuntu 8.04 (Hardy), up to date.
I think that you should run your script with gdb:
>
> $ gdb python
> gdb> set args yourscript.py
> gdb> run
> [it crashes]
> gdb> bt full
>
> And post the result.
>
To be clear, here is the python script I used with gdb :
import netsnmp
>
> qosType = "0"
> profileNb = "17"
> value = "rbQoSProfileType"
>
> oid = netsnmp.Varbind(value, profileNb, qosType)
> result = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community="private",
> Version = 2)
> print ("%s") %(result)
>
and here is what I did with gdb :
m...@sumac-clusterhead-1:~$ gdb python
> GNU gdb 6.8-debian
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i486-linux-gnu"...
> (no debugging symbols found)
> (gdb) set args test2.py
> (gdb) run
> Starting program: /usr/bin/python test2.py
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> [Thread debugging using libthread_db enabled]
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> [New Thread 0xb7df18c0 (LWP 6839)]
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0xb7df18c0 (LWP 6839)]
> 0xb7e66403 in strchrnul () from /lib/tls/i686/cmov/libc.so.6
> (gdb) bt full
> #0 0xb7e66403 in strchrnul () from /lib/tls/i686/cmov/libc.so.6
> No symbol table info available.
> #1 0xb7e30259 in vfprintf () from /lib/tls/i686/cmov/libc.so.6
> No symbol table info available.
> #2 0xb7e54c04 in vsnprintf () from /lib/tls/i686/cmov/libc.so.6
> No symbol table info available.
> #3 0xb7e393a5 in snprintf () from /lib/tls/i686/cmov/libc.so.6
> No symbol table info available.
> #4 0xb7ce0d15 in ?? ()
> from /usr/lib/python2.5/site-packages/netsnmp/client_intf.so
> No symbol table info available.
> #5 0xb7ce3bc6 in ?? ()
> from /usr/lib/python2.5/site-packages/netsnmp/client_intf.so
> No symbol table info available.
> #6 0x080c9ab3 in PyEval_EvalFrameEx ()
> No symbol table info available.
> #7 0x080c96e5 in PyEval_EvalFrameEx ()
> No symbol table info available.
> #8 0x080cb1f7 in PyEval_EvalCodeEx ()
> No symbol table info available.
> #9 0x080c93fe in PyEval_EvalFrameEx ()
> No symbol table info available.
> #10 0x080cb1f7 in PyEval_EvalCodeEx ()
> ---Type <return> to continue, or q <return> to quit---
> No symbol table info available.
> #11 0x080cb347 in PyEval_EvalCode ()
> No symbol table info available.
> #12 0x080ea818 in PyRun_FileExFlags ()
> No symbol table info available.
> #13 0x080eaab9 in PyRun_SimpleFileExFlags ()
> No symbol table info available.
> #14 0x08059335 in Py_Main ()
> No symbol table info available.
> #15 0x080587f2 in main ()
> No symbol table info available.
> (gdb)
>
> Which distribution are you using? Adding debug package for libsnmp will
> help if they are available. Or maybe you use your own libsnmp. In this
> case, try to compile it unstripped. I don't remember, but which version
> do you use?
>
> Maybe you have the same bug as here:
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=497656
>
Have you tried applying the patch mentioned in that bug report?
> It's a one-line change to the file 'python/netsnmp/client_intf.c'
> (Though you would also need to recompile/install the python module)
>
> Dave
>
I'm using the library libsnmp-python available in the depositories of
Ubuntu. The version of this library is 5.4.1~dfsg-4ubuntu4.2 . I tried to
see my client.py file but I didn't find it. However, it is in the sources of
the net-snmp library available on the website of net-snmp
http://www.net-snmp.org/download.html. I downloaded the lastest sources :
https://sourceforge.net/projects/net-snmp/files/net-snmp/net-snmp-5.4.2.1.zip/download.
In these sources, the client.py file is up-to-date compared to the bug
report (the line 341 has been changed).
So, I tried to compile these sources (./configure, then make). But I had a
problem with the make, it told me it wasn't able to find the perl library.
So I made a link between the library it was looking for and the library
installed (libperl.so.5.8.8).
After that I recompiled, ./configure and make, but I had another problem
with the make. It's a little bit difficult for me to explain this problem,
so I posted the result of the make (that I put in a file to be able to read
it after) on pastebin.ca. Here it is : http://pastebin.ca/1489423
I try to be as clear as I can, but maybe I'm not, so ask me if you don't
understand.
Thank you very much
------------------------------------------------------------------------------
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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users