From: Ferenc Engard Date: 2002-08-28T06:42:37+09:00 Subject: BUG: threads and ruby/tk Hi there, Here is the code: -------------------------------- #!/usr/bin/ruby require "tk" $count=TkVariable.new "start" l=TkLabel.new { pack } l.textvariable $count TkButton.new { text "Test" command proc {puts "a"} pack } t=Thread.new { loop { $count.value="blah" # 10000.times {1} } } Tk.mainloop -------------------------------- This program executed with ruby 1.6.7 (2002-03-19) [i386-linux] on a P75 segfaults randomly when I push the "Test" button. If I uncomment the delay loop, then not segfaults, only if I (with great timing) push the button exactly when the $count.value=() method is executed. Sample output: -------------------------------- fery@domesticus:~$ ./test2.rb a a a /usr/lib/ruby/1.6/tk.rb:880: [BUG] Segmentation fault ruby 1.6.7 (2002-03-19) [i386-linux] Aborted -------------------------------- The same program on ruby 1.6.6 (2001-12-26) [i586-mswin32] on winXP (Athlon 1G) develops different symptom: if I try to move the Tk window, the program freezes. The bug is present also if the t thread contains only an empty loop. The segfault on buttonpress is not detected. Bye: Circum