[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby 1.9.1 and Mingw (on Windows

Alexey Borzenkov

4/18/2009 10:06:00 AM

Hi,

Recently I wanted to see if I could safely move to Ruby 1.9.1, and
wanted to test my rails application for that, when I discovered that
Thin (which uses EventMachine) just hangs up after the first request.
This happens not just with my, but any rails application. During
investigation I found that:

1) EventMachine's test cases hang up immediately after starting. Thin
hangs up somewhere after returning from Connection#receive_data.
2) The hang is happening deep in rb_vm_bugreport, which I could see with
Process Explorer, but it does not display anything in the console. Maybe
once or twice I've seen [BUG] lines with Rails/Thin, but it was very
early in my investigations and I dismissed those, and then later
couldn't reproduce. :-/
3) Thinking there might be something wrong in Ruby itself I tried
executing make check, and indeed, somewhere deep in processing of make
test-all this hang is happening very much reliably for me, although not
on the same dot. Process explorer shows rb_vm_bugreport as the closes
function inside ruby dll.
4) When ruby processes hang up like this, Ctrl+C and Ctrl+Break stop
working (which means signal processing is completely gone), and the only
way to get rid of such process is to kill it with Process Explorer /
Task Manager.

Did anyone else encounter anything like this, or something is extremely
wrong with my msys/mingw or dependencies (taken from gnuwin32)? Seeing
that rubyinstaller is moving to 1.9.1 I'd really like to know if anyone
else experiences hangs like this.

P.S.
Because Ruby 1.8 also manages to sometimes hang up in rb_w32_select (and
100% reliably when doing make test-all), I smell something very fishy
here, and maybe it only happens on my work pc (I'm using a mac at home),
so I'd like more input from other people using mingw.
--
Posted via http://www.ruby-....

8 Answers

znmeb

4/18/2009 2:12:00 PM

0

On Sat, Apr 18, 2009 at 3:05 AM, Alexey Borzenkov <snaury@gmail.com> wrote:
> Hi,
>
> Recently I wanted to see if I could safely move to Ruby 1.9.1, and
> wanted to test my rails application for that, when I discovered that
> Thin (which uses EventMachine) just hangs up after the first request.
> This happens not just with my, but any rails application. During
> investigation I found that:
>
> 1) EventMachine's test cases hang up immediately after starting. Thin
> hangs up somewhere after returning from Connection#receive_data.
> 2) The hang is happening deep in rb_vm_bugreport, which I could see with
> Process Explorer, but it does not display anything in the console. Maybe
> once or twice I've seen [BUG] lines with Rails/Thin, but it was very
> early in my investigations and I dismissed those, and then later
> couldn't reproduce. :-/
> 3) Thinking there might be something wrong in Ruby itself I tried
> executing make check, and indeed, somewhere deep in processing of make
> test-all this hang is happening very much reliably for me, although not
> on the same dot. Process explorer shows rb_vm_bugreport as the closes
> function inside ruby dll.
> 4) When ruby processes hang up like this, Ctrl+C and Ctrl+Break stop
> working (which means signal processing is completely gone), and the only
> way to get rid of such process is to kill it with Process Explorer /
> Task Manager.
>
> Did anyone else encounter anything like this, or something is extremely
> wrong with my msys/mingw or dependencies (taken from gnuwin32)? Seeing
> that rubyinstaller is moving to 1.9.1 I'd really like to know if anyone
> else experiences hangs like this.
>
> P.S.
> Because Ruby 1.8 also manages to sometimes hang up in rb_w32_select (and
> 100% reliably when doing make test-all), I smell something very fishy
> here, and maybe it only happens on my work pc (I'm using a mac at home),
> so I'd like more input from other people using mingw.
> --
> Posted via http://www.ruby-....

Are you building Ruby from source, or using a binary executable? If
you're building it yourself, you could try using less compiler
optimization. Try '-O0 -g' compile flags.
>
>



--
M. Edward (Ed) Borasky
http://www.linkedin.com/in...

I've never met a happy clam. In fact, most of them were pretty steamed.

Alexey Borzenkov

4/18/2009 2:32:00 PM

0

M. Edward (Ed) Borasky wrote:
> Are you building Ruby from source, or using a binary executable? If
> you're building it yourself, you could try using less compiler
> optimization. Try '-O0 -g' compile flags.

From source, I didn't know there's binary ruby 1.9.1 built with mingw
anywhere right now, besides make test-all should have implied that. :)
If I remember correctly I even tried optflags="-O0" debugflags="-g3
-ggdb" to ensure there are no optimization and as more debug as
possible, and it didn't help much. But I can't be certain, because after
so many recompilations it started interfering with my work and I had to
return to my duties. I think I'll do more tests, but no sooner than
Monday, so I wanted to know how it is for others in the meantime...
--
Posted via http://www.ruby-....

Roger Pack

4/18/2009 3:47:00 PM

0


> Did anyone else encounter anything like this, or something is extremely
> wrong with my msys/mingw or dependencies (taken from gnuwin32)? Seeing
> that rubyinstaller is moving to 1.9.1 I'd really like to know if anyone
> else experiences hangs like this.

Do you not get those issues using msvc compiled? What about mingw
compiled 1.8.6?

There was a recent thread on rubyinstaller about it, with nobody going
deep enough to actually determine what's going on :) (the subject had to
do with GCC 4.3).


