freeride-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FR-devel] Re: [Fwd: Re: Hangups in the debugger (was: Where can I put t


From: Laurent Julliard
Subject: [FR-devel] Re: [Fwd: Re: Hangups in the debugger (was: Where can I put this?)]
Date: Thu, 12 Sep 2002 21:40:19 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

Lyle Johnson wrote:
Any progress on the addInput() glitch in FXRuby? Sorry if you feel like I'm pushing but I really would like to see the debugger working on Windows. We want to show a first version of FreeRIDE at the next RubyConf...


No. I made those changes I described but they did not fix the problem. I
can even identify the line of code in Ruby where it hangs up but that
doesn't really tell me anything. Seems like the next step is to perhaps
try to reproduce the problem in a smaller test case -- preferably,
outside of FXRuby entirely. I have the feeling that this problem, like
the threading issue, has nothing to do with FOX per se but we just
happened to have discovered it first (or we're the only ones who think
it's a problem ;).



I'm going to try and reproduce this is in a smaller test case. In the meantime there is something that I want to draw your attention on. If you have a look at the FR file plugins/Debugger/Render/Fox/DebuggerRendererFox.rb you'll find a constant that I call VIA_FOX. If you set it to true stdout is handled with a addInput() but if you set it to false stdout is handled by a simple Ruby thread which loops forever and make a blocking sysread(). See attach_stdout.

This variant (VIA_FOX=false) again works perfectly well on Linux and freezes FreeRIDE on Windows just after you invoke the debugger via the menu. And this time addInput() isn't involved at all so there is really a problem here with threads.

I tried to write a small program (see attached) to reproduce the same condition but unfortunately this one does not freeze. It works!? So there is something else that is causing the problem in FR. If you (or other FreeRIDE developpers) have an idea it is really welcome....

Laurent


require 'fox'
include Fox

command = "ruby -e 'STDOUT.sync=true; loop { sleep rand(5); puts Time.now}'"

f = IO.popen(command,"w+")

th = Thread.new {
  loop {
    begin
      text = f.sysread(100000)
      print text
    rescue EOFError
      puts "Remote program stopped"
      exit
    end
  }
}

application = FXApp.new("Hello", "FoxTest")
application.init(ARGV)
main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL)
FXButton.new(main, "&Hello, World!", nil, application, FXApp::ID_QUIT)
application.create()
main.show(PLACEMENT_SCREEN)
application.run()

reply via email to

[Prev in Thread] Current Thread [Next in Thread]