From: James French Date: 2011-09-14T21:10:11+09:00 Subject: [ruby-core:39548] Re: Potential bug in rb_w32_spawn? --_000_950618E0D00138499BE7CC487EBF646D66FF1239F1WOODCHUCKNMlo_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Still attempting to test this but a compiler warning showed me that lstrlen= W is being used on a char*. That is probably the problem. From: James French [mailto:James.French@naturalmotion.com] Sent: 14 September 2011 11:39 To: ruby-core@ruby-lang.org Subject: [ruby-core:39547] Potential bug in rb_w32_spawn? Hi group, Since upgrading from 1.9.2-p180 to 1.9.2-p290 I've been seeing sporadic and= non-reproducible E2BIG errors coming from spawn. Looking in win32.c, http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/tags/v1_9_2= _290/win32/win32.c?r1=3D31798&r2=3D31811 is the reason. Since the issue is = very sporadic (and sometimes fails on commands with no command line argumen= ts), I suspect that the command string might not be null terminated. Before= I found out about this code I wrote a number of unit tests which tested lo= ng argument lists and large environments and it didn't show anything up. The cmd string is built in rb_w32_spawn so I suspect there might be a probl= em there. I will try and dig further if I get the time. Cheers, James --_000_950618E0D00138499BE7CC487EBF646D66FF1239F1WOODCHUCKNMlo_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Still attempting to test= this but a compiler warning showed me that lstrlenW is being used on a char*. Th= at is probably the problem.

 =

From: James French [mailto:James.French@naturalmotion.com]
Sent: 14 September 2011 11:39
To: ruby-core@ruby-lang.org
Subject: [ruby-core:39547] Potential bug in rb_w32_spawn?=

 

Hi group,

 

Since upgrading from 1.9.2-p180 to 1.9.2-p290 I’= ve been seeing sporadic and non-reproducible E2BIG errors coming from spawn. <= /o:p>

 

Looking in win32.c, http://svn.ruby-lang.org/cgi-bin/viewvc.c= gi/tags/v1_9_2_290/win32/win32.c?r1=3D31798&r2=3D31811 is the reason. Since the issue is very sporadic (and sometimes fails on commands with no command line arguments), I suspect that the command string might not be null terminated. Before I found out about this code I wrote a number of unit tests which tested long argument lists and large environment= s and it didn’t show anything up.

 

The cmd string is built in rb_w32_spawn so I suspect t= here might be a problem there. I will try and dig further if I get the time.

 

Cheers,

James

 

 

--_000_950618E0D00138499BE7CC487EBF646D66FF1239F1WOODCHUCKNMlo_--