> P.S.
> Because Ruby 1.8 also manages to sometimes hang up in rb_w32_select (and
> 100% reliably when doing make test-all), I smell something very fishy
> here, and maybe it only happens on my work pc (I'm using a mac at home),
> so I'd like more input from other people using mingw.

I know that one bug was fixed for me re: rb_w32_select not selecting on
"lotsa fd's" but I'd imagine that's unrelated.
http://redmine.ruby-lang.org/issue...
Thanks.
-=r
--
Posted via http://www.ruby-....

Alexey Borzenkov

4/18/2009 9:35:00 PM

0

Roger Pack wrote:
> Do you not get those issues using msvc compiled? What about mingw
> compiled 1.8.6?

I don't have Visual Studio 6.0, so I can't build it with msvc the
official way. And in my experience (well, with 1.8.7) ruby compiled with
vs2008 express was too unstable, so not even worth a try.

Mingw compiled 1.8.6 has some strangeness in that make test-all has
tests that sometimes complete normally, and sometimes show up as E or F.
But I never could complete it to the end, because it always hangs up in
rb_w32_select, in one test or the other.

> There was a recent thread on rubyinstaller about it, with nobody going
> deep enough to actually determine what's going on :) (the subject had to
> do with GCC 4.3).

Yeah, I experienced some problems with gcc 4.3 several months ago (not
ruby related though, I wasn't even into ruby at that time), so I fell
back to gcc 3.4.5 (latest mingw that is not 4.3) ever since. But I tried
compiling ruby 1.9.1 with gcc 4.3 once, and it had compilation error in
one of extensions. I was too lazy to investigate, so reverted back to
3.4.5 without even trying to come up with any fix.

> I know that one bug was fixed for me re: rb_w32_select not selecting on
> "lotsa fd's" but I'd imagine that's unrelated.
> http://redmine.ruby-lang.org/issue...

Wow, thanks for the link, I'll be sure to try if it would allow me to
complete ruby 1.8.6 tests...
--
Posted via http://www.ruby-....

Roger Pack

4/19/2009 3:02:00 AM

0


> 3) Thinking there might be something wrong in Ruby itself I tried
> executing make check, and indeed, somewhere deep in processing of make
> test-all this hang is happening very much reliably for me, although not
> on the same dot. Process explorer shows rb_vm_bugreport as the closes
> function inside ruby dll.

I do remember that running make test-all on 1.9 about 4 months ago which
resulted in something like 50 F's then a hang within a process using
tons of RAM, but it's been awhile perhaps things have improved.
In Luis' words "keep in mind that 1.9.1 is completely broken, I hope
1.9.2 will
have better Windows support."

Charlie Savage has been submitting bug reports to core in an attempt to
get make test-all to actually finish. Asking on the one click mailing
list might be useful.

-=r
--
Posted via http://www.ruby-....

Roger Pack

4/20/2009 1:56:00 PM

0

> I don't have Visual Studio 6.0, so I can't build it with msvc the
> official way. And in my experience (well, with 1.8.7) ruby compiled with
> vs2008 express was too unstable, so not even worth a try.
>
> Mingw compiled 1.8.6 has some strangeness in that make test-all has
> tests that sometimes complete normally, and sometimes show up as E or F.
> But I never could complete it to the end, because it always hangs up in
> rb_w32_select, in one test or the other.

I wish we had an easy reproducible test case :) (though I guess the
first test that hangs it might suffice).
A couple of other thoughts: you could try EM using visual studio 2008
(see link:
http://rubyforge.org/pipermail/rubyinstaller-devel/2009-February/0...
), also if it hangs you might be able to use gdb against a mingw build
against the live process.
http://eigenclass.org/hiki/ruby+live+process+int...

Good luck.
-=r
--
Posted via http://www.ruby-....

Roger Pack

4/20/2009 2:42:00 PM

0

> I wish we had an easy reproducible test case :) (though I guess the
> first test that hangs it might suffice).
> A couple of other thoughts: you could try EM using visual studio 2008
> (see link:
> http://rubyforge.org/pipermail/rubyinstaller-devel/2009-February/0...
> ), also if it hangs you might be able to use gdb against a mingw build
> against the live process.
> http://eigenclass.org/hiki/ruby+live+process+int...
>
> Good luck.
> -=r

Also trying to build it with trunk (or the daily snapshot) might be
helpful.
-=r
--
Posted via http://www.ruby-....

Roger Pack

5/9/2009 9:40:00 PM

0

> Recently I wanted to see if I could safely move to Ruby 1.9.1, and
> wanted to test my rails application for that, when I discovered that
> Thin (which uses EventMachine) just hangs up after the first request.
> This happens not just with my, but any rails application. During
> investigation I found that:
>
> 1) EventMachine's test cases hang up immediately after starting.

After some investigation, I have confirmed that mingw + 1.9 + EM is a no
go currently. Seems to work all right with 1.8.6 + mingw + EM.

I would recommend the pure ruby EM except it seems to leak on my
machine.
Another thing would be to use rev as a backend to EM.

http://github.com/rogerdpack/rev/t...

has the latest and greatest (that compiles on mingw 1.9)
so I'd git clone it
run rake package
then install the .gem file it generates.
Then it's

require 'eventmachine'
then
require 'revem' # override EM to use rev + libev as the backend

Let me know if you try it :)
Cheers!
-=r
--
Posted via http://www.ruby-....