Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
* [ANN] unicorn 0.96.1 - leak fix for Rainbows!/Zbatery
@ 2010-02-13 10:34 Eric Wong
  2010-02-13 10:37 ` [ANN] Rainbows! 0.90.2 - leak fix from Unicorn Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Wong @ 2010-02-13 10:34 UTC (permalink / raw)
  To: ruby-talk ML, mongrel-unicorn, rainbows-talk

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/
* mongrel-unicorn@rubyforge.org
* git://git.bogomips.org/unicorn.git

-- 
Eric Wong



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-01 18:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-13 10:34 [ANN] unicorn 0.96.1 - leak fix for Rainbows!/Zbatery Eric Wong
2010-02-13 10:37 ` [ANN] Rainbows! 0.90.2 - leak fix from Unicorn Eric Wong
     [not found]   ` <20100213103757.GB7833-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-02-13 10:39     ` [ANN] Zbatery 0.1.1 " Eric Wong
2010-03-01 18:55       ` [ANN] Rainbows! 0.91.0 - Unicorn resync Eric Wong
2010-03-01 18:58         ` [ANN] Zbatery 0.2.0 - Unicorn/Rainbows! resync Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/rainbows.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).