[prev in list] [next in list] [prev in thread] [next in thread]
List: net-snmp-coders
Subject: Re: Core dump with net-snmp-5.8
From: Anders Wallin <wallinux () gmail ! com>
Date: 2019-04-11 14:58:42
Message-ID: CAF2baFedJK_sY5kMzXYNFfN3+zGrdCw0tQ+bOCQHxQ0Y18wNgQ () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi Sam,
I'm not a maintainer for net-snmp, but it was merged into 5-8-patches
yesterday
Regards
Anders Wallin
On Wed, Apr 10, 2019 at 8:04 PM Sam Tannous <stannous@cumulusnetworks.com>
wrote:
> Hi Anders,
>
> We've been testing the patch for
>
> https://sourceforge.net/p/net-snmp/bugs/2914/
>
> and this works.
>
> Before the patch, we were getting lots of core dumps where the flow in
> master.c hits the default case and memory gets double-freed and a core
> happens.
> We'd love to get this into V5-8-patches soon.
>
> Thanks,
> Sam
>
>
>
> On Tue, Apr 9, 2019 at 9:13 AM Sam Tannous <stannous@cumulusnetworks.com>
> wrote:
>
>> Hi Anders,
>>
>> I fixed some snmpv3 (bulkget) coredumps a while ago.
>> https://sourceforge.net/p/net-snmp/patches/1388/
>>
>> While not directly related, the (double-free memory) core dumps
>> were easily triggered by any error condition within a v3 bulkget.
>>
>> I'm hoping my patch will get picked up soon :-(
>>
>> Thanks,
>> Sam
>>
>> On Tue, Apr 9, 2019 at 6:54 AM Anders Wallin <wallinux@gmail.com> wrote:
>>
>>> Now it works fine!
>>>
>>> thx
>>> Anders Wallin
>>>
>>>
>>> On Tue, Apr 9, 2019 at 2:26 AM Masayoshi Mizuma <msys.mizuma@gmail.com>
>>> wrote:
>>>
>>>> Hi Anders,
>>>>
>>>> Thank you for your feedback!
>>>> I attach the v2 patch. Could you try it?
>>>>
>>>> On the v1 patch, I missed the check for the request callback. So, the
>>>> request
>>>> gets removed even though the callback doesn't run.
>>>>
>>>> Thanks,
>>>> Masa
>>>>
>>>> On 4/8/19 11:06 AM, Anders Wallin wrote:
>>>> > Hi Masa,
>>>> >
>>>> > looks like it solves the problem reported by Josef, BUT it breaks
>>>> DTLSUDP.
>>>> > I run the tests w/o analyzing why.
>>>> > To reproduce the issue I did the following using net-snmp master
>>>> branch,
>>>> > plus these patches
>>>> > 39485c6f2 - snmplib/snmp_api: Remove the request on the session when
>>>> the
>>>> > sending is failed (10 minutes ago) <Masayoshi Mizuma>
>>>> > 06a4d52d8 - agentx: logging to late responses (5 days ago) <Anders
>>>> Wallin>
>>>> > a420d87d3 - BUG2914: Agent master needs to treat resend as normal (5
>>>> days
>>>> > ago) <Anders Wallin>
>>>> > eaad09d04 - (origin/master, origin/HEAD, master) Merge branch
>>>> > 'V5-8-patches' (9 weeks ago) <Bart Van Assche>
>>>> >
>>>> > $ ./configure --prefix=/usr \
>>>> > --with-persistent-directory=/var/lib/net-snmp \
>>>> > --with-mib-modules='smux tlstm-mib tsm-mib
>>>> examples/example
>>>> > examples/notification' \
>>>> > --with-security-modules="tsm" \
>>>> > --with-transports="TLSTCP DTLSUDP" \
>>>> > --enable-shared \
>>>> > --with-defaults \
>>>> > --enable-ipv6 \
>>>> > --with-cflags="-g -O2" \
>>>> > --without-elf
>>>> >
>>>> > $ make install
>>>> > $ cd testing
>>>> > $ ./RUNFULLTESTS -g tls
>>>> > DTLS-UDP user certificate tests .......................... 41/?
>>>> > This hangs forever in "41" with snmpd.log saying....
>>>> > ......
>>>> > 2019-04-08 16:29:11
>>>> > 2019-04-08 16:29:11
>>>> > Received 0 byte packet from DTLSUDP: unknown
>>>> > 2019-04-08 16:29:11
>>>> > 2019-04-08 16:29:13
>>>> > Received 0 byte packet from DTLSUDP: unknown
>>>> > 2019-04-08 16:29:13
>>>> > 2019-04-08 16:29:15
>>>> > Received 0 byte packet from DTLSUDP: unknown
>>>> > 2019-04-08 16:29:15
>>>> > 2019-04-08 16:29:15 tls verification failure: ok=0 ctx=0x55ee625b4170
>>>> > depth=0 err=18:self signed certificate
>>>> > 2019-04-08 16:29:15 ---- OpenSSL Related Errors: ----
>>>> > 2019-04-08 16:29:15 TLS error: SSL_read: rc=-1, sslerror = 1
>>>> > (SSL_ERROR_SSL)
>>>> > 2019-04-08 16:29:15 TLS Error: certificate verify failed
>>>> > 2019-04-08 16:29:15 ---- End of OpenSSL Errors ----
>>>> > 2019-04-08 16:29:15 ---- OpenSSL Related Errors: ----
>>>> > 2019-04-08 16:29:15 TLS error: SSL_read: rc=-1, sslerror = 5
>>>> > (SSL_ERROR_SYSCALL): system_error=0 (Success)
>>>> > 2019-04-08 16:29:15 TLS Error: (null)
>>>> > 2019-04-08 16:29:16 ---- OpenSSL Related Errors: ----
>>>> > 2019-04-08 16:29:16 TLS error: SSL_read: rc=-1, sslerror = 5
>>>> > (SSL_ERROR_SYSCALL): system_error=0 (Success)
>>>> > 2019-04-08 16:29:16 TLS Error: (null)
>>>> > 2019-04-08 16:29:16 ---- OpenSSL Related Errors: ----
>>>> > 2019-04-08 16:29:16 TLS error: SSL_read: rc=-1, sslerror = 5
>>>> > (SSL_ERROR_SYSCALL): system_error=0 (Success)
>>>> > 2019-04-08 16:29:16 TLS Error: (null)
>>>> >
>>>> > With the fix suggested på Josef I don't see the DTLSUDP problem, but
>>>> maybe
>>>> > there are other problems.
>>>> >
>>>> > Regards
>>>> > Anders Wallin
>>>> >
>>>> > PS. thx for adding commit info to a420d87d3, I updated the patch with
>>>> your
>>>> > commit comments
>>>> >
>>>> >
>>>> > On Mon, Apr 8, 2019 at 3:27 PM Masayoshi Mizuma <
>>>> msys.mizuma@gmail.com>
>>>> > wrote:
>>>> >
>>>> >> Hi Josef,
>>>> >>
>>>> >> I attach two patches to fix the memory inconsistency if the request
>>>> is
>>>> >> resend and timed out.
>>>> >> Could you try them?
>>>> >>
>>>> >> - 0001-agentx-master-Return-when-NETSNMP_CALLBACK_OP_RESEND.patch
>>>> >>
>>>> >> This patch was posted by Anders, and I tried to add the
>>>> description.
>>>> >> This patch fixes the missing NETSNMP_CALLBACK_OP_RESEND callback.
>>>> >>
>>>> >> - 0002-snmplib-snmp_api-Remove-the-request-on-the-session-w.patch
>>>> >>
>>>> >> This patch fixes the race between NETSNMP_CALLBACK_OP_SEND_FAILED
>>>> >> and NETSNMP_CALLBACK_OP_TIMED_OUT callback. If the request is
>>>> failed,
>>>> >> then remove the request from the internal session.
>>>> >>
>>>> >> Thanks,
>>>> >> Masa
>>>> >>
>>>> >> On 4/3/19 9:34 AM, Anders Wallin wrote:
>>>> >>> The introduction of that code fixes another issue;
>>>> >>> "commit 56c30b11f3616ea4f0c38a21e08e78f050096020
>>>> >>> Author: Bill Fenner <fenner@gmail.com>
>>>> >>> Date: Wed Dec 20 21:52:10 2017 +0000
>>>> >>>
>>>> >>> NEWS: snmplib: PATCH: 1349: Fix perl/other crash against bad
>>>> SNMPv3
>>>> >>> agent
>>>> >>>
>>>> >>> With the patch in 1214, the snmp_api code assumed that if magic
>>>> was
>>>> >>> set, it was the "struct synch-state" from snmp_client. Of
>>>> course,
>>>> >>> magic belongs to the caller, and the perl library uses it
>>>> >> differently,
>>>> >>> so reaching into it is verboten. Introduce a new callback (that
>>>> >>> was already introduced in 5.8) to report this "retries exceeded"
>>>> >>> state, and use it in snmp_client."
>>>> >>>
>>>> >>> I think the problem is really about shutting down the agentx
>>>> connection
>>>> >>> when one(1) response is to late. I have
>>>> >>> done 2 patches (one that only write a better log message and one
>>>> that
>>>> >>> removes the "bad" code.
>>>> >>> With these patches I don't get any crash. I think that 5.7.3 has
>>>> this
>>>> >> issue
>>>> >>> as well, but it can not be crashed with the agentofdead code
>>>> >>>
>>>> >>> Can you please try this?
>>>> >>>
>>>> >>> Regards
>>>> >>> Anders Wallin
>>>> >>>
>>>> >>>
>>>> >>> On Wed, Apr 3, 2019 at 12:35 PM Josef Ridky <jridky@redhat.com>
>>>> wrote:
>>>> >>>
>>>> >>>> Hi,
>>>> >>>>
>>>> >>>> I have compared net-snmp-5.7.3 and net-snmp-5.8 and I have found,
>>>> that
>>>> >>>> following callbacks in snmplib/snmp_api.c causes the core dump
>>>> issue:
>>>> >>>>
>>>> >>>> --- old/snmplib/snmp_api.c 2019-04-03 12:13:55.126769866 +0200
>>>> >>>> +++ new/snmplib/snmp_api.c 2019-04-03 12:15:18.353420790 +0200
>>>> >>>> @@ -6731,9 +6731,9 @@ snmp_resend_request(struct session_list
>>>> >>>> sp->s_snmp_errno = SNMPERR_BAD_SENDTO;
>>>> >>>> sp->s_errno = errno;
>>>> >>>> snmp_set_detail(strerror(errno));
>>>> >>>> - if (rp->callback)
>>>> >>>> +/* if (rp->callback)
>>>> >>>> rp->callback(NETSNMP_CALLBACK_OP_SEND_FAILED, sp,
>>>> >>>> - rp->pdu->reqid, rp->pdu, rp->cb_data);
>>>> >>>> + rp->pdu->reqid, rp->pdu, rp->cb_data);*/
>>>> >>>> return -1;
>>>> >>>> } else {
>>>> >>>> netsnmp_get_monotonic_clock(&now);
>>>> >>>> @@ -6743,9 +6743,9 @@ snmp_resend_request(struct session_list
>>>> >>>> tv.tv_sec += tv.tv_usec / 1000000L;
>>>> >>>> tv.tv_usec %= 1000000L;
>>>> >>>> rp->expireM = tv;
>>>> >>>> - if (rp->callback)
>>>> >>>> +/* if (rp->callback)
>>>> >>>> rp->callback(NETSNMP_CALLBACK_OP_RESEND, sp,
>>>> >>>> - rp->pdu->reqid, rp->pdu, rp->cb_data);
>>>> >>>> + rp->pdu->reqid, rp->pdu, rp->cb_data);*/
>>>> >>>> }
>>>> >>>> return 0;
>>>> >>>> }
>>>> >>>>
>>>> >>>> Without them, all works as expected.
>>>> >>>>
>>>> >>>> Josef Ridky
>>>> >>>> Software Engineer
>>>> >>>> Core Services Team
>>>> >>>> Red Hat Czech, s.r.o.
>>>> >>>>
>>>> >>>> ----- Original Message -----
>>>> >>>> | From: "Anders Wallin" <wallinux@gmail.com>
>>>> >>>> | To: "Josef Ridky" <jridky@redhat.com>
>>>> >>>> | Cc: "net-snmp-coders" <net-snmp-coders@lists.sourceforge.net>
>>>> >>>> | Sent: Tuesday, April 2, 2019 6:27:54 PM
>>>> >>>> | Subject: Re: Core dump with net-snmp-5.8
>>>> >>>> |
>>>> >>>> | Hi Josef,
>>>> >>>> | I can reproduce the issue using the master branch, I will take a
>>>> look
>>>> >> at
>>>> >>>> it
>>>> >>>> | later tonight or tomorrow
>>>> >>>> |
>>>> >>>> | Regards
>>>> >>>> | Anders Wallin
>>>> >>>> |
>>>> >>>> |
>>>> >>>> | On Tue, Apr 2, 2019 at 3:42 PM Josef Ridky <jridky@redhat.com>
>>>> wrote:
>>>> >>>> |
>>>> >>>> | > Hi,
>>>> >>>> | >
>>>> >>>> | > thanks for your patch. Unfortunately, even when I have applied
>>>> it,
>>>> >> it
>>>> >>>> | > still ends with core dump due of 'double free or corruption
>>>> >> (fasttop)'
>>>> >>>> | >
>>>> >>>> | > When I run snmpd with -Dsnmp_agent,agentx/master it ends with:
>>>> >>>> | >
>>>> >>>> | > agentx/master: sending pdu (req=0x1d4,trans=0x1d3,sess=0x5)
>>>> >>>> | > snmp_agent: delegate session == 0x56207e165240
>>>> >>>> | > snmp_agent: end of handle_snmp_packet, asp = 0x56207e165240
>>>> >>>> | > agentx/master: callback resend
>>>> >>>> | > agentx/master: callback resend
>>>> >>>> | > agentx/master: timeout on session 0x56207dfd5400 req=0x1c9
>>>> >>>> | > agentx/master: close 0x56207dfd5400, -1
>>>> >>>> | > snmp_agent: removed 40 delegated request(s) for session
>>>> >> 0x56207dfce490
>>>> >>>> | > snmp_agent: processing delegated request, asp = 0x56207e165240
>>>> >>>> | > snmp_agent: canceling next walk for asp 0x56207e165240
>>>> >>>> | > snmp_agent: REMOVE session == 0x56207e165240
>>>> >>>> | > snmp_agent: agent_session 0x56207e165240 released
>>>> >>>> | > snmp_agent: processing delegated request, asp = 0x56207e1041a0
>>>> >>>> | > snmp_agent: canceling next walk for asp 0x56207e1041a0
>>>> >>>> | > snmp_agent: REMOVE session == 0x56207e1041a0
>>>> >>>> | > snmp_agent: agent_session 0x56207e1041a0 released
>>>> >>>> | > snmp_agent: processing delegated request, asp = 0x56207e1656c0
>>>> >>>> | > snmp_agent: canceling next walk for asp 0x56207e1656c0
>>>> >>>> | > snmp_agent: REMOVE session == 0x56207e1656c0
>>>> >>>> | > snmp_agent: agent_session 0x56207e1656c0 released
>>>> >>>> | > snmp_agent: processing delegated request, asp = 0x56207e11af40
>>>> >>>> | > snmp_agent: canceling next walk for asp 0x56207e11af40
>>>> >>>> | > snmp_agent: REMOVE session == 0x56207e11af40
>>>> >>>> | > snmp_agent: agent_session 0x56207e11af40 released
>>>> >>>> | > snmp_agent: processing delegated request, asp = 0x56207e118f00
>>>> >>>> | > snmp_agent: canceling next walk for asp 0x56207e118f00
>>>> >>>> | > snmp_agent: REMOVE session == 0x56207e118f00
>>>> >>>> | > snmp_agent: agent_session 0x56207e118f00 released
>>>> >>>> | > snmp_agent: processing delegated request, asp = 0x56207e11b540
>>>> >>>> | > snmp_agent: canceling next walk for asp 0x56207e11b540
>>>> >>>> | > snmp_agent: REMOVE session == 0x56207e11b540
>>>> >>>> | > snmp_agent: agent_session 0x56207e11b540 released
>>>> >>>> | > snmp_agent: processing delegated request, asp = 0x56207e11bd00
>>>> >>>> | > snmp_agent: canceling next walk for asp 0x56207e11bd00
>>>> >>>> | > snmp_agent: REMOVE session == 0x56207e11bd00
>>>> >>>> | > snmp_agent: agent_session 0x56207e11bd00 released
>>>> >>>> | > agentx/master: Continue removing delegated subsession reqests
>>>> >>>> | > agentx/master: close transport
>>>> >>>> | > snmp_agent: REMOVE session == 0x56207dfd5400
>>>> >>>> | > agentx/master: response too late on session 0x56207dfd5400
>>>> >>>> | > agentx/master: response too late on session 0x56207dfd5400
>>>> >>>> | > double free or corruption (fasttop)
>>>> >>>> | > Aborted (core dumped)
>>>> >>>> | >
>>>> >>>> | >
>>>> >>>> | > What's interesting, when I run it with -DALL it pass (at least
>>>> for
>>>> >>>> several
>>>> >>>> | > rounds).
>>>> >>>> | > It looks like some strange race condition.
>>>> >>>> | >
>>>> >>>> | > Regards
>>>> >>>> | >
>>>> >>>> | > Josef Ridky
>>>> >>>> | > Software Engineer
>>>> >>>> | > Core Services Team
>>>> >>>> | > Red Hat Czech, s.r.o.
>>>> >>>> | >
>>>> >>>> | > ----- Original Message -----
>>>> >>>> | > | From: "Anders Wallin" <wallinux@gmail.com>
>>>> >>>> | > | To: "Josef Ridky" <jridky@redhat.com>
>>>> >>>> | > | Cc: "net-snmp-coders" <net-snmp-coders@lists.sourceforge.net
>>>> >
>>>> >>>> | > | Sent: Tuesday, April 2, 2019 1:46:40 PM
>>>> >>>> | > | Subject: Re: Core dump with net-snmp-5.8
>>>> >>>> | > |
>>>> >>>> | > | Hi Josef,
>>>> >>>> | > |
>>>> >>>> | > | I think it's the same issue as
>>>> >>>> | > https://sourceforge.net/p/net-snmp/bugs/2914/
>>>> >>>> | > | (where I also posted the solution)
>>>> >>>> | > | Regards
>>>> >>>> | > | Anders Wallin
>>>> >>>> | > |
>>>> >>>> | > |
>>>> >>>> | > | On Tue, Apr 2, 2019 at 12:43 PM Josef Ridky <
>>>> jridky@redhat.com>
>>>> >>>> wrote:
>>>> >>>> | > |
>>>> >>>> | > | > Hi,
>>>> >>>> | > | >
>>>> >>>> | > | > recently, I have hit to an issue in net-snmp-5.8, that is
>>>> >>>> connected to
>>>> >>>> | > the
>>>> >>>> | > | > bug report [1].
>>>> >>>> | > | >
>>>> >>>> | > | > When I tried to run agentofdeath test from [1], snmpd
>>>> daemon
>>>> >> will
>>>> >>>> crash
>>>> >>>> | > | > with malloc(): smallbin double linked list corrupted or
>>>> double
>>>> >>>> free()
>>>> >>>> | > issue
>>>> >>>> | > | > and dumps core (see bellow).
>>>> >>>> | > | > From log file, I can identified one issue with "Unknown
>>>> >> operation".
>>>> >>>> | > | >
>>>> >>>> | > | > This issue is in the agentx_got_response function
>>>> >>>> | > | > (agent/mibgroup/agentx/master.c). There isn't implemented
>>>> action
>>>> >>>> for
>>>> >>>> | > | > NETSNMP_CALLBACK_OP_RESEND (defined in
>>>> >>>> | > | > include/net-snmp/library/snmp_api.h).
>>>> >>>> | > | > As result "Unknown operation 6 in agentx_got_response" is
>>>> shown
>>>> >> in
>>>> >>>> log
>>>> >>>> | > | > file.
>>>> >>>> | > | >
>>>> >>>> | > | > /var/log/messages
>>>> >>>> | > | > -------------------------------
>>>> >>>> | > | > Mar 28 06:52:42 localhost snmpd[12073]: Unknown operation
>>>> 6 in
>>>> >>>> | > | > agentx_got_response
>>>> >>>> | > | > Mar 28 06:52:43 localhost snmpd[12073]: Unknown operation
>>>> 6 in
>>>> >>>> | > | > agentx_got_response
>>>> >>>> | > | > Mar 28 06:52:43 localhost snmpd[12073]: malloc(): smallbin
>>>> >> double
>>>> >>>> | > linked
>>>> >>>> | > | > list corrupted
>>>> >>>> | > | > Mar 28 06:52:43 localhost systemd[1]: Started Process Core
>>>> Dump
>>>> >>>> (PID
>>>> >>>> | > | > 13652/UID 0).
>>>> >>>> | > | > Mar 28 06:52:48 localhost systemd[1]: snmpd.service: Main
>>>> >> process
>>>> >>>> | > exited,
>>>> >>>> | > | > code=dumped, status=6/ABRT
>>>> >>>> | > | > Mar 28 06:52:48 localhost systemd[1]: snmpd.service:
>>>> Failed with
>>>> >>>> result
>>>> >>>> | > | > 'core-dump'.
>>>> >>>> | > | > -------------------------------
>>>> >>>> | > | >
>>>> >>>> | > | > The "Unknown operation" callback is caused by newly added
>>>> piece
>>>> >> of
>>>> >>>> | > code in
>>>> >>>> | > | > snmplib/snmp_api.c:
>>>> >>>> | > | >
>>>> >>>> | > | > static int
>>>> >>>> | > | > snmp_resend_request(struct session_list *slp,
>>>> >> netsnmp_request_list
>>>> >>>> | > *rp,
>>>> >>>> | > | > int incr_retries)
>>>> >>>> | > | > {
>>>> >>>> | > | >
>>>> >>>> | > | > ...
>>>> >>>> | > | >
>>>> >>>> | > | > tv.tv_sec += tv.tv_usec / 1000000L;
>>>> >>>> | > | > tv.tv_usec %= 1000000L;
>>>> >>>> | > | > rp->expireM = tv;
>>>> >>>> | > | > + if (rp->callback)
>>>> >>>> | > | > + rp->callback(NETSNMP_CALLBACK_OP_RESEND, sp,
>>>> >>>> | > | > + rp->pdu->reqid, rp->pdu,
>>>> rp->cb_data);
>>>> >>>> | > | > }
>>>> >>>> | > | > return 0;
>>>> >>>> | > | > }
>>>> >>>> | > | >
>>>> >>>> | > | >
>>>> >>>> | > | > When I tried to remove it, it just stop complaining about
>>>> >>>> operation 6,
>>>> >>>> | > but
>>>> >>>> | > | > the core dump is still present.
>>>> >>>> | > | >
>>>> >>>> | > | > May I ask you for help with this issue? Do you have any
>>>> idea,
>>>> >> what
>>>> >>>> | > causing
>>>> >>>> | > | > this issue in 5.8 and how to fix it?
>>>> >>>> | > | > I know, that Jan Safranek has fixed this for 5.7 by commit
>>>> [2],
>>>> >>>> but it
>>>> >>>> | > | > looks like something other has changed and this issue is
>>>> current
>>>> >>>> again.
>>>> >>>> | > | >
>>>> >>>> | > | > [1] https://sourceforge.net/p/net-snmp/bugs/2411/
>>>> >>>> | > | > [2]
>>>> >>>> | > | >
>>>> >>>> | >
>>>> >>>>
>>>> >>
>>>> https://github.com/net-snmp/net-snmp/commit/793d596838ff7cb48a73b675d62897c56c9e62df
>>>> >>>> | > | >
>>>> >>>> | > | > Regards
>>>> >>>> | > | >
>>>> >>>> | > | > Josef Ridky
>>>> >>>> | > | > Software Engineer
>>>> >>>> | > | > Core Services Team
>>>> >>>> | > | > Red Hat Czech, s.r.o.
>>>> >>>> | > | >
>>>> >>>> | > | >
>>>> >>>> | > | >
>>>> >>>> | > | > _______________________________________________
>>>> >>>> | > | > Net-snmp-coders mailing list
>>>> >>>> | > | > Net-snmp-coders@lists.sourceforge.net
>>>> >>>> | > | >
>>>> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>>>> >>>> | > | >
>>>> >>>> | > |
>>>> >>>> | >
>>>> >>>> |
>>>> >>>>
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>> _______________________________________________
>>>> >>> Net-snmp-coders mailing list
>>>> >>> Net-snmp-coders@lists.sourceforge.net
>>>> >>> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>>>> >>>
>>>> >>
>>>> >
>>>>
>>> _______________________________________________
>>> Net-snmp-coders mailing list
>>> Net-snmp-coders@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>>>
>>
>>
>> --
>> *Sam Tannous*
>> Engineering
>> Cumulus Networks ®
>> +1 650 383 6700 x 1106
>> <http://www.cumulusnetworks,com>www.cumulusnetworks.com
>>
>> Evaluate Cumulus ® Linux ®
>> https://cumulusnetworks.com/product/secure/evaluate/
>>
>> Become a Partner
>> http://cumulusnetworks.com/partners/become-a-partner/
>>
>
>
> --
> *Sam Tannous*
> Engineering
> Cumulus Networks ®
> +1 650 383 6700 x 1106
> <http://www.cumulusnetworks,com>www.cumulusnetworks.com
>
> Evaluate Cumulus ® Linux ®
> https://cumulusnetworks.com/product/secure/evaluate/
>
> Become a Partner
> http://cumulusnetworks.com/partners/become-a-partner/
>
[Attachment #5 (text/html)]
<div dir="ltr">Hi Sam,<div><br></div><div>I'm not a maintainer for net-snmp, but \
it was merged into 5-8-patches yesterday </div><div><br></div><div>Regards<br \
clear="all"><div><div dir="ltr" class="gmail_signature" \
data-smartmail="gmail_signature">Anders Wallin</div></div><br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 10, 2019 at 8:04 PM \
Sam Tannous <<a href="mailto:stannous@cumulusnetworks.com">stannous@cumulusnetworks.com</a>> \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div \
class="gmail_default" style="font-family:verdana,sans-serif">Hi Anders,</div><div \
class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div \
class="gmail_default" style="font-family:verdana,sans-serif">We've been testing \
the patch for </div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><a \
href="https://sourceforge.net/p/net-snmp/bugs/2914/" \
target="_blank">https://sourceforge.net/p/net-snmp/bugs/2914/</a><br></div><div \
class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div \
class="gmail_default" style="font-family:verdana,sans-serif">and this \
works.</div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" \
style="font-family:verdana,sans-serif">Before the patch, we were getting lots of core \
dumps where the flow in</div><div class="gmail_default" \
style="font-family:verdana,sans-serif">master.c hits the default case and memory gets \
double-freed and a core happens.</div><div class="gmail_default" \
style="font-family:verdana,sans-serif">We'd love to get this into V5-8-patches \
soon.</div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" \
style="font-family:verdana,sans-serif">Thanks,</div><div class="gmail_default" \
style="font-family:verdana,sans-serif">Sam</div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2019 at 9:13 AM \
Sam Tannous <<a href="mailto:stannous@cumulusnetworks.com" \
target="_blank">stannous@cumulusnetworks.com</a>> wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" \
style="font-family:verdana,sans-serif">Hi Anders,</div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" \
style="font-family:verdana,sans-serif">I fixed some snmpv3 (bulkget) coredumps a \
while ago.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><a \
href="https://sourceforge.net/p/net-snmp/patches/1388/" \
target="_blank">https://sourceforge.net/p/net-snmp/patches/1388/</a> <br></div><div \
class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div \
class="gmail_default" style="font-family:verdana,sans-serif">While not directly \
related, the (double-free memory) core dumps</div><div class="gmail_default" \
style="font-family:verdana,sans-serif">were easily triggered by any error condition \
within a v3 bulkget.</div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" \
style="font-family:verdana,sans-serif">I'm hoping my patch will get picked up \
soon :-(</div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" \
style="font-family:verdana,sans-serif">Thanks,</div><div class="gmail_default" \
style="font-family:verdana,sans-serif">Sam</div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2019 at 6:54 AM \
Anders Wallin <<a href="mailto:wallinux@gmail.com" \
target="_blank">wallinux@gmail.com</a>> wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr">Now it works \
fine!<div><br></div><div>thx<br clear="all"><div><div dir="ltr" \
class="gmail-m_-8613134433695791110gmail-m_6929598511783199391gmail-m_-1455694735376954073gmail_signature">Anders \
Wallin</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Tue, Apr 9, 2019 at 2:26 AM Masayoshi Mizuma <<a \
href="mailto:msys.mizuma@gmail.com" target="_blank">msys.mizuma@gmail.com</a>> \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Anders,<br> <br>
Thank you for your feedback!<br>
I attach the v2 patch. Could you try it?<br>
<br>
On the v1 patch, I missed the check for the request callback. So, the request<br>
gets removed even though the callback doesn't run.<br>
<br>
Thanks,<br>
Masa<br>
<br>
On 4/8/19 11:06 AM, Anders Wallin wrote:<br>
> Hi Masa,<br>
> <br>
> looks like it solves the problem reported by Josef, BUT it breaks DTLSUDP.<br>
> I run the tests w/o analyzing why.<br>
> To reproduce the issue I did the following using net-snmp master branch,<br>
> plus these patches<br>
> 39485c6f2 - snmplib/snmp_api: Remove the request on the session when the<br>
> sending is failed (10 minutes ago) <Masayoshi Mizuma><br>
> 06a4d52d8 - agentx: logging to late responses (5 days ago) <Anders \
Wallin><br> > a420d87d3 - BUG2914: Agent master needs to treat resend as normal \
(5 days<br> > ago) <Anders Wallin><br>
> eaad09d04 - (origin/master, origin/HEAD, master) Merge branch<br>
> 'V5-8-patches' (9 weeks ago) <Bart Van Assche><br>
> <br>
> $ ./configure --prefix=/usr \<br>
> --with-persistent-directory=/var/lib/net-snmp \<br>
> --with-mib-modules='smux tlstm-mib tsm-mib \
examples/example<br> > examples/notification' \<br>
> --with-security-modules="tsm" \<br>
> --with-transports="TLSTCP DTLSUDP" \<br>
> --enable-shared \<br>
> --with-defaults \<br>
> --enable-ipv6 \<br>
> --with-cflags="-g -O2" \<br>
> --without-elf<br>
> <br>
> $ make install<br>
> $ cd testing<br>
> $ ./RUNFULLTESTS -g tls<br>
> DTLS-UDP user certificate tests .......................... 41/?<br>
> This hangs forever in "41" with snmpd.log saying....<br>
> ......<br>
> 2019-04-08 16:29:11<br>
> 2019-04-08 16:29:11<br>
> Received 0 byte packet from DTLSUDP: unknown<br>
> 2019-04-08 16:29:11<br>
> 2019-04-08 16:29:13<br>
> Received 0 byte packet from DTLSUDP: unknown<br>
> 2019-04-08 16:29:13<br>
> 2019-04-08 16:29:15<br>
> Received 0 byte packet from DTLSUDP: unknown<br>
> 2019-04-08 16:29:15<br>
> 2019-04-08 16:29:15 tls verification failure: ok=0 ctx=0x55ee625b4170<br>
> depth=0 err=18:self signed certificate<br>
> 2019-04-08 16:29:15 ---- OpenSSL Related Errors: ----<br>
> 2019-04-08 16:29:15 TLS error: SSL_read: rc=-1, sslerror = 1<br>
> (SSL_ERROR_SSL)<br>
> 2019-04-08 16:29:15 TLS Error: certificate verify failed<br>
> 2019-04-08 16:29:15 ---- End of OpenSSL Errors ----<br>
> 2019-04-08 16:29:15 ---- OpenSSL Related Errors: ----<br>
> 2019-04-08 16:29:15 TLS error: SSL_read: rc=-1, sslerror = 5<br>
> (SSL_ERROR_SYSCALL): system_error=0 (Success)<br>
> 2019-04-08 16:29:15 TLS Error: (null)<br>
> 2019-04-08 16:29:16 ---- OpenSSL Related Errors: ----<br>
> 2019-04-08 16:29:16 TLS error: SSL_read: rc=-1, sslerror = 5<br>
> (SSL_ERROR_SYSCALL): system_error=0 (Success)<br>
> 2019-04-08 16:29:16 TLS Error: (null)<br>
> 2019-04-08 16:29:16 ---- OpenSSL Related Errors: ----<br>
> 2019-04-08 16:29:16 TLS error: SSL_read: rc=-1, sslerror = 5<br>
> (SSL_ERROR_SYSCALL): system_error=0 (Success)<br>
> 2019-04-08 16:29:16 TLS Error: (null)<br>
> <br>
> With the fix suggested på Josef I don't see the DTLSUDP problem, but \
maybe<br> > there are other problems.<br>
> <br>
> Regards<br>
> Anders Wallin<br>
> <br>
> PS. thx for adding commit info to a420d87d3, I updated the patch with your<br>
> commit comments<br>
> <br>
> <br>
> On Mon, Apr 8, 2019 at 3:27 PM Masayoshi Mizuma <<a \
href="mailto:msys.mizuma@gmail.com" target="_blank">msys.mizuma@gmail.com</a>><br> \
> wrote:<br> > <br>
>> Hi Josef,<br>
>><br>
>> I attach two patches to fix the memory inconsistency if the request is<br>
>> resend and timed out.<br>
>> Could you try them?<br>
>><br>
>> - 0001-agentx-master-Return-when-NETSNMP_CALLBACK_OP_RESEND.patch<br>
>><br>
>> This patch was posted by Anders, and I tried to add the description.<br>
>> This patch fixes the missing NETSNMP_CALLBACK_OP_RESEND callback.<br>
>><br>
>> - 0002-snmplib-snmp_api-Remove-the-request-on-the-session-w.patch<br>
>><br>
>> This patch fixes the race between NETSNMP_CALLBACK_OP_SEND_FAILED<br>
>> and NETSNMP_CALLBACK_OP_TIMED_OUT callback. If the request is \
failed,<br> >> then remove the request from the internal session.<br>
>><br>
>> Thanks,<br>
>> Masa<br>
>><br>
>> On 4/3/19 9:34 AM, Anders Wallin wrote:<br>
>>> The introduction of that code fixes another issue;<br>
>>> "commit 56c30b11f3616ea4f0c38a21e08e78f050096020<br>
>>> Author: Bill Fenner <<a href="mailto:fenner@gmail.com" \
target="_blank">fenner@gmail.com</a>><br> >>> Date: Wed Dec 20 \
21:52:10 2017 +0000<br> >>><br>
>>> NEWS: snmplib: PATCH: 1349: Fix perl/other crash against bad \
SNMPv3<br> >>> agent<br>
>>><br>
>>> With the patch in 1214, the snmp_api code assumed that if magic \
was<br> >>> set, it was the "struct synch-state" from \
snmp_client. Of course,<br> >>> magic belongs to the caller, and \
the perl library uses it<br> >> differently,<br>
>>> so reaching into it is verboten. Introduce a new callback \
(that<br> >>> was already introduced in 5.8) to report this \
"retries exceeded"<br> >>> state, and use it in \
snmp_client."<br> >>><br>
>>> I think the problem is really about shutting down the agentx \
connection<br> >>> when one(1) response is to late. I have<br>
>>> done 2 patches (one that only write a better log message and one \
that<br> >>> removes the "bad" code.<br>
>>> With these patches I don't get any crash. I think that 5.7.3 has \
this<br> >> issue<br>
>>> as well, but it can not be crashed with the agentofdead code<br>
>>><br>
>>> Can you please try this?<br>
>>><br>
>>> Regards<br>
>>> Anders Wallin<br>
>>><br>
>>><br>
>>> On Wed, Apr 3, 2019 at 12:35 PM Josef Ridky <<a \
href="mailto:jridky@redhat.com" target="_blank">jridky@redhat.com</a>> wrote:<br> \
>>><br> >>>> Hi,<br>
>>>><br>
>>>> I have compared net-snmp-5.7.3 and net-snmp-5.8 and I have found, \
that<br> >>>> following callbacks in snmplib/snmp_api.c causes the core \
dump issue:<br> >>>><br>
>>>> --- old/snmplib/snmp_api.c 2019-04-03 12:13:55.126769866 \
+0200<br> >>>> +++ new/snmplib/snmp_api.c 2019-04-03 \
12:15:18.353420790 +0200<br> >>>> @@ -6731,9 +6731,9 @@ \
snmp_resend_request(struct session_list<br> >>>> \
sp->s_snmp_errno = SNMPERR_BAD_SENDTO;<br> >>>> \
sp->s_errno = errno;<br> >>>> \
snmp_set_detail(strerror(errno));<br> >>>> - if \
(rp->callback)<br> >>>> +/* if (rp->callback)<br>
>>>> rp->callback(NETSNMP_CALLBACK_OP_SEND_FAILED, \
sp,<br> >>>> - rp->pdu->reqid, \
rp->pdu, rp->cb_data);<br> >>>> + \
rp->pdu->reqid, rp->pdu, rp->cb_data);*/<br> >>>> \
return -1;<br> >>>> } else {<br>
>>>> netsnmp_get_monotonic_clock(&now);<br>
>>>> @@ -6743,9 +6743,9 @@ snmp_resend_request(struct session_list<br>
>>>> tv.tv_sec += tv.tv_usec / 1000000L;<br>
>>>> tv.tv_usec %= 1000000L;<br>
>>>> rp->expireM = tv;<br>
>>>> - if (rp->callback)<br>
>>>> +/* if (rp->callback)<br>
>>>> rp->callback(NETSNMP_CALLBACK_OP_RESEND, \
sp,<br> >>>> - rp->pdu->reqid, \
rp->pdu, rp->cb_data);<br> >>>> + \
rp->pdu->reqid, rp->pdu, rp->cb_data);*/<br> >>>> \
}<br> >>>> return 0;<br>
>>>> }<br>
>>>><br>
>>>> Without them, all works as expected.<br>
>>>><br>
>>>> Josef Ridky<br>
>>>> Software Engineer<br>
>>>> Core Services Team<br>
>>>> Red Hat Czech, s.r.o.<br>
>>>><br>
>>>> ----- Original Message -----<br>
>>>> | From: "Anders Wallin" <<a \
href="mailto:wallinux@gmail.com" target="_blank">wallinux@gmail.com</a>><br> \
>>>> | To: "Josef Ridky" <<a href="mailto:jridky@redhat.com" \
target="_blank">jridky@redhat.com</a>><br> >>>> | Cc: \
"net-snmp-coders" <<a \
href="mailto:net-snmp-coders@lists.sourceforge.net" \
target="_blank">net-snmp-coders@lists.sourceforge.net</a>><br> >>>> | \
Sent: Tuesday, April 2, 2019 6:27:54 PM<br> >>>> | Subject: Re: Core dump \
with net-snmp-5.8<br> >>>> |<br>
>>>> | Hi Josef,<br>
>>>> | I can reproduce the issue using the master branch, I will take a \
look<br> >> at<br>
>>>> it<br>
>>>> | later tonight or tomorrow<br>
>>>> |<br>
>>>> | Regards<br>
>>>> | Anders Wallin<br>
>>>> |<br>
>>>> |<br>
>>>> | On Tue, Apr 2, 2019 at 3:42 PM Josef Ridky <<a \
href="mailto:jridky@redhat.com" target="_blank">jridky@redhat.com</a>> wrote:<br> \
>>>> |<br> >>>> | > Hi,<br>
>>>> | ><br>
>>>> | > thanks for your patch. Unfortunately, even when I have \
applied it,<br> >> it<br>
>>>> | > still ends with core dump due of 'double free or \
corruption<br> >> (fasttop)'<br>
>>>> | ><br>
>>>> | > When I run snmpd with -Dsnmp_agent,agentx/master it ends \
with:<br> >>>> | ><br>
>>>> | > agentx/master: sending pdu \
(req=0x1d4,trans=0x1d3,sess=0x5)<br> >>>> | > snmp_agent: delegate \
session == 0x56207e165240<br> >>>> | > snmp_agent: end of \
handle_snmp_packet, asp = 0x56207e165240<br> >>>> | > agentx/master: \
callback resend<br> >>>> | > agentx/master: callback resend<br>
>>>> | > agentx/master: timeout on session 0x56207dfd5400 \
req=0x1c9<br> >>>> | > agentx/master: close 0x56207dfd5400, -1<br>
>>>> | > snmp_agent: removed 40 delegated request(s) for session<br>
>> 0x56207dfce490<br>
>>>> | > snmp_agent: processing delegated request, asp = \
0x56207e165240<br> >>>> | > snmp_agent: canceling next walk for asp \
0x56207e165240<br> >>>> | > snmp_agent: REMOVE session == \
0x56207e165240<br> >>>> | > snmp_agent: agent_session 0x56207e165240 \
released<br> >>>> | > snmp_agent: processing delegated request, asp = \
0x56207e1041a0<br> >>>> | > snmp_agent: canceling next walk for asp \
0x56207e1041a0<br> >>>> | > snmp_agent: REMOVE session == \
0x56207e1041a0<br> >>>> | > snmp_agent: agent_session 0x56207e1041a0 \
released<br> >>>> | > snmp_agent: processing delegated request, asp = \
0x56207e1656c0<br> >>>> | > snmp_agent: canceling next walk for asp \
0x56207e1656c0<br> >>>> | > snmp_agent: REMOVE session == \
0x56207e1656c0<br> >>>> | > snmp_agent: agent_session 0x56207e1656c0 \
released<br> >>>> | > snmp_agent: processing delegated request, asp = \
0x56207e11af40<br> >>>> | > snmp_agent: canceling next walk for asp \
0x56207e11af40<br> >>>> | > snmp_agent: REMOVE session == \
0x56207e11af40<br> >>>> | > snmp_agent: agent_session 0x56207e11af40 \
released<br> >>>> | > snmp_agent: processing delegated request, asp = \
0x56207e118f00<br> >>>> | > snmp_agent: canceling next walk for asp \
0x56207e118f00<br> >>>> | > snmp_agent: REMOVE session == \
0x56207e118f00<br> >>>> | > snmp_agent: agent_session 0x56207e118f00 \
released<br> >>>> | > snmp_agent: processing delegated request, asp = \
0x56207e11b540<br> >>>> | > snmp_agent: canceling next walk for asp \
0x56207e11b540<br> >>>> | > snmp_agent: REMOVE session == \
0x56207e11b540<br> >>>> | > snmp_agent: agent_session 0x56207e11b540 \
released<br> >>>> | > snmp_agent: processing delegated request, asp = \
0x56207e11bd00<br> >>>> | > snmp_agent: canceling next walk for asp \
0x56207e11bd00<br> >>>> | > snmp_agent: REMOVE session == \
0x56207e11bd00<br> >>>> | > snmp_agent: agent_session 0x56207e11bd00 \
released<br> >>>> | > agentx/master: Continue removing delegated \
subsession reqests<br> >>>> | > agentx/master: close transport<br>
>>>> | > snmp_agent: REMOVE session == 0x56207dfd5400<br>
>>>> | > agentx/master: response too late on session \
0x56207dfd5400<br> >>>> | > agentx/master: response too late on \
session 0x56207dfd5400<br> >>>> | > double free or corruption \
(fasttop)<br> >>>> | > Aborted (core dumped)<br>
>>>> | ><br>
>>>> | ><br>
>>>> | > What's interesting, when I run it with -DALL it pass (at \
least for<br> >>>> several<br>
>>>> | > rounds).<br>
>>>> | > It looks like some strange race condition.<br>
>>>> | ><br>
>>>> | > Regards<br>
>>>> | ><br>
>>>> | > Josef Ridky<br>
>>>> | > Software Engineer<br>
>>>> | > Core Services Team<br>
>>>> | > Red Hat Czech, s.r.o.<br>
>>>> | ><br>
>>>> | > ----- Original Message -----<br>
>>>> | > | From: "Anders Wallin" <<a \
href="mailto:wallinux@gmail.com" target="_blank">wallinux@gmail.com</a>><br> \
>>>> | > | To: "Josef Ridky" <<a \
href="mailto:jridky@redhat.com" target="_blank">jridky@redhat.com</a>><br> \
>>>> | > | Cc: "net-snmp-coders" <<a \
href="mailto:net-snmp-coders@lists.sourceforge.net" \
target="_blank">net-snmp-coders@lists.sourceforge.net</a>><br> >>>> | \
> | Sent: Tuesday, April 2, 2019 1:46:40 PM<br> >>>> | > | Subject: \
Re: Core dump with net-snmp-5.8<br> >>>> | > |<br>
>>>> | > | Hi Josef,<br>
>>>> | > |<br>
>>>> | > | I think it's the same issue as<br>
>>>> | > <a href="https://sourceforge.net/p/net-snmp/bugs/2914/" \
rel="noreferrer" target="_blank">https://sourceforge.net/p/net-snmp/bugs/2914/</a><br>
>>>> | > | (where I also posted the solution)<br>
>>>> | > | Regards<br>
>>>> | > | Anders Wallin<br>
>>>> | > |<br>
>>>> | > |<br>
>>>> | > | On Tue, Apr 2, 2019 at 12:43 PM Josef Ridky <<a \
href="mailto:jridky@redhat.com" target="_blank">jridky@redhat.com</a>><br> \
>>>> wrote:<br> >>>> | > |<br>
>>>> | > | > Hi,<br>
>>>> | > | ><br>
>>>> | > | > recently, I have hit to an issue in net-snmp-5.8, that \
is<br> >>>> connected to<br>
>>>> | > the<br>
>>>> | > | > bug report [1].<br>
>>>> | > | ><br>
>>>> | > | > When I tried to run agentofdeath test from [1], snmpd \
daemon<br> >> will<br>
>>>> crash<br>
>>>> | > | > with malloc(): smallbin double linked list corrupted \
or double<br> >>>> free()<br>
>>>> | > issue<br>
>>>> | > | > and dumps core (see bellow).<br>
>>>> | > | > From log file, I can identified one issue with \
"Unknown<br> >> operation".<br>
>>>> | > | ><br>
>>>> | > | > This issue is in the agentx_got_response function<br>
>>>> | > | > (agent/mibgroup/agentx/master.c). There isn't \
implemented action<br> >>>> for<br>
>>>> | > | > NETSNMP_CALLBACK_OP_RESEND (defined in<br>
>>>> | > | > include/net-snmp/library/snmp_api.h).<br>
>>>> | > | > As result "Unknown operation 6 in \
agentx_got_response" is shown<br> >> in<br>
>>>> log<br>
>>>> | > | > file.<br>
>>>> | > | ><br>
>>>> | > | > /var/log/messages<br>
>>>> | > | > -------------------------------<br>
>>>> | > | > Mar 28 06:52:42 localhost snmpd[12073]: Unknown \
operation 6 in<br> >>>> | > | > agentx_got_response<br>
>>>> | > | > Mar 28 06:52:43 localhost snmpd[12073]: Unknown \
operation 6 in<br> >>>> | > | > agentx_got_response<br>
>>>> | > | > Mar 28 06:52:43 localhost snmpd[12073]: malloc(): \
smallbin<br> >> double<br>
>>>> | > linked<br>
>>>> | > | > list corrupted<br>
>>>> | > | > Mar 28 06:52:43 localhost systemd[1]: Started Process \
Core Dump<br> >>>> (PID<br>
>>>> | > | > 13652/UID 0).<br>
>>>> | > | > Mar 28 06:52:48 localhost systemd[1]: snmpd.service: \
Main<br> >> process<br>
>>>> | > exited,<br>
>>>> | > | > code=dumped, status=6/ABRT<br>
>>>> | > | > Mar 28 06:52:48 localhost systemd[1]: snmpd.service: \
Failed with<br> >>>> result<br>
>>>> | > | > 'core-dump'.<br>
>>>> | > | > -------------------------------<br>
>>>> | > | ><br>
>>>> | > | > The "Unknown operation" callback is caused \
by newly added piece<br> >> of<br>
>>>> | > code in<br>
>>>> | > | > snmplib/snmp_api.c:<br>
>>>> | > | ><br>
>>>> | > | > static int<br>
>>>> | > | > snmp_resend_request(struct session_list *slp,<br>
>> netsnmp_request_list<br>
>>>> | > *rp,<br>
>>>> | > | > int incr_retries)<br>
>>>> | > | > {<br>
>>>> | > | ><br>
>>>> | > | > ...<br>
>>>> | > | ><br>
>>>> | > | > tv.tv_sec += tv.tv_usec / 1000000L;<br>
>>>> | > | > tv.tv_usec %= 1000000L;<br>
>>>> | > | > rp->expireM = tv;<br>
>>>> | > | > + if (rp->callback)<br>
>>>> | > | > + \
rp->callback(NETSNMP_CALLBACK_OP_RESEND, sp,<br> >>>> | > | > + \
rp->pdu->reqid, rp->pdu, rp->cb_data);<br> >>>> | > | > \
}<br> >>>> | > | > return 0;<br>
>>>> | > | > }<br>
>>>> | > | ><br>
>>>> | > | ><br>
>>>> | > | > When I tried to remove it, it just stop complaining \
about<br> >>>> operation 6,<br>
>>>> | > but<br>
>>>> | > | > the core dump is still present.<br>
>>>> | > | ><br>
>>>> | > | > May I ask you for help with this issue? Do you have \
any idea,<br> >> what<br>
>>>> | > causing<br>
>>>> | > | > this issue in 5.8 and how to fix it?<br>
>>>> | > | > I know, that Jan Safranek has fixed this for 5.7 by \
commit [2],<br> >>>> but it<br>
>>>> | > | > looks like something other has changed and this issue \
is current<br> >>>> again.<br>
>>>> | > | ><br>
>>>> | > | > [1] <a \
href="https://sourceforge.net/p/net-snmp/bugs/2411/" rel="noreferrer" \
target="_blank">https://sourceforge.net/p/net-snmp/bugs/2411/</a><br> \
>>>> | > | > [2]<br> >>>> | > | ><br>
>>>> | ><br>
>>>><br>
>> <a href="https://github.com/net-snmp/net-snmp/commit/793d596838ff7cb48a73b675d62897c56c9e62df" \
rel="noreferrer" target="_blank">https://github.com/net-snmp/net-snmp/commit/793d596838ff7cb48a73b675d62897c56c9e62df</a><br>
>>>> | > | ><br>
>>>> | > | > Regards<br>
>>>> | > | ><br>
>>>> | > | > Josef Ridky<br>
>>>> | > | > Software Engineer<br>
>>>> | > | > Core Services Team<br>
>>>> | > | > Red Hat Czech, s.r.o.<br>
>>>> | > | ><br>
>>>> | > | ><br>
>>>> | > | ><br>
>>>> | > | > _______________________________________________<br>
>>>> | > | > Net-snmp-coders mailing list<br>
>>>> | > | > <a href="mailto:Net-snmp-coders@lists.sourceforge.net" \
target="_blank">Net-snmp-coders@lists.sourceforge.net</a><br> >>>> | > \
| > <a href="https://lists.sourceforge.net/lists/listinfo/net-snmp-coders" \
rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/net-snmp-coders</a><br>
>>>> | > | ><br>
>>>> | > |<br>
>>>> | ><br>
>>>> |<br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Net-snmp-coders mailing list<br>
>>> <a href="mailto:Net-snmp-coders@lists.sourceforge.net" \
target="_blank">Net-snmp-coders@lists.sourceforge.net</a><br> >>> <a \
href="https://lists.sourceforge.net/lists/listinfo/net-snmp-coders" rel="noreferrer" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/net-snmp-coders</a><br> \
>>><br> >><br>
> <br>
</blockquote></div>
_______________________________________________<br>
Net-snmp-coders mailing list<br>
<a href="mailto:Net-snmp-coders@lists.sourceforge.net" \
target="_blank">Net-snmp-coders@lists.sourceforge.net</a><br> <a \
href="https://lists.sourceforge.net/lists/listinfo/net-snmp-coders" rel="noreferrer" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/net-snmp-coders</a><br> \
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" \
class="gmail-m_-8613134433695791110gmail-m_6929598511783199391gmail_signature"><div \
dir="ltr"><div style="color:rgb(0,0,0);font-family:Times"><font size="2"><b>Sam \
Tannous</b></font><br><font size="2">Engineering</font><br><span \
style="font-size:small">Cumulus Networks</span><span \
style="font-size:small;font-family:arial,helvetica,sans-serif"> ®</span><br><span \
style="font-size:small"><span style="color:rgb(0,90,149)"><a \
style="color:rgb(0,90,149);text-decoration:none">+1 650 383 6700</a></span> x \
1106</span><br><span style="font-size:small"><span style="color:rgb(0,90,149)"><a \
href="http://www.cumulusnetworks,com" \
style="color:rgb(0,90,149);text-decoration:none" target="_blank"></a></span><span \
style="color:rgb(0,90,149)"><a href="http://www.cumulusnetworks.com" \
style="color:rgb(0,90,149);text-decoration:none" \
target="_blank">www.cumulusnetworks.com</a></span></span><br></div><div \
style="color:rgb(0,0,0);font-family:Times;font-size:14px"><span \
style="font-family:arial,helvetica,sans-serif;font-size:small"> </span></div><div \
style="color:rgb(0,0,0);font-family:Times;font-size:14px"><span \
style="font-family:arial,helvetica,sans-serif;font-size:small">Evaluate Cumulus ® \
Linux ®<br><span style="color:rgb(0,90,149)"><span><a \
href="https://cumulusnetworks.com/product/secure/evaluate/" \
style="color:rgb(0,90,149);text-decoration:none" \
target="_blank">https://cumulusnetworks.com/product/secure/evaluate/</a></span></span><br><br>Become \
a Partner<br><span style="color:rgb(0,90,149)"><span><a \
href="http://cumulusnetworks.com/partners/become-a-partner/" \
style="color:rgb(0,90,149);text-decoration:none" \
target="_blank">http://cumulusnetworks.com/partners/become-a-partner/</a></span></span></span></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" \
class="gmail-m_-8613134433695791110gmail_signature"><div dir="ltr"><div \
style="color:rgb(0,0,0);font-family:Times"><font size="2"><b>Sam \
Tannous</b></font><br><font size="2">Engineering</font><br><span \
style="font-size:small">Cumulus Networks</span><span \
style="font-size:small;font-family:arial,helvetica,sans-serif"> ®</span><br><span \
style="font-size:small"><span style="color:rgb(0,90,149)"><a \
style="color:rgb(0,90,149);text-decoration:none">+1 650 383 6700</a></span> x \
1106</span><br><span style="font-size:small"><span style="color:rgb(0,90,149)"><a \
href="http://www.cumulusnetworks,com" \
style="color:rgb(0,90,149);text-decoration:none" target="_blank"></a></span><span \
style="color:rgb(0,90,149)"><a href="http://www.cumulusnetworks.com" \
style="color:rgb(0,90,149);text-decoration:none" \
target="_blank">www.cumulusnetworks.com</a></span></span><br></div><div \
style="color:rgb(0,0,0);font-family:Times;font-size:14px"><span \
style="font-family:arial,helvetica,sans-serif;font-size:small"> </span></div><div \
style="color:rgb(0,0,0);font-family:Times;font-size:14px"><span \
style="font-family:arial,helvetica,sans-serif;font-size:small">Evaluate Cumulus ® \
Linux ®<br><span style="color:rgb(0,90,149)"><span><a \
href="https://cumulusnetworks.com/product/secure/evaluate/" \
style="color:rgb(0,90,149);text-decoration:none" \
target="_blank">https://cumulusnetworks.com/product/secure/evaluate/</a></span></span><br><br>Become \
a Partner<br><span style="color:rgb(0,90,149)"><span><a \
href="http://cumulusnetworks.com/partners/become-a-partner/" \
style="color:rgb(0,90,149);text-decoration:none" \
target="_blank">http://cumulusnetworks.com/partners/become-a-partner/</a></span></span></span></div></div></div>
</blockquote></div>
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic