Hi,

At Wed, 18 Oct 2006 10:03:29 +0900,
Shashank Date wrote in [ruby-core:09227]:
> Yes. The problem still exists even after changing TextPad to Notepad.
> In fact, I found out the following one-line program shows the same behavior:
> C:\> type bug.rb
>
>   ## bug.rb
>   puts ARGV
>
> C:\> ruby bug.rb one
> one
>
> C:\>ruby bug.rb one*
> [BUG] cross-thread violation on rb_gc()
> ruby 1.8.5 (2006-08-25) [i386-mswin32]

Although I can't reproduce the problem too, it sounds like because
rb_w32_cmdvector and cmdglob() use ruby_xmalloc() (and also in
ruby_brace_glob()).

If so, possible workarounds would be:

1) rewrite those functions not to use ruby's GC,
2) move NtInitialize() after ruby_init(),
3) move rb_w32_cmdvector() call from NtInitialize() to ruby_options()
   like before,
4) or others.

I remember 3 had a problem with embedding programs which want to
override argv.

-- 
Nobu Nakada