Bug 232025 - net-mgmt/net-snmp: update 5.7.3 -> 5.8
Summary: net-mgmt/net-snmp: update 5.7.3 -> 5.8
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ryan Steinmetz
Depends on:
Blocks: 231096 232942
  Show dependency treegraph
Reported: 2018-10-07 08:31 UTC by Kurt Jaeger
Modified: 2019-07-08 18:38 UTC (History)
7 users (show)

See Also:
pi: maintainer-feedback? (zi)

patch (25.96 KB, patch)
2018-10-07 08:31 UTC, Kurt Jaeger
no flags Details | Diff
patch-v2 (30.74 KB, patch)
2019-03-04 21:03 UTC, Kurt Jaeger
no flags Details | Diff
patch-v3 (31.41 KB, patch)
2019-03-07 16:07 UTC, Kurt Jaeger
no flags Details | Diff
patch-v4 (48.65 KB, patch)
2019-03-07 17:06 UTC, Kurt Jaeger
no flags Details | Diff
patch-v5 (50.76 KB, patch)
2019-06-16 14:10 UTC, Kurt Jaeger
no flags Details | Diff
patch-v6 (58.51 KB, patch)
2019-07-08 18:38 UTC, Kurt Jaeger
pi: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Jaeger freebsd_committer 2018-10-07 08:31:18 UTC
Created attachment 197865 [details]

testbuilds are fine.

rel-notes: https://sourceforge.net/p/net-snmp/mailman/message/36386084/
Comment 1 Antoine Brodin freebsd_committer 2018-10-07 08:51:49 UTC
Please test yourself.
Comment 2 Yuri Pankov 2018-10-07 08:56:16 UTC
This seems to fail for me if I have TKMIB unselected:

===>  Extracting for net-snmp-5.8
=> SHA256 Checksum OK for net-snmp-5.8.tar.gz.
===>  Patching for net-snmp-5.8
===>  Applying extra patch /home/yuri/ws/net-snmp/files/extra-patch-local_Makefile.in
1 out of 1 hunks failed--saving rejects to local/Makefile.in.rej
Comment 3 Yuri Pankov 2018-10-07 09:04:56 UTC
And once installed, doing a `snmpwalk` makes snmpd crash:

(lldb) bt
* thread #1, name = 'snmpd', stop reason = signal SIGABRT
  * frame #0: 0x00000008010d4e0a libc.so.7`__sys_thr_kill at thr_kill.S:3
    frame #1: 0x00000008010d31f4 libc.so.7`__raise(s=6) at raise.c:52
    frame #2: 0x0000000801045a99 libc.so.7`abort at abort.c:67
    frame #3: 0x0000000801033e37 libc.so.7`arena_dalloc_bin_locked_impl(tsdn=<unavailable>, arena=<unavailable>, slab=<unavailable>, ptr=<unavailable>, junked=<unavailable>) at jemalloc_internal_inlines_b.h:0
    frame #4: 0x0000000800fe90b2 libc.so.7`__je_tcache_bin_flush_small(tsd=0x0000000800249090, tcache=<unavailable>, tbin=0x0000000800249590, binind=34, rem=1) at jemalloc_tcache.c:149
    frame #5: 0x0000000800fe8d40 libc.so.7`__je_tcache_event_hard(tsd=<unavailable>, tcache=0x0000000800249250) at jemalloc_tcache.c:54
    frame #6: 0x000000080104029e libc.so.7`iallocztm [inlined] tcache_event(tsd=<unavailable>) at tcache_inlines.h:37
    frame #7: 0x000000080104027e libc.so.7`iallocztm [inlined] tcache_alloc_small(arena=<unavailable>, size=0) at tcache_inlines.h:99
    frame #8: 0x00000008010401e2 libc.so.7`iallocztm [inlined] arena_malloc(size=<unavailable>, tcache=<unavailable>) at arena_inlines_b.h:94
    frame #9: 0x000000080104010d libc.so.7`iallocztm(tsdn=<unavailable>, size=<unavailable>, ind=<unavailable>, zero=<unavailable>, tcache=0x0000000800249250, is_internal=<unavailable>, arena=0x0000000000000000, slow_path=<unavailable>) at jemalloc_internal_inlines_c.h:53
    frame #10: 0x0000000801043434 libc.so.7`imalloc_body [inlined] imalloc_no_sample(sopts=<unavailable>, dopts=<unavailable>) at jemalloc_jemalloc.c:1713
    frame #11: 0x0000000801043395 libc.so.7`imalloc_body(sopts=<unavailable>, dopts=<unavailable>, tsd=<unavailable>) at jemalloc_jemalloc.c:1909
    frame #12: 0x000000080103a391 libc.so.7`__malloc(size=<unavailable>) at jemalloc_jemalloc.c:2042
    frame #13: 0x000000080056369d libnetsnmp.so.35`_copy_varlist(var=0x0000000801d7d500, errindex=0, copy_count=9999) at snmp_client.c:456
    frame #14: 0x0000000800563be0 libnetsnmp.so.35`_copy_pdu_vars(pdu=0x0000000801d67140, newpdu=0x0000000801d67280, drop_err=0, skip_count=-1, copy_count=10000) at snmp_client.c:529
    frame #15: 0x0000000800563794 libnetsnmp.so.35`_clone_pdu(pdu=0x0000000801d67140, drop_err=0) at snmp_client.c:570
    frame #16: 0x0000000800563757 libnetsnmp.so.35`snmp_clone_pdu(pdu=0x0000000801d67140) at snmp_client.c:597
    frame #17: 0x00000008002a6706 libnetsnmpagent.so.35`init_agent_snmp_session(session=0x000000080153a400, pdu=0x0000000801d67140) at snmp_agent.c:1576
    frame #18: 0x00000008002a5735 libnetsnmpagent.so.35`handle_snmp_packet(op=1, session=0x000000080153a400, reqid=803598491, pdu=0x0000000801d67140, magic=0x0000000000000000) at snmp_agent.c:2211
    frame #19: 0x00000008005a38ba libnetsnmp.so.35`_sess_process_packet_handle_pdu(sessp=0x0000000801cde700, sp=0x000000080153a400, isp=0x0000000801539400, transport=0x0000000801ce5340, pdu=0x0000000801d67140) at snmp_api.c:5804
    frame #20: 0x000000080059dfa1 libnetsnmp.so.35`_sess_process_packet(sessp=0x0000000801cde700, sp=0x000000080153a400, isp=0x0000000801539400, transport=0x0000000801ce5340, opaque=0x000000080155aa00, olength=60, packetptr="0,\x02\x01\x01\x04\x06public\xa1\x1f\x02\x04/\x02\x01", length=46) at snmp_api.c:5860
    frame #21: 0x000000080059c8cb libnetsnmp.so.35`_sess_read(sessp=0x0000000801cde700, fdset=0x00007fffffffe9a8) at snmp_api.c:6121
    frame #22: 0x000000080059c44d libnetsnmp.so.35`snmp_sess_read2(sessp=0x0000000801cde700, fdset=0x00007fffffffe9a8) at snmp_api.c:6394
    frame #23: 0x000000080059c40a libnetsnmp.so.35`snmp_read2(fdset=0x00007fffffffe9a8) at snmp_api.c:5909
    frame #24: 0x000000000020690f snmpd`receive at snmpd.c:1341
    frame #25: 0x0000000000205d99 snmpd`main(argc=3, argv=0x00007fffffffed08) at snmpd.c:1125
    frame #26: 0x0000000000204095 snmpd`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1.c:74
