title: Segmentation fault running net-snmp subagent (agentx socket)
body: <br>
  I'm working with a net-snmp subagent managing custom OIDs for my application.
  <p>The issue I'm facing is that after several (thousands) of walk queries the subagent crashes due to a segmentation fault and I think it's related somehow to the agentx socket going stuck or not being completely responsive (or anyway it's somehow related to the agentx since if I don't use it I don't have any crash). Here it is an example of crash message:</p>
  <pre><code>[72378.761186] do_page_fault(): sending SIGSEGV to snmpsubagent for invalid read access from 7700603c
  [72378.779400] epc = 7725424c in libuClibc-0.9.33.2.so[7720d000+58000]
  [72378.791916] ra  = 772541c8 in libuClibc-0.9.33.2.so[7720d000+58000]
  [72378.804448]
  [87442.450087]
  [87442.450087] do_page_fault(): sending SIGSEGV to snmpsubagent for invalid read access from 00000030
  [87442.468314] epc = 00000030 in fmsnmpsubagent[400000+12000]
  [87442.479307] ra  = 7757e7ec in libuClibc-0.9.33.2.so[77551000+58000]
  [87442.491900]
  [96978.925006]
  [96978.925006] do_page_fault(): sending SIGSEGV to snmpsubagent for invalid read access from 0000000c
  [96978.943457] epc = 7730e298 in libuClibc-0.9.33.2.so[772c7000+58000]
  [96978.956109] ra  = 7730e1c8 in libuClibc-0.9.33.2.so[772c7000+58000]
  [96978.968650]
  [166676.380944]
  [166676.380944] do_page_fault(): sending SIGSEGV to snmpsubagent for invalid read access from 01231fec
  [166676.399365] epc = 7788bfbc in libuClibc-0.9.33.2.so[77855000+58000]
  [166676.412143] ra  = 7788b91c in libuClibc-0.9.33.2.so[77855000+58000]
  [166676.424884]
  </code></pre>
  <p>I'm running a firmware on a MIPS device based on OpenWRT and I tested several net-snmp versions (e.g. 5.7.3, 5.8) without fixing the issue. I also tested various combination of agentx parameters (like the following ones) without success.</p>
  <pre><code>agentxPingInterval
  agentXTimeout
  agentXRetries
  </code></pre>
  <p>Since it is happening after a huge amount of queries I'm wondering if there is some problem with the cache mechanism too.</p>
  <p>Do you have any idea or suggestion to fix the issue?</p>
  <p>Thank you!</p>