[#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

From: Yohanes Santoso <ysantoso-rubycore@...>
Date: 2006-01-31 00:30:36 UTC
List: ruby-core #7251
Tanaka Akira <akr@m17n.org> writes:

> In article <87k6ch72xu.fsf@jenny-gnome.dyndns.org>,
>   Yohanes Santoso <ysantoso-rubycore@jenny-gnome.dyndns.org> writes:
>
>> [3 fastio.patch <text/x-patch (7bit)>]
>> --- ruby-1.8.4.orig/io.c	2005-12-19 12:11:20.000000000 -0500
>> +++ ruby-1.8.4/io.c	2006-01-30 16:35:49.000000000 -0500
>
> It seems possible core dump.
>
>> +	  write_pos = RSTRING(str)->ptr;
rb_str_locktmp(str);
>>      rb_thread_wait_fd(fileno(fptr->f));
>> +    n = read(fileno(fptr->f), write_pos, ilen);
rb_str_unlocktmp(str);

> read may corrupt memory because write_pos can be invalid
> since another thread may modify RSTRING(str)->ptr.

I'm new to playing with thread scheduler, but wouldn't rb_str_locktmp
prevent str from being modified from another thread?

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.

Looking for advice,
YS.

In This Thread