[ANN] unicorn 0.96.1 - leak fix for Rainbows!/Zbatery

E

Eric Wong

First off, this memory leak doesn't affect Unicorn itself at all
(but it doesn't hurt, either).

Unicorn itself always allocates the HttpParser once and always reuses it
in every sequential request.

This leak only affects applications that repeatedly allocate a new HTTP
parser. Thus this bug affects _all_ deployments of Rainbows! and
Zbatery. These servers allocate a new parser for every client
connection to serve clients concurrently, but due to a bug in Unicorn,
never allows the Ruby GC to properly free the memory allocated.

Here's what happened:

I misread the Data_Make_Struct()/Data_Wrap_Struct()
documentation and ended up passing NULL as the "free" argument
instead of -1, causing the memory to never be freed.

From README.EXT in the MRI source which I misread:
The free argument is the function to free the pointer
allocation. If this is -1, the pointer will be just freed.
The functions mark and free will be called from garbage
collector.

Yes, I suck at reading and can't write code properly as a result.

* http://unicorn.bogomips.org/
* (e-mail address removed)
* git://git.bogomips.org/unicorn.git
 
E

Eric Wong

This release depends on Unicorn 0.96.1 for an updated
Unicorn::HttpParser to avoid leaking memory.

The HttpParser in Unicorn <= 0.96.0 did not setup the parser
object properly to be freed by the garbage collector.

While this bug did not affect Unicorn itself, Rainbows!
allocates a new Unicorn::HttpParser object for every new client
connection and Unicorn did not properly setup the parser object
to be freed by the Ruby garbage collector.

There are also minor cosmetic cleanups and fixes:

Eric Wong (10):
http_response: disallow blank, multi-value headers
Fix "rainbows -h" and "rainbows -v"
Update docs + tests to reflect Rev 0.3.2 release
local.mk.sample: bump Rack dependency
Merge branch 'rack-1.1'
add Cramp integration tests
Rakefile: autoload Gem
t/bin/*: encoding should be the first line after shebang
gemspec: bump dependency on Unicorn to avoid leak
Rainbows! 0.90.2

* http://rainbows.rubyforge.org/
* (e-mail address removed)
* git://git.bogomips.org/rainbows.git
 
E

Eric Wong

Unicorn had a memory leak that didn't affect Unicorn, but only
Rainbows!, so we bumped the dependency on Rainbows! which in turn
bumped the dependency on Unicorn...

Also some minor documentation updates.

* http://zbatery.bogomip.org/
* (e-mail address removed)
* git://git.bogomips.org/zbatery.git
 
E

Eric Wong

Zbatery is an HTTP server for Rack applications on systems that either
do not support fork(), or have no memory (nor need) to run the
master/worker model. It is based on Rainbows! (which is based on
Unicorn (which is based on Mongrel)) and inherits parts of each.
Zbatery supports your choice of all the thread/fiber/event/actor-based
concurrency models and Rack middleware that Rainbows! supports (or will
ever support) in a single process.

* http://zbatery.bogomip.org/
* (e-mail address removed)
* git://git.bogomips.org/zbatery.git

This release resyncs against the latest features/cleanups
in Unicorn 0.97.0 and Rainbows! 0.91.0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top