Good afternoon, I turn to you with a question. I am currently dealing with implementing the SNMP using your library on our device running embedded Linux. Please see the structured description below:
* NET-SNMP version: 5.7.3 * O/S: Yocto Project Linux, Fido 1.8.9 * Description: I am trying to extend you SNMP daemon with my own AgentX subagent to handle our custom OIDs. To try this, I actually used you mib2c generator and our MIB file to create and run an example AgentX daemon and tried to execute this on my desktop (running Ubuntu 16.04). That worked fine. When I, however, tried to use the very same portion of the code on our embedded device (running the Yocto distribution I described above), I had no success. I finally tried to replaced the netsnmp_register_instance( netsnmp_create_handler_registration(...) ) with a simple netsnmp_register_int_instance(...) and was able to at least read the value using $snmpget -v1 -c myRwCommunity device_ip:161 my_oid. When I, vice versa, try to set the value, the daemon crashes with a SEGFAULT. The variable itself is statically allocated integer within the daemon's data segment, just like in your example. I enclose the stack trace (obtained via GDB as your FAQ suggests) and also the stderr output. * Thoughts: Since my desktop is running on x64 architecture and the embedded device is an 32-bit ARM, I wonder whether there might be any issues with structures/ memory alignment and padding? In the code I saw casting void pointer to some struct pointer several times... The Yocto provides us a precompiled version of the NET-SNMP daemon, but also a set of flags that should be used to compile our own code. I therefore suppose the SNMPD and my subagent's implementation are consistent as far as this goes. I tried to Google this, but to no avail. Any quick tips on how to debug/verify this? Thank you for your support! Ing. Ondrej Vozda Siemens, s.r.o. CT DD DS EU CZ ITS SW Olomoucka 7/9 618 00 Brno, Czech Republic mailto:ondrej.vo...@siemens.com
STDERR
Description: STDERR
GDB_TRACE
Description: GDB_TRACE
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders