bleak_house 4.2.1 → 4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ v4.3. Build against OpenSSL 0.9.8j or later (kennethkalmer). Bugfixes (Pete Hodgson, joshuabates).
3
+
2
4
  v4.2.1. Harden patch/build process. Fix bug.
3
5
 
4
6
  v4.1.1. Update bundled Ruby to patchlevel 230.
data/Manifest CHANGED
@@ -13,6 +13,7 @@ LICENSE_BSD
13
13
  Manifest
14
14
  Rakefile
15
15
  README
16
+ ruby/ruby-1.8.6-openssl.patch
16
17
  ruby/ruby-1.8.6-p286.tar.bz2
17
18
  ruby/ruby.patch
18
19
  ruby/valgrind.patch
data/bleak_house.gemspec CHANGED
@@ -2,39 +2,35 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{bleak_house}
5
- s.version = "4.2.1"
5
+ s.version = "4.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Weaver"]
9
9
  s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
10
- s.date = %q{2009-02-20}
10
+ s.date = %q{2009-08-15}
11
11
  s.default_executable = %q{bleak}
12
12
  s.description = %q{A library for finding memory leaks.}
13
13
  s.email = %q{}
14
14
  s.executables = ["bleak"]
15
15
  s.extensions = ["ext/extconf.rb"]
16
16
  s.extra_rdoc_files = ["CHANGELOG", "ext/snapshot.c", "lib/bleak_house/analyzer.rb", "lib/bleak_house/hook.rb", "lib/bleak_house.rb", "LICENSE", "LICENSE_BSD", "README", "TODO"]
17
- s.files = ["bin/bleak", "CHANGELOG", "ext/build_ruby.rb", "ext/build_snapshot.rb", "ext/extconf.rb", "ext/snapshot.c", "ext/snapshot.h", "lib/bleak_house/analyzer.rb", "lib/bleak_house/hook.rb", "lib/bleak_house.rb", "LICENSE", "LICENSE_BSD", "Manifest", "Rakefile", "README", "ruby/ruby-1.8.6-p286.tar.bz2", "ruby/ruby.patch", "ruby/valgrind.patch", "test/benchmark/bench.rb", "test/test_helper.rb", "test/unit/test_bleak_house.rb", "TODO", "bleak_house.gemspec"]
18
- s.has_rdoc = true
17
+ s.files = ["bin/bleak", "CHANGELOG", "ext/build_ruby.rb", "ext/build_snapshot.rb", "ext/extconf.rb", "ext/snapshot.c", "ext/snapshot.h", "lib/bleak_house/analyzer.rb", "lib/bleak_house/hook.rb", "lib/bleak_house.rb", "LICENSE", "LICENSE_BSD", "Manifest", "Rakefile", "README", "ruby/ruby-1.8.6-openssl.patch", "ruby/ruby-1.8.6-p286.tar.bz2", "ruby/ruby.patch", "ruby/valgrind.patch", "test/benchmark/bench.rb", "test/test_helper.rb", "test/unit/test_bleak_house.rb", "TODO", "bleak_house.gemspec"]
19
18
  s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/bleak_house/}
20
19
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Bleak_house", "--main", "README"]
21
20
  s.require_paths = ["lib", "ext"]
22
21
  s.rubyforge_project = %q{fauna}
23
- s.rubygems_version = %q{1.3.1}
22
+ s.rubygems_version = %q{1.3.4}
24
23
  s.signing_key = %q{/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-private_key.pem}
25
24
  s.summary = %q{A library for finding memory leaks.}
26
25
  s.test_files = ["test/test_helper.rb", "test/unit/test_bleak_house.rb"]
27
26
 
28
27
  if s.respond_to? :specification_version then
29
28
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
30
- s.specification_version = 2
29
+ s.specification_version = 3
31
30
 
32
31
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
33
- s.add_development_dependency(%q<echoe>, [">= 0"])
34
32
  else
35
- s.add_dependency(%q<echoe>, [">= 0"])
36
33
  end
37
34
  else
38
- s.add_dependency(%q<echoe>, [">= 0"])
39
35
  end
40
36
  end
data/ext/build_ruby.rb CHANGED
@@ -62,8 +62,29 @@ else
62
62
  puts "** Patch Ruby"
