I tried tcpdump, and it starts saving off packets (writes a few dump files, 
a couple 10s of MBs), but them seems to stall out - nothing more gets 
written though my app is clearly still receiving data.  By the time it gets 
the bad data, it's inevitably stopped by then, and searching through the 
dumps does not contain the bad data.

I added some logging to http_parser.c, however, simply dumping out the raw 
data that it is parsing, and it looks like the data is bad before it gets 
in there.  Specifically, in one case I'm looking at (raw data, though all 
text at [1]) it looks like the tail of the buffer has 4377 bytes that 
begins what should be a 8192 byte chunk, and then a duplicated copy of the 
last ~4708 bytes or so, followed by "0\r\n\r\n".  Sadly, now that I'm 
familiar with the http_parser code, this really points to a problem 
somewhere higher up... -_-  I'll do some poking around with tcpdump to see 
if I can get it or something else to dump more reliably, it would be good 
to have absolute confirmation that the data was fine coming in at the TCP 
level, although the fact that node 0.6 has no problems makes me pretty 
certain the input is fine.

On other fronts, I did more tests searching through node's git history, and 
found that before a specific revision [2], this seems to happen much less 
frequently (happened once in 6 runs, as opposed to almost every run), but 
I'm pretty convinced there's nothing wrong with this change (I added some 
logging to both before and after and found nothing behaving differently, 
though the frequency changed when adding logging, so it may just indicate 
it's a delicate timing issue - although it does happen reliably both on my 
work machine, home machine, and AWS instances - all on pretty drastically 
different hardware, and similarly never seems to happen on node 0.6.21 on 
any of those machines (although if it was only happening 1 in 6 times 
before, it could be I would have never seen it in my tests)).

[1]  http://thesilentb.com/files/bad_http_stream.txt 
[2]  https://github.com/joyent/node/commit/70033bd 

On Friday, September 21, 2012 4:27:15 PM UTC-7, Ben Noordhuis wrote:
>
> On Fri, Sep 21, 2012 at 6:40 PM, Jimb Esser <[email protected]<javascript:>> 
> wrote: 
> > I have no idea how to capture traffic on Linux, but I could do so if 
> there 
> > are some good instructions somewhere.  The problem generally takes 
> hundreds 
> > of MB of traffic to reproduce, however, so I'm not sure if logging that 
> > traffic will affect it and cause it to not occur, but I'm willing to 
> try. 
>
> tcpdump? It's easy: 
>
>     tcpdump -C 1 -G 5 -i <interface> -n -s 1500 -w <filename> tcp port 
> <port> 
>
> The -C and -G options makes it rotate the log file every 5 seconds or 
> when it grows to 1 million bytes, whatever comes first. You may need 
> to increase the snarf size (-s) to 8192 or higher if you're capturing 
> loopback traffic. 
>
> You can replay the traffic with `tcpdump -A -r <filename>`. 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to