[#8136] Confused exception handling in Continuation Context — "Robert Dober" <robert.dober@...>

Hi all

13 messages 2006/07/06

[#8248] One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...>

I just posted this to ruby-talk. But I would also like to discuss this

33 messages 2006/07/18
[#8264] Re: One-Click Installer: MinGW? or VC2005? — Charlie Savage <cfis@...> 2006/07/19

From my experience using both tool chains on Windows (for the ruby-prof

[#8266] Re: One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...> 2006/07/19

Tim, I'm going to top reply since your post was so long. I'm interested in

[#8267] Re: One-Click Installer: MinGW? or VC2005? — Charlie Savage <cfis@...> 2006/07/19

> Tim, I'm going to top reply since your post was so long. I'm interested in

[#8271] my sandboxing extension!! — why the lucky stiff <ruby-core@...>

I have (what feels like) very exciting news. I finally sat down to code up my

17 messages 2006/07/19

[#8430] Re: doc patch: weakref. — "Berger, Daniel" <Daniel.Berger@...>

> -----Original Message-----

19 messages 2006/07/28
[#8434] Re: doc patch: weakref. — Yukihiro Matsumoto <matz@...> 2006/07/29

Hi,

[#8436] Re: doc patch: weakref. — Daniel Berger <djberg96@...> 2006/07/29

Yukihiro Matsumoto wrote:

[#8437] Re: doc patch: weakref. — Mauricio Fernandez <mfp@...> 2006/07/29

On Sat, Jul 29, 2006 at 07:37:24PM +0900, Daniel Berger wrote:

[#8441] Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...>

I have the following code:

18 messages 2006/07/30
[#8442] Re: Inconsistency in scoping during module_eval? — nobu@... 2006/07/30

Hi,

[#8443] Re: Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...> 2006/07/30

Why does this:

[#8445] Re: Inconsistency in scoping during module_eval? — Yukihiro Matsumoto <matz@...> 2006/07/30

Hi,

[#8454] Re: Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...> 2006/07/31

So to clarify...

Re: [BUG] thread/sync.rb memory corruption

From: ara.t.howard@...
Date: 2006-07-06 16:20:43 UTC
List: ruby-core #8152
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

<snip>

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

Attachments (1)

bug.rb (547 Bytes, text/x-ruby)
require 'sync'

class A
  def initialize
    extend Sync_m
    @observers = []
  end
  def meth
    synchronize(:EX){
      @observers.each do |o|
        if ENV['CORRUPT'] 
          o.notify nil
        else
          o.notify
        end
      end
    }
  end
  def add_observer o
    synchronize(:EX){
      @observers << o
    }
  end
end

class B
  def initialize a
    @a = a
    @a.add_observer self
  end
  def notify *a 
    Thread.new{ @a.meth }
  end
end

a = A.new
b = B.new a
a.meth
STDIN.gets

In This Thread