63
63
  execute("patch -p0 < '#{source_dir}/ruby.patch'")
64
64
 
65
+ puts "** Determining OpenSSL version"
66
+ cmd = open("|openssl version")
67
+ openssl_version_string = cmd.gets
68
+ cmd.close
69
+
70
+ if openssl_version_string.nil?
71
+ puts "** Could not determine openssl version, skipping patches"
72
+ else
73
+ openssl_version = openssl_version_string.split(/\s/)[1]
74
+ if openssl_version >= "0.9.8j"
75
+ puts "** Applying openssl patches to build against #{openssl_version_string}"
76
+ execute( "patch -p3 < '#{source_dir}/ruby-1.8.6-openssl.patch'")
77
+ else
78
+ puts "** No patching need for #{openssl_version_string}"
79
+ end
80
+ end
81
+
82
+ env = Config::CONFIG.map do |key, value|
83
+ "#{key}=#{value.inspect}" if key.upcase == key and value
84
+ end.compact.join(" ")
85
+
65
86
  puts "** Configure"
66
- execute("./configure #{Config::CONFIG['configure_args']}".sub("'--enable-shared'", ""))
87
+ execute("env #{env} ./configure #{Config::CONFIG['configure_args']}".sub("'--enable-shared'", ""))
67
88
 
68
89
  puts "Patch Makefile"
69
90
  # FIXME Why is this necessary?
@@ -86,25 +107,21 @@ else
86
107
  constants.each do | const, key |
