From: ara.t.howard@... Date: 2006-07-07T01:20:43+09:00 Subject: Re: [BUG] thread/sync.rb memory corruption ---1400102478-1431227566-1152202841=:18759 Content-Type: MULTIPART/MIXED; BOUNDARY="-1400102478-1431227566-1152202841=:18759" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1400102478-1431227566-1152202841=:18759 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Fri, 7 Jul 2006 Ara.T.Howard@noaa.gov wrote: > i'm trying to test on my box now but stable-snapshot won't build for me. i'm > getting i managed to build 1.8.5 without ext/dl or ext/ripper. re-running my sample program seems to work (does not core dump under electric fence) but the memory seems to grow without bound under top. i ran under valgrind and got harp:~ > CORRUPT=1 valgrind --leak-check=yes --workaround-gcc296-bugs=yes ruby-1.8.5/bin/ruby bug.rb ==1064== Memcheck, a memory error detector. ==1064== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. ==1064== Using LibVEX rev 1606, a library for dynamic binary translation. ==1064== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. ==1064== Using valgrind-3.2.0, a dynamic binary instrumentation framework. ==1064== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. ==1064== For more details, rerun with: -v ==1064== ==1064== ==1064== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1) ==1064== malloc/free: in use at exit: 398,835 bytes in 8,491 blocks. ==1064== malloc/free: 20,526 allocs, 12,035 frees, 155,280,147 bytes allocated. ==1064== For counts of detected errors, rerun with: -v ==1064== searching for pointers to 8,491 not-freed blocks. ==1064== checked 604,052 bytes. ==1064== ==1064== 3,336 bytes in 162 blocks are possibly lost in loss record 3 of 10 ==1064== at 0x401A6DE: malloc (vg_replace_malloc.c:149) ==1064== by 0x806A631: ruby_xmalloc (gc.c:121) ==1064== by 0x805F709: scope_dup (eval.c:8061) ==1064== by 0x805A1F7: rb_yield_0 (eval.c:5002) ==1064== by 0x805A5B5: rb_yield (eval.c:5035) ==1064== by 0x80B3E36: rb_ary_each (array.c:1130) ==1064== by 0x80662FA: call_cfunc (eval.c:5617) ==1064== by 0x805B886: rb_call0 (eval.c:5776) ==1064== by 0x805C1A8: rb_call (eval.c:6006) ==1064== by 0x8056B81: rb_eval (ruby.h:644) ==1064== by 0x805606C: rb_eval (eval.c:2905) ==1064== by 0x805BBDB: rb_call0 (eval.c:5912) ==1064== ==1064== LEAK SUMMARY: ==1064== definitely lost: 0 bytes in 0 blocks. ==1064== possibly lost: 3,336 bytes in 162 blocks. ==1064== still reachable: 395,499 bytes in 8,329 blocks. ==1064== suppressed: 0 bytes in 0 blocks. ==1064== Reachable blocks (those to which a pointer was found) are not shown. ==1064== To see them, rerun with: --show-reachable=yes if i run without the --workaround-gcc296-bugs=yes option (note that i am not using 296 but gcc 3.2.3 on Red Hat Enterprise Linux WS release 3 (Taroon Update 7)) i get tons of these: ==1171== Invalid read of size 4 ==1171== at 0x8062726: rb_thread_save_context (eval.c:10158) ==1171== by 0x806310E: rb_thread_schedule (eval.c:10718) ==1171== by 0x8064D3F: rb_thread_wait_other_threads (eval.c:12064) ==1171== by 0x8053F01: ruby_cleanup (eval.c:1567) ==1171== by 0x8053FD9: ruby_stop (eval.c:1606) ==1171== by 0x805403D: ruby_run (eval.c:1627) ==1171== by 0x8052450: main (main.c:46) ==1171== Address 0xBEFF8B38 is just below the stack ptr. To suppress, use: --workaround-gcc296-bugs=yes i don't know if either error is 'correct' or not. thoughts? -a -- suffering increases your inner strength. also, the wishing for suffering makes the suffering disappear. - h.h. the 14th dali lama ---1400102478-1431227566-1152202841=:18759 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=bug.rb Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=bug.rb cmVxdWlyZSAnc3luYycNCg0KY2xhc3MgQQ0KICBkZWYgaW5pdGlhbGl6ZQ0K ICAgIGV4dGVuZCBTeW5jX20NCiAgICBAb2JzZXJ2ZXJzID0gW10NCiAgZW5k DQogIGRlZiBtZXRoDQogICAgc3luY2hyb25pemUoOkVYKXsNCiAgICAgIEBv YnNlcnZlcnMuZWFjaCBkbyB8b3wNCiAgICAgICAgaWYgRU5WWydDT1JSVVBU J10gDQogICAgICAgICAgby5ub3RpZnkgbmlsDQogICAgICAgIGVsc2UNCiAg ICAgICAgICBvLm5vdGlmeQ0KICAgICAgICBlbmQNCiAgICAgIGVuZA0KICAg IH0NCiAgZW5kDQogIGRlZiBhZGRfb2JzZXJ2ZXIgbw0KICAgIHN5bmNocm9u aXplKDpFWCl7DQogICAgICBAb2JzZXJ2ZXJzIDw8IG8NCiAgICB9DQogIGVu ZA0KZW5kDQoNCmNsYXNzIEINCiAgZGVmIGluaXRpYWxpemUgYQ0KICAgIEBh ID0gYQ0KICAgIEBhLmFkZF9vYnNlcnZlciBzZWxmDQogIGVuZA0KICBkZWYg bm90aWZ5ICphIA0KICAgIFRocmVhZC5uZXd7IEBhLm1ldGggfQ0KICBlbmQN CmVuZA0KDQphID0gQS5uZXcNCmIgPSBCLm5ldyBhDQphLm1ldGgNClNURElO LmdldHMNCg== ---1400102478-1431227566-1152202841=:18759-- ---1400102478-1431227566-1152202841=:18759--