netstat: sysctl: net.route.0.0.dump.0: Cannot allocate memory

Hiroki Sato hrs at FreeBSD.org
Mon Feb 24 04:10:24 UTC 2014


Ian FREISLICH <ianf at clue.co.za> wrote
  in <E1WGmTE-0000nr-Us at clue.co.za>:

ia> Hiroki Sato wrote:
ia> >  Hm, how about the attached one?
ia> >
ia> >  I think the cause is just a race when length of the sysctl's output
ia> >  is changed in kernel after the buffer allocation in userspace, not
ia> >  memory shortage.  Size of the routing table can quickly change.
ia>
ia> You are correct.  It's growing at about 9000 entries per second (I
ia> wish it were faster).
ia>
ia> This is what the output looks like now.  I guess I'm not the average
ia> case.

 Can you try the attached patch?  It will attempt to enlarge the
 buffer every retry.

-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: netstat-2.diff
Type: text/x-patch
Size: 1913 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20140224/afbd3d91/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20140224/afbd3d91/attachment.sig>


More information about the freebsd-current mailing list