Robert, Must be something special (ie, bad) I'm doing in my init function, because multiple varbinds works on the netSnmpIETFWGTable example. Let me dig some more.
Thanks, Phil Gillis -----Original Message----- From: Gillis, Philip W (Philip) [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 08, 2004 8:56 AM To: '[EMAIL PROTECTED]' Subject: RE: windows exception on multiple varbind set Robert, Also occurs on a different table, using just 2 varbinds, type integer. Thanks, Phil Gillis -----Original Message----- From: Gillis, Philip W (Philip) [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 08, 2004 8:52 AM To: '[EMAIL PROTECTED]' Subject: RE: windows exception on multiple varbind set Robert, I should be more precise about the oid's: SomeOid is a table with 3 columns, integer, octet string, integer. Index is 1, and row exists. This makes the exception happen: snmpset -v2c -c private udp:135.5.184.98:161 someOid.2.1 i 3 someOid.3.1 s 1152304 someOid.4.1 i 3 Thanks, Phil Gillis -----Original Message----- From: Gillis, Philip W (Philip) Sent: Wednesday, December 08, 2004 8:43 AM To: '[EMAIL PROTECTED]'; Gillis, Philip W (Philip) Subject: RE: windows exception on multiple varbind set Hi Robert, Yes, I typo'ed 5.1.2 into 5.2.1. I installed 5.2, and table_dataset.c has the fix you describe here, but it still has the problem. This is on win2k pro, 5.00.2195, Service Pack 4, and VC++ 6.0. Below is a stack trace, which looks very similar to the one in 5.1.2. Here's how I can make it happen: SomeOid is a table with 3 columns, integer, octet string, integer. snmpset -v2c -c private udp:135.5.184.98:161 someOid.1 i 3 someOid.2 s 1152304 someOid.3 i 3 Very consistent. Thanks, Phil netsnmp_table_data_set_find_column(netsnmp_table_data_set_storage_s * 0xfeeefeee, unsigned int 3) line 164 + 9 bytes netsnmp_table_data_set_helper_handler(netsnmp_mib_handler_s * 0x00fbf5b0, netsnmp_handler_registration_s * 0x00fbf188, netsnmp_agent_request_info_s * 0x011cc138, netsnmp_request_info_s * 0x0122f710) line 548 + 15 bytes netsnmp_call_handler(netsnmp_mib_handler_s * 0x00fbf5b0, netsnmp_handler_registration_s * 0x00fbf188, netsnmp_agent_request_info_s * 0x011cc138, netsnmp_request_info_s * 0x0122f710) line 423 + 19 bytes netsnmp_call_next_handler(netsnmp_mib_handler_s * 0x00fbf700, netsnmp_handler_registration_s * 0x00fbf188, netsnmp_agent_request_info_s * 0x011cc138, netsnmp_request_info_s * 0x0122f710) line 528 + 24 bytes table_helper_handler(netsnmp_mib_handler_s * 0x00fbf700, netsnmp_handler_registration_s * 0x00fbf188, netsnmp_agent_request_info_s * 0x011cc138, netsnmp_request_info_s * 0x0122f710) line 615 + 21 bytes netsnmp_call_handler(netsnmp_mib_handler_s * 0x00fbf700, netsnmp_handler_registration_s * 0x00fbf188, netsnmp_agent_request_info_s * 0x011cc138, netsnmp_request_info_s * 0x0122f710) line 423 + 19 bytes netsnmp_call_handlers(netsnmp_handler_registration_s * 0x00fbf188, netsnmp_agent_request_info_s * 0x011cc138, netsnmp_request_info_s * 0x0122f710) line 504 + 24 bytes handle_var_requests(netsnmp_agent_session_s * 0x0120aa48) line 2395 + 33 bytes handle_set(netsnmp_agent_session_s * 0x0120aa48) line 2894 + 9 bytes handle_set_loop(netsnmp_agent_session_s * 0x0120aa48) line 2910 + 9 bytes handle_pdu(netsnmp_agent_session_s * 0x0120aa48) line 3195 + 9 bytes netsnmp_handle_request(netsnmp_agent_session_s * 0x0120aa48, int 0) line 2967 + 9 bytes handle_snmp_packet(int 1, snmp_session * 0x0121d910, int 3995, snmp_pdu * 0x0121ca38, void * 0x00000000) line 1792 + 13 bytes _sess_process_packet(void * 0x01216868, snmp_session * 0x0121d910, snmp_internal_session * 0x01219dd0, netsnmp_transport_s * 0x0121a690, void * 0x0121b7b8, int 16, unsigned char * 0x0121e000, int 109) line 5209 + 30 bytes _sess_read(void * 0x01216868, fd_set * 0x0012fc54) line 5607 + 37 bytes snmp_sess_read(void * 0x01216868, fd_set * 0x0012fc54) line 5625 + 13 bytes snmp_read(fd_set * 0x0012fc54) line 5260 + 13 bytes receive() line 1149 + 12 bytes SnmpDaemonMain(int 7, char * * 0x00e44198) line 2 main(int 7, char * * 0x00e44198) line 1335 + 13 bytes mainCRTStartup() line 338 + 17 bytes KERNEL32! 7c59893d() Thanks, Phil Gillis -----Original Message----- From: Robert Story [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 07, 2004 6:48 PM To: Gillis, Philip W (Philip) Cc: [EMAIL PROTECTED] Subject: Re: windows exception on multiple varbind set On Mon, 29 Nov 2004 17:35:04 -0500 Gillis, wrote: GPW> In 5.2.1, on Win2K Pro, I assume you mean 5.1.2, since there is not 5.2.1. GPW> I have an agent with code generated from mib2c GPW> with create-dataset. I can run snmpset with 1 PDU fine, as far as I can GPW> tell. But if I run it with multiple PDU's on a table with no rows, the GPW> first time through it creates a row and sets the values fine. But the GPW> second time, I get an error: "Unhandled exception in snmpd.exe: GPW> 0xC0000005: Access Violation". Same thing happens if I create the rows in GPW> code. Can you try this patch? Index: agent/helpers/table_dataset.c =================================================================== RCS file: /cvsroot/net-snmp/net-snmp/agent/helpers/table_dataset.c,v retrieving revision 5.19.2.3 retrieving revision 5.19.2.4 diff -u -r5.19.2.3 -r5.19.2.4 --- agent/helpers/table_dataset.c 7 Apr 2004 14:57:30 -0000 5.19.2.3+++ agent/helpers/table_dataset.c 21 Oct 2004 18:46:01 -0000 5.19.2.4@@ -451,6 +451,10 @@ (reginfo->rootoid_len + 2); if (MODE_IS_SET(reqinfo->mode)) { + char buf[256]; /* is this reasonable size?? */ + int rc; + size_t len; + /* * use a cached copy of the row for modification */ @@ -459,9 +463,27 @@ * cache location: may have been created already by other * SET requests in the same master request. */ + rc = snprintf(buf, sizeof(buf), "dataset_row_stash:%s:", + datatable->table->name); + if ((-1 == rc) || (rc >= sizeof(buf))) { + snmp_log(LOG_ERR,"%s handler name too long\n", + datatable->table->name); + netsnmp_set_request_error(reqinfo, request, + SNMP_ERR_GENERR); + continue; + } + len = sizeof(buf) - rc; + rc = snprint_objid(&buf[rc], len, table_info->index_oid, + table_info->index_oid_len); + if (-1 == rc) { + snmp_log(LOG_ERR,"%s oid or name too long\n", + datatable->table->name); + netsnmp_set_request_error(reqinfo, request, + SNMP_ERR_GENERR); + continue; + } stashp = (netsnmp_oid_stash_node **) - netsnmp_table_get_or_create_row_stash(reqinfo, - "dataset_row_stash"); + netsnmp_table_get_or_create_row_stash(reqinfo, buf); newrowstash = netsnmp_oid_stash_get_data(*stashp, suffix, suffix_len); -- Robert Story; NET-SNMP Junkie Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp> Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders> You are lost in a twisty maze of little standards, all different. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders