Bus Error with tk app


(Mike Wilson) #1

I have a (horribly written) tk app which used to work just fine. I recently
added threading to it, and it now works fine for some period of time, but
then crashses leaving only:

->8–>8–
/usr/local/lib/ruby/1.8/tk.rb:1623: [BUG] Bus Error
ruby 1.8.1 (2003-12-25) [sparc-solaris2.8]

Abort
->8–>8–

The recently modified code is this:

threads = []
check_status = proc {
threads.clear
$labels.each_key do |aHost|
threads << Thread.new(aHost) do |host|
if $look[host] == 1
if system(“ping #{host} 4 > /dev/null 2>&1”)
…snip…
else
…snip…
end
end
end
end
updater.configure(‘text’ => "Last update: " +
Time.new.strftime(DATE_FORMAT + “:%S”))
Tk.after(tknm_interval, &check_status)
}
check_status.call
threads.each do |t| t.join end
Tk.mainloop()

Am I doing something wrong here?

···

Get a FREE online computer virus scan from McAfee when you click here.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963