[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

Re: PATCH: append option to sysread -- retracted

From: Yohanes Santoso <ysantoso-rubycore@...>
Date: 2006-01-31 21:07:58 UTC
List: ruby-core #7268
Tanaka Akira <akr@m17n.org> writes:

> In article <87bqxt6xy8.fsf@jenny-gnome.dyndns.org>,
>   Yohanes Santoso <ysantoso-rubycore@jenny-gnome.dyndns.org> writes:
>
>> Otherwise, the original code:
>>
>>    n = read(fileno(fptr->f), RSTRING(str)->ptr, ilen);
>>
>> could also corrupt memory because another thread may have resize str
>> to less than ilen.
>
> There is check code.
>
>     if (RSTRING(str)->len != ilen) {
>         rb_raise(rb_eRuntimeError, "buffer string modified");
>     }
> -- 
> Tanaka Akira

That check code has been updated in the patch too:

    if (RSTRING(str)->len != initial_len + ilen) {
        rb_raise(rb_eRuntimeError, "buffer string modified");
    }

1. Is that sufficient? 

I can't produce a test case where I could modify (including
resizing) the string without some exception being thrown, thus
corrupting memory as asked in your original question.


2. In any case, I am retracting this patch because I and one other
person are not getting consistent performance improvement with this
patch.

My initial finding seems to point to the linear-growth of the string
and also at the mercy of the numerous realloc() being performed.

I'll play with exponential-growing string.


YS.


In This Thread

Prev Next