From ec8ca22c45e9cd303dfbb6a9ee2f0036ae8c9cb8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 13 Feb 2010 00:35:36 -0800 Subject: unicorn 0.96.1 - fix leak in Rainbows!/Zbatery This maintenance release is intended for users of Rainbows! and Zbatery servers (and anybody else using Unicorn::HttpParser). This memory leak DID NOT affect Unicorn itself: Unicorn always allocates the HttpParser once and always reuses it in every sequential request. This leak 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. 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. --- GIT-VERSION-GEN | 2 +- lib/unicorn/const.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index ccb2fe3..03e5caf 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v0.96.0.GIT +DEF_VER=v0.96.1.GIT LF=' ' diff --git a/lib/unicorn/const.rb b/lib/unicorn/const.rb index 1b3a9cd..931c269 100644 --- a/lib/unicorn/const.rb +++ b/lib/unicorn/const.rb @@ -7,7 +7,7 @@ module Unicorn # gave about a 3% to 10% performance improvement over using the strings directly. # Symbols did not really improve things much compared to constants. module Const - UNICORN_VERSION="0.96.0" + UNICORN_VERSION="0.96.1" DEFAULT_HOST = "0.0.0.0" # default TCP listen host address DEFAULT_PORT = 8080 # default TCP listen port -- cgit v1.2.3-24-ge0c7