On 5/15/15, Bart Van Assche <bvanass...@acm.org> wrote: > Hello Dixon, > > Version 5.7.3 was released in December 2014, long before this > conversation started. Please verify whether the source tree that can be > obtained via the following steps works properly on HP-UX: > > $ git clone git://git.code.sf.net/p/net-snmp/code net-snmp > $ cd net-snmp > $ git checkout V5-7-patches > $ git log snmplib/large_fd_set.c | head -n10 | tail -n5 > Merge branch 'V5-6-patches' into V5-7-patches > > * V5-6-patches: > CHANGES: HP-UX on ia64: Fix large fd set implementation > > Thanks, > > Bart. >
Hello Bart, Sorry we don't have git installed in the hpux box. So we got source through 'Downloaded Snapshot' link from here: http://sourceforge.net/p/net-snmp/code/ci/V5-7-patches/tree/ (http://sourceforge.net/code-snapshots/git/n/ne/net-snmp/code.git/net-snmp-code-3dffb0836bbcd4235240f18b2c791c4968f5e7fc.zip) It has the latest patch: $ grep -A6 NETSNMP_STATIC_INLINE snmplib/large_fd_set.c NETSNMP_STATIC_INLINE void LFD_SET(unsigned n, fd_set *p) { enum { nfdbits = 8 * sizeof(p->fds_bits[0]) }; p->fds_bits[n / nfdbits] |= (1ULL << (n % nfdbits)); } NETSNMP_STATIC_INLINE void LFD_CLR(unsigned n, fd_set *p) { enum { nfdbits = 8 * sizeof(p->fds_bits[0]) }; p->fds_bits[n / nfdbits] &= ~(1ULL << (n % nfdbits)); } NETSNMP_STATIC_INLINE unsigned LFD_ISSET(unsigned n, const fd_set *p) { enum { nfdbits = 8 * sizeof(p->fds_bits[0]) }; return (p->fds_bits[n / nfdbits] & (1ULL << (n % nfdbits))) != 0; } Compiled and tested. snmptrapd is not processing traps. I added debug code in snmptrapd after snmp_select_info call : snmp_select_info(&numfds, &readfds, tvp, &block); + DEBUGMSGTL(("snmptrapd/main_loop", "after snmp_select_info numfds: %d. \n", numfds)); + for(i=0;i<FD_SETSIZE;i++) { + if (FD_ISSET(i, &readfds)) { + DEBUGMSGTL(("snmptrapd/main_loop", "fd %d is set. ", i)); + } + } + DEBUGMSGTL(("snmptrapd/main_loop", "\n")); if (block == 1) This is the output collected by running: ./snmptrapd -f -Dall -Lo ... trace: snmp_sess_select_info2_flags(): snmp_api.c, 6046: sess_select: for all sessions: 7 5 3 sess_select: next alarm at 1431718589.066441 sec verbose:sess_select: timer due in 4.483267 sec verbose:sess_select: setting timer to 4.483267 sec, clear block (was 0) trace: snmptrapd_main_loop(): snmptrapd.c, 593: snmptrapd/main_loop: after snmp_select_info numfds: 8. trace: snmptrapd_main_loop(): snmptrapd.c, 596: snmptrapd/main_loop: fd 35 is set. trace: snmptrapd_main_loop(): snmptrapd.c, 596: snmptrapd/main_loop: fd 37 is set. trace: snmptrapd_main_loop(): snmptrapd.c, 596: snmptrapd/main_loop: fd 39 is set. trace: snmptrapd_main_loop(): snmptrapd.c, 599: snmptrapd/main_loop: ... : >From sess_select sockets found are 7 5 3. But those are interpreted by hp-ux system's FD_ macros as fd 35, 37, 39 are set. This causes issue and select is not able to know when trap arrives. Also, we were able to run the netsnmp_large_fd_set unit test case. netsnmp_large_fd_set test passed too ! $ ./RUNFULLTESTS -g unit-tests ... Testing the default_store API ............................... All 864 subtests passed Testing the container API ................................... ok Testing copy_nword .......................................... ok Testing snmp_enum ........................................... ok Testing table_dataset ....................................... ok Testing SNMP handler registration ........................... ok Testing inet_pton() and inet_ntop() ......................... ok Testing ASN.1 encoding and decoding ......................... Failed 1/312 subtests Testing netsnmp_large_fd_set ................................ ok Testing the netsnmp_string_time_to_secs API ................. ok Testing SNMP handler registration via the old API ........... ok Testing binary OID array .................................... ok Testing binary string array ................................. ok Testing netsnmp_gethostbyaddr() ............................ 1/? not ok 2 - ::1 lookup ((failed) -> (failed)) Testing netsnmp_gethostbyaddr() ............................ Failed 1/2 subtests Testing 64-bit integer operations (U64). .................... ok Testing read_config_read_octet_string_const(). .............. ok Testing strtoull(). ......................................... ok Testing read_config.c shutdown callback ..................... ok Testing domain and target registrations from snmp_service. .. ok Testing netsnmp_sprint_realloc_objid_tree() ................. ok Testing duplicate handling in binary OID array .............. ok Test sprint_realloc_variable with -OQ ....................... ok PDU type descriptions ....................................... ok PDU building ................................................ ok Parsing of PDUs ............................................. ok ... Please also check our previous mail too. Please let us know if you need any more info. Regards, Dixon Xavier ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders