This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

tshark crashing because of temp pcap files in /tmp

0

I am trying to run tshark for an extended period of time to reassemble NFS requests that I capture using tcpdump (with pf_ring). I am streaming the pcap to standard out from tcpdump (using -w -) and into tshark (using -i -). It seems that tshark calls dumpcap to do the packet capture (even from stdin) and then dumpcap writes the packets to the /tmp directory and then tshark reads from there. The reading and writing to disk was a bottleneck for me so I specified a new location using the TMPDIR environment variable and set it to a tmpfs mount. This was successful in speeding up the tshark processing but once the tmpfs mount fills up, tshark crashes. First, I would like to confirm that this is the correct behavior. If so, I have two questions:

  1. Can we remove dumpcap from the equation if we are just reading from stdin (so that it is similar to reading from a file)?
  2. Is there a way to tell tshark to roll the temp files (similarly to how it will roll the raw packet captures if using the -w argument) so that it just overwrites old files rather than filling up the directory until it gets an Out of Memory exception?

Thank you.

asked 11 Dec '12, 13:17

notorious-pcaper's gravatar image

notorious-pc...
16234
accept rate: 0%


One Answer:

0

There is currently an old bug which says that tshark should not be using files when in this configuration (bug 2743).

To answer your questions:

  1. Not if tshark is reading from a pipe. If tshark supported live-capture from a file (as requested in bug 5982) then that would be a way to avoid the pipe.
  2. Yes, I would think (but I have not tried) that using the standard ring-buffer options would achieve this.

answered 12 Dec '12, 07:52

JeffMorriss's gravatar image

JeffMorriss ♦
6.2k572
accept rate: 27%

Using the -b option when not writing out raw packets with the -w option does not work. The -b will only affect the explicit output. If there is no -w option, then tshark will just exit immediately.

(12 Dec '12, 09:25) notorious-pc...

Ah, right, makes sense. Oh well...

(12 Dec '12, 12:31) JeffMorriss ♦