[#444] io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...>

I am encountering a problem similar to the one mentioned here,

19 messages 2002/09/06
[#453] Re: io_write()/fwrite() and EINTR on Solaris — nobu.nokada@... 2002/09/08

Hi,

[#454] Re: io_write()/fwrite() and EINTR on Solaris — matz@... (Yukihiro Matsumoto) 2002/09/09

Hi

[#469] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/09

On Mon, Sep 09, 2002 at 03:55:13PM +0900, Yukihiro Matsumoto wrote:

[#479] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/10

On Tue, Sep 10, 2002 at 01:04:10AM +0900, Jos Backus wrote:

[#492] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/21

On Wed, Sep 11, 2002 at 02:23:33AM +0900, Jos Backus wrote:

Re: Should we check alloca ret val?

From: nobu.nokada@...
Date: 2002-09-03 15:59:02 UTC
List: ruby-core #416
Hi,

At Wed, 4 Sep 2002 00:06:49 +0900,
ts wrote:
> n> If alloca() were failed, it doesn't always return NULL.
> 
>  See [ruby-talk:48890] alloca() failed with segfault

I read it and posted [ruby-core:00414].  In this case, I guess
the best way would be to get rid of alloca(), but it may not be
desirable and even possible always.


Index: marshal.c
===================================================================
RCS file: /cvs/ruby/src/ruby/marshal.c,v
retrieving revision 1.67
diff -u -2 -p -r1.67 marshal.c
--- marshal.c	29 Aug 2002 09:08:16 -0000	1.67
+++ marshal.c	3 Sep 2002 15:48:56 -0000
@@ -784,9 +784,11 @@ r_string(arg)
     struct load_arg *arg;
 {
-    char *buf;
+    VALUE str;
     long len;
 
-    r_bytes2(buf, len, arg);
-    return rb_str_new(buf, len);
+    len = r_long(arg);
+    str = rb_str_new(0, len);
+    r_bytes0(RSTRING(str)->ptr, len, arg);
+    return str;
 }
 


-- 
Nobu Nakada

In This Thread