Truncated request bodies

Eric Wong normalperson at
Fri Oct 23 12:15:58 EDT 2009

Vadim Spivak <vadim at> wrote:
> There seems to be a ruby bug in 1.8.7 on OS X that's causing request
> bodies to be truncated in unicorn when they're bigger than the
> MAX_BODY (backed by a temp file instead of stringio).
> Example of truncation:
> Smaller ruby bug example:

Hi Vadim,

What's the output of that standalone ruby example for you?  Is there a
bug filed with ruby-core I could look at?

Also, does using f << or f.syswrite change things?
f.sync = true should really make it unnecessary...

       f ="bar", File::RDWR|File::CREAT, 0600)
       f.sync=true  # why is this here?
       f << "Hello"  # or f.syswrite

       # would an explicit f.flush here work? shouldn't be needed
       # with f.sync = true
       puts "Should be 5: #{f.pos}"

> I couldn't reproduce this on 1.9.1 on OS X or 1.8.7 on Linux.

I'll definitely need help with testing this then since I only have

Which 1.8.7 patchlevel is your OS X Ruby at?  Do you know if the
OS X packagers apply any vendor patches on top of the stock Ruby distro
that could be causing it?  Are those patches downloadable anywhere?

Eric Wong

More information about the mongrel-unicorn mailing list