From: Brent Roman Date: 2009-02-01T20:17:13+09:00 Subject: [ruby-core:21711] Re: [Bug #744] memory leak in callcc? Michal, I finally managed to get a working Ruby 1.8.7 on ppc64 with and without MBARI patches under OSx 10.5 as follows: export ARCH_FLAG="-arch ppc64" CFLAGS="-O2 -g -m64 -fno-stack-protector" configure There may yet be a problem with my build configuration, but I don't think the MBARI patches have anything to do with these failures. Both patched and unpatched versions fail the same 6 tests. Does anyone have a ppc64 (64-bit code) Ruby that does not fail these tests? Note that I am using the PowerPC patch of 1/23/09. For now, it must be applied manually after the MBARI7 patch. I will integrate it after it has been tested on x86_64. (It should be called the 64-bit patch, as it is intended to fix x86_64 as well as ppc64) http://sites.google.com/site/brentsrubypatches/Home/ruby-1.8.7-p72-mbariPPC.patch?attredirects=0 The PPC patch changes the meaning of the STACK_WIPE_SITES #define. See rubysig.h for details. One interesting observation is that my *unpatched* ppc64 ruby did not leak when executing: ruby -e "loop{@x=callcc{|c|c}}" This could be because the ppc versions put ruby call arguments on the heap rather than the 'C' stack. - brent results: The patched ppc64 Ruby runs the test suite about 30 seconds quicker. 341 vs. 312 seconds It used a bit less RAM, but the difference wasn't large: 114Mb vs. 106Mb peak VSIZE I've included the details of the run below. Can anyone verify whether or not these failures occur with unpatched 1.8.7-p72? --------------- $ uname -a Darwin G5-Client.shore.mbari.org 9.6.0 Darwin Kernel Version 9.6.0: Thu Nov 6 19:35:49 PST 2008; root:xnu-1228.9.57~1/RELEASE_PPC Power Mac $ ruby -v ruby 1.8.7 (2009-1-23 MBARI 7/0x5770 on patchlevel 72) [powerpc-darwin9.6.0] $ file ~/bin/ruby /u/brent/bin/ruby: Mach-O 64-bit executable ppc64 $ time ruby runner.rb Loaded suite . Started ........................................................................................................................................................................................................................................................................................................................................................F..........................Warning: OpenSSL::PKCS7::PKCS7 is deprecated after Ruby 1.9; use OpenSSL::PKCS7 instead .Warning: OpenSSL::PKCS7::PKCS7 is deprecated after Ruby 1.9; use OpenSSL::PKCS7 instead .Warning: OpenSSL::PKCS7::PKCS7 is deprecated after Ruby 1.9; use OpenSSL::PKCS7 instead Warning: OpenSSL::PKCS7::PKCS7 is deprecated after Ruby 1.9; use OpenSSL::PKCS7 instead Warning: OpenSSL::PKCS7::PKCS7 is deprecated after Ruby 1.9; use OpenSSL::PKCS7 instead ..............................FF....F..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................../ruby/test_array.rb:536: warning: given block not used ........................................................................F.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................E........................................................................................................................................................................................................................................................................................................................................................................................ Finished in 312.740792 seconds. 1) Failure: test_decode(OpenSSL::TestASN1) [./openssl/test_asn1.rb:195]: <"\217\a\362~Q38\262\332\212H6N\244\022n\267\343I8\233\000\017|\361\265\024\335\353\202\237h\016\201\032bxV\300\343N\252\227w\320\263\241%\035s\366P\2147>dy\306\004\023\367\267\v\214\272\fY\331\326\016\346\216\003\310\323\ek+Y}is\361\263\034\313\f\006e\200V\274\302\222\201\314\260\350\210\321 expected but was <"\246\317\022M\337\207 \202\022\374\221\214\375\365\307\231\030\375t\027\306Y.\022\302\207\377\224\234\370l\a\211\r\241\225\003\220d\323k\346[>\351\004M\v\347\336\240\365\265\242\226\324?\214eR\300p\003`!m#\217\e6\250\306G\324#\004`\273\240\376\357`\265\367\3658\275t?\342\274\335.\370\261\227\325)V\376\240Z\276\206`\2056b\305\022s\tY%\025~r\207\267\323\226\315\243L\203\023\306K">. 2) Failure: test_create_by_factory(OpenSSL::TestX509Extension) [./openssl/test_x509ext.rb:41]: <"0\022\006\003U\035\023\001\001\000\004\b0\006\001\001\000\002\001\002"> expected but was <"0\022\006\003U\035\023\001\001\377\004\b0\006\001\001\377\002\001\002">. 3) Failure: test_new(OpenSSL::TestX509Extension) [./openssl/test_x509ext.rb:29]: expected but was . 4) Failure: test_attr(OpenSSL::TestX509Request) [./openssl/test_x509req.rb:94]: <[["keyUsage", "Digital Signature, Key Encipherment", true], ["subjectAltName", "email:gotoyuzo@ruby-lang.org", false]]> expected but was <[["keyUsage", "Digital Signature, Key Encipherment", false], ["subjectAltName", "email:gotoyuzo@ruby-lang.org", false]]>. 5) Failure: test_should_propagate_signaled(TestBeginEndBlock) [./ruby/test_beginendblock.rb:81]: <""> expected to be =~ . 6) Error: test_fd_passing(TestUNIXSocket): SocketError: file descriptor was not passed (msg_controllen=20, 24 expected) ./socket/test_unix.rb:19:in `recv_io' ./socket/test_unix.rb:19:in `test_fd_passing' 1976 tests, 1668917 assertions, 5 failures, 1 errors real 5m23.872s user 3m54.124s sys 0m27.542s Bugzilla from calcifer@runbox.com wrote: > > I've tried that myself but it didn't work very well > (ruby test/runner.rb fails 3 tests on 0x2770, and segfaults when i use > 0x4770, > on x86_64 machine) > > I also tried building on ppc64, with 0x4770 it wont even build, segfaults > on > launching miniruby: > > gcc -O2 -g -DRUBY_EXPORT -D_GNU_SOURCE=1 -L. -rdynamic -Wl,-export- > dynamic main.o libruby-static.a -ldl -lcrypt -lm -o miniruby > ./ext/purelib.rb:2: [BUG] Segmentation fault > ruby 1.8.7 (2009-1-18 MBARI 7/0x4770 on patchlevel 72) [powerpc64-linux] > make: *** [.rbconfig.time] Aborted > > With 0x2770 it builds & runs the same test suite with 6 failures & 1 > error. > (Although i'm not sure how much they are actually ruby's fault) > > Regards, > -- mb > > > -- View this message in context: http://www.nabble.com/-ruby-core%3A19846---Bug--744--memory-leak-in-callcc--tp20447794p21773950.html Sent from the ruby-core mailing list archive at Nabble.com.