Spawning processes from Ruby/TK

Hi,

I’m using Ruby 1.8.1, both win32 and cygwin versions (‘ruby 1.8.1
(2003-12-25) [i386-mswin32]’ from the binaries zip file (not the 1.8.1
installer) and ‘ruby 1.8.1 (2003-12-25) [i386-cygwin]’). I think I may
have something very wrong with the whole Tk lib and forking a new
process:

In the windows version

  • if I require tk from irb - irb dies instantly.

  • requiring also stops the regular interpreter:
    C:>cat t.rb
    puts 'hello’
    require 'tk’
    puts 'world’
    puts dir

    C:>ruby t.rb
    hello

    C:>

On the cygwin version I get:
[/cygdrive/c H:103 (last=0) 8:35:41]$ ruby t.rb
hello
world
C:\bin\cygwin\bin\ruby.exe: *** unable to remap
C:\bin\cygwin\bin\tk84.dll to same address as parent(0x4BB0000) !=
0x4BC0000
1461 [main] ruby 2528 sync_with_child: child 3148(0x2E4) died
before initialization with status code 0x1
1762 [main] ruby 2528 sync_with_child: *** child state child
loading dlls

i.e. It dies as soon as I try the backtick.

A simple hello world program like this:
require 'tk’
root = TkRoot.new() { title “Hello, world!” }
Tk.mainloop()
Works through cygwin but not on the windows version.

Any idea what’s wrong / how to fix it?

Thanks for the help!
Assaph

···

-----Original Message-----
From: Hidetoshi NAGAI [mailto:nagai@ai.kyutech.ac.jp]
Sent: Thursday, 12 February 2004 2:42 AM
To: ruby-talk ML; Mehr, Assaph (Assaph)
Subject: Re: spawning processes from Ruby/TK

Hi,

Which version of Ruby do you use?
If you use 1.6.x, the problem maybe fixed on more recent versions. On my
linux environment, 1.6.7 freezes and CVS Head completes properly.

                              Hidetoshi NAGAI

(nagai@ai.kyutech.ac.jp)

Hi,

“Mehr, Assaph (Assaph)” assaph@avaya.com writes:

In the windows version

  • if I require tk from irb - irb dies instantly.

  • requiring also stops the regular interpreter:
    C:>cat t.rb
    puts ‘hello’
    require ‘tk’
    puts ‘world’
    puts dir

    C:>ruby t.rb
    hello

    C:>

On the cygwin version I get:
[/cygdrive/c H:103 (last=0) 8:35:41]$ ruby t.rb
hello
world
C:\bin\cygwin\bin\ruby.exe: *** unable to remap
C:\bin\cygwin\bin\tk84.dll to same address as parent(0x4BB0000) !=
0x4BC0000
1461 [main] ruby 2528 sync_with_child: child 3148(0x2E4) died
before initialization with status code 0x1
1762 [main] ruby 2528 sync_with_child: *** child state child
loading dlls

i.e. It dies as soon as I try the backtick.

A simple hello world program like this:
require ‘tk’
root = TkRoot.new() { title “Hello, world!” }
Tk.mainloop()
Works through cygwin but not on the windows version.

Any idea what’s wrong / how to fix it?

% rebase -d -b 0x70000000 -o 0x10000 /bin/{tcl,tk}84.dll

···


eban