87
108
  config_h.gsub!(/#define #{const} .*/, "#define #{const} \"#{Config::CONFIG[key]}\"")
88
109
  end
89
-
90
110
  File.open('config.h', 'w') do |f|
91
111
  f.puts(config_h)
92
112
  end
93
113
 
94
- env = Config::CONFIG.map do |key, value|
95
- "#{key}=#{value.inspect}" if key.upcase == key and value
96
- end.compact.join(" ")
97
-
98
114
  puts "** Make"
99
115
  execute("env #{env} make")
100
116
 
101
- binary = "#{Config::CONFIG['bindir']}/ruby-bleak-house"
117
+ bleak_binary = "#{Config::CONFIG['bindir']}/ruby-bleak-house"
118
+ ruby_binary = Config::CONFIG["RUBY_INSTALL_NAME"] || "ruby"
102
119
 
103
120
  puts "** Install binary"
104
- if File.exist? "ruby"
121
+ if File.exist? ruby_binary
105
122
  # Avoid "Text file busy" error
106
- File.delete binary if File.exist? binary
107
- exec("cp ./ruby #{binary}; chmod 755 #{binary}")
123
+ File.delete bleak_binary if File.exist? bleak_binary
124
+ exec("cp ./#{ruby_binary} #{bleak_binary}; chmod 755 #{bleak_binary}")
108
125
  else
109
126
  raise
110
127
  end
@@ -3,7 +3,7 @@ module BleakHouse
3
3
  # The body of the exit handler and <tt>SIGUSR2</tt> trap. It writes a snapshot to a dumpfile named after the current Process.pid.
4
4
  def self.hook
5
5
  @count ||= 0
6
- filename = "/tmp/bleak.#{Process.pid}.#{@count}.dump"
6
+ filename = "/tmp/bleak.%s.%03i.dump" % [Process.pid,@count]
7
7
  STDERR.puts "** BleakHouse: working..."
8
8
  BleakHouse.snapshot(filename)
9
9
  STDERR.puts "** BleakHouse: complete\n** Bleakhouse: Run 'bleak #{filename}' to analyze."
@@ -20,4 +20,4 @@ end
20
20
 
21
21
  Kernel.trap("USR2") do
22
22
  BleakHouse.hook
23
- end
23
+ end
@@ -0,0 +1,157 @@
1
+ This patch backports changes from ruby 1.8.7 which only includes the
2
+ openssl prototypes for functions that are not in the system openssl
3
+ library. This fixes #254307 and protects against similar issues with
4
+ future openssl versions.
5
+
6
+ diff -u ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/extconf.rb ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/extconf.rb
7
+ --- ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/openssl_missing.c 2007-02-13 00:01:19.000000000 +0100
8
+ +++ ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/openssl_missing.c 2008-05-19 05:00:52.000000000 +0200
9
+ @@ -22,17 +22,15 @@
10
+ #include "openssl_missing.h"
11
+
12
+ #if !defined(HAVE_HMAC_CTX_COPY)
13
+ -int
14
+ +void
15
+ HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
16
+ {
17
+ - if (!out || !in) return 0;
18
+ + if (!out || !in) return;
19
+ memcpy(out, in, sizeof(HMAC_CTX));
20
+
21
+ - if (!EVP_MD_CTX_copy(&out->md_ctx, &in->md_ctx)
22
+ - || !EVP_MD_CTX_copy(&out->i_ctx, &in->i_ctx)
23
+ - || !EVP_MD_CTX_copy(&out->o_ctx, &in->o_ctx))
24
+ - return 0;
25
+ - return 1;
26
+ + EVP_MD_CTX_copy(&out->md_ctx, &in->md_ctx);
27
+ + EVP_MD_CTX_copy(&out->i_ctx, &in->i_ctx);
28
+ + EVP_MD_CTX_copy(&out->o_ctx, &in->o_ctx);
29
+ }
30
+ #endif /* HAVE_HMAC_CTX_COPY */
31
+ #endif /* NO_HMAC */
32
+ diff -u ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/openssl_missing.h ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/openssl_missing.h
33
+ --- ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/openssl_missing.h 2008-08-04 06:43:34.000000000 +0200
34
+ +++ ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/openssl_missing.h 2008-08-04 06:44:17.000000000 +0200
35
+ @@ -60,14 +60,33 @@
36
+ (char *(*)())d2i_PKCS7_RECIP_INFO, (char *)ri)
37
+ #endif
38
+
39
+ +#if !defined(HAVE_EVP_MD_CTX_INIT)
40
+ void HMAC_CTX_init(HMAC_CTX *ctx);
41
+ -int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
42
+ +#endif
43
+ +
44
+ +#if !defined(HAVE_HMAC_CTX_COPY)
45
+ +void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
46
+ +#endif
47
+ +
48
+ +#if !defined(HAVE_HMAC_CTX_CLEANUP)
49
+ void HMAC_CTX_cleanup(HMAC_CTX *ctx);
50
+ +#endif
51
+
52
+ +#if !defined(HAVE_EVP_MD_CTX_CREATE)
53
+ EVP_MD_CTX *EVP_MD_CTX_create(void);
54
+ +#endif
55
+ +
56
+ +#if !defined(HAVE_EVP_MD_CTX_INIT)
57
+ void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
58
+ +#endif
59
+ +
60
+ +#if !defined(HAVE_EVP_MD_CTX_CLEANUP)
61
+ int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
62
+ +#endif
63
+ +
64
+ +#if !defined(HAVE_EVP_MD_CTX_DESTROY)
65
+ void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
66
+ +#endif
67
+
68
+ #if !defined(HAVE_EVP_CIPHER_CTX_COPY)
69
+ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
70
+ @@ -111,19 +130,54 @@
71
+ #define OPENSSL_cleanse(p, l) memset(p, 0, l)
72
+ #endif
73
+
74
+ +#if !defined(HAVE_X509_STORE_SET_EX_DATA)
75
+ void *X509_STORE_get_ex_data(X509_STORE *str, int idx);
76
+ int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data);
77
+ +#endif
78
+ +
79
+ +#if !defined(HAVE_X509_CRL_SET_VERSION)
80
+ int X509_CRL_set_version(X509_CRL *x, long version);
81
+ +#endif
82
+ +
83
+ +#if !defined(HAVE_X509_CRL_SET_ISSUER_NAME)
84
+ int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
85
+ +#endif
86
+ +
87
+ +#if !defined(HAVE_X509_CRL_SORT)
88
+ int X509_CRL_sort(X509_CRL *c);
89
+ +#endif
90
+ +
91
+ +#if !defined(HAVE_X509_CRL_ADD0_REVOKED)
92
+ int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
93
+ +#endif
94
+ +
95
+ +#if !defined(HAVE_BN_MOD_SQR)
96
+ int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
97
+ +#endif
98
+ +
99
+ +#if !defined(HAVE_BN_MOD_ADD)
100
+ int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
101
+ +#endif
102
+ +
103
+ +#if !defined(HAVE_BN_MOD_SUB)
104
+ int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
105
+ +#endif
106
+ +
107
+ +#if !defined(HAVE_BN_RAND_RANGE)
108
+ int BN_rand_range(BIGNUM *r, BIGNUM *range);
109
+ +#endif
110
+ +
111
+ +#if !defined(HAVE_BN_PSEUDO_RAND_RANGE)
112
+ int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range);
113
+ +#endif
114
+ +
115
+ +#if !defined(HAVE_CONF_GET1_DEFAULT_CONFIG_FILE)
116
+ char *CONF_get1_default_config_file(void);
117
+ +#endif
118
+ +
119
+ +#if !defined(HAVE_PEM_DEF_CALLBACK)
120
+ int PEM_def_callback(char *buf, int num, int w, void *key);
121
+ +#endif
122
+
123
+ #if defined(__cplusplus)
124
+ }
125
+ diff -u ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/ossl_hmac.c ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/ossl_hmac.c
126
+ --- ruby-1.8.6_p287-r10/work/ruby-1.8.6-p287/ext/openssl/ossl_hmac.c 2007-03-12 05:12:32.000000000 +0100
127
+ +++ ruby-1.8.7_p72-r1/work/ruby-1.8.7-p72/ext/openssl/ossl_hmac.c 2008-05-19 05:00:52.000000000 +0200
128
+ @@ -81,12 +87,15 @@
129
+ GetHMAC(self, ctx1);
130
+ SafeGetHMAC(other, ctx2);
131
+
132
+ - if (!HMAC_CTX_copy(ctx1, ctx2)) {
133
+ - ossl_raise(eHMACError, NULL);
134
+ - }
135
+ + HMAC_CTX_copy(ctx1, ctx2);
136
+ return self;
137
+ }
138
+
139
+ +/*
140
+ + * call-seq:
141
+ + * hmac.update(string) -> self
142
+ + *
143
+ + */
144
+ static VALUE
145
+ ossl_hmac_update(VALUE self, VALUE data)
146
+ {
147
+ @@ -104,9 +113,7 @@
148
+ {
149
+ HMAC_CTX final;
150
+
151
+ - if (!HMAC_CTX_copy(&final, ctx)) {
152
+ - ossl_raise(eHMACError, NULL);
153
+ - }
154
+ + HMAC_CTX_copy(&final, ctx);
155
+ if (!(*buf = OPENSSL_malloc(HMAC_size(&final)))) {
156
+ HMAC_CTX_cleanup(&final);
157
+ OSSL_Debug("Allocating %d mem", HMAC_size(&final));
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bleak_house
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: "4.3"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Weaver
@@ -30,19 +30,10 @@ cert_chain:
30
30
  yZ0=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-02-20 00:00:00 -08:00
33
+ date: 2009-08-15 00:00:00 -04:00
34
34
  default_executable:
35
- dependencies:
36
- - !ruby/object:Gem::Dependency
37
- name: echoe
38
- type: :development
39
- version_requirement:
40
- version_requirements: !ruby/object:Gem::Requirement
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: "0"
45
- version:
35
+ dependencies: []
36
+
46
37
  description: A library for finding memory leaks.
47
38
  email: ""
48
39
  executables:
@@ -75,6 +66,7 @@ files:
75
66
  - Manifest
76
67
  - Rakefile
77
68
  - README
69
+ - ruby/ruby-1.8.6-openssl.patch
78
70
  - ruby/ruby-1.8.6-p286.tar.bz2
79
71
  - ruby/ruby.patch
80
72
  - ruby/valgrind.patch
@@ -85,6 +77,8 @@ files:
85
77
  - bleak_house.gemspec
86
78
  has_rdoc: true
87
79
  homepage: http://blog.evanweaver.com/files/doc/fauna/bleak_house/
80
+ licenses: []
81
+
88
82
  post_install_message:
89
83
  rdoc_options:
90
84
  - --line-numbers
@@ -111,9 +105,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
105
  requirements: []
112
106
 
113
107
  rubyforge_project: fauna
114
- rubygems_version: 1.3.1
108
+ rubygems_version: 1.3.4
115
109
  signing_key:
116
- specification_version: 2
110
+ specification_version: 3
117
111
  summary: A library for finding memory leaks.
118
112
  test_files:
119
113
  - test/test_helper.rb
metadata.gz.sig CHANGED
Binary file