Comment 4 Kurt Jaeger freebsd_committer 2018-10-07 12:16:42 UTC
(In reply to Yuri Pankov from comment #2)
Thanks. I'll check and update the patch.
Comment 5 Kurt Jaeger freebsd_committer 2018-11-02 19:57:37 UTC
Testing still @work.
Comment 6 Kurt Jaeger freebsd_committer 2019-03-04 13:58:57 UTC
Testbuild on current:

Failed ports: net-mgmt/py-yapsnmp:build devel/pear:build-depends databases/php72-pdo_mysql:build-depends archivers/php72-phar:build-depends sysutils/openhpi:build net/rtg:run-depends net/asterisk13:configure
Skipped ports: net-mgmt/librenms net-mgmt/observium net/pear-Net_IPv4 net/pear-Net_IPv6 sysutils/cluster-glue

TODO: check whether any of those is caused by the update.
Comment 7 Kurt Jaeger freebsd_committer 2019-03-04 21:03:42 UTC
Created attachment 202563 [details]

testbuilds on 13a, 12.0a, 11.2a are fine.

list of ports build to test:

depend failures: openhpi and py27-yapsnmp fail with or without update.

asterisk13 fails in configure on 13 and 11.2, builds on 12, with the update, see
asterisk15 and 16 are fine.
Comment 8 Kurt Jaeger freebsd_committer 2019-03-04 21:12:13 UTC
(In reply to Kurt Jaeger from comment #6)
The php-failures were unrelated to net-snmp.
Comment 9 Kurt Jaeger freebsd_committer 2019-03-06 12:15:14 UTC
There's a patch for openhpi to upgrade to 3.8.0 in PR#231096
Comment 10 Kurt Jaeger freebsd_committer 2019-03-07 14:11:02 UTC
(In reply to Yuri Pankov from comment #3)
I tested snmpd with this:

snmpd_flags="-a -C"

and the config from https://people.freebsd.org/~pi/logs/snmpd.conf

and running this command:

snmpwalk -v 1 -c public

It did not crash. How can I reproduce the crash ?
Comment 11 Kurt Jaeger freebsd_committer 2019-03-07 14:40:28 UTC
fails to build with NOIPV6 selected (testing, if this the cause)
Comment 12 Kurt Jaeger freebsd_committer 2019-03-07 16:07:18 UTC
Created attachment 202690 [details]

- removed NOIPV6 option (looks non-trivial to patch)
- fixed BIN_FILES list if TLS is not selected
TODO: needs a bit of portlint cleanup
Comment 13 Kurt Jaeger freebsd_committer 2019-03-07 17:06:20 UTC
Created attachment 202692 [details]

Final patch version, testbuilds are fine.
Comment 14 Kurt Jaeger freebsd_committer 2019-06-16 14:10:28 UTC
Created attachment 205132 [details]

Fixes build on recent 13
Comment 15 Kurt Jaeger freebsd_committer 2019-07-08 18:38:00 UTC
Created attachment 205592 [details]

patch updated after r506141