From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2002-12-06T05:55:33+09:00 Subject: Re: require 'tk' causes segfault later In article <3DEF2FE9.6050404@spellmanhv.co.uk>, Robert McGovern wrote: >Phil Tomson wrote: >> hundred nodes and I found that the script segfaults. I turned off the >> tree drawing feature thinking that that was the problem, but it still >> segfaulted which was odd (as far as I knew the script was back to the >> state it was in prior to adding the drawing feature). Then I noticed that >> I still had the 'require "tk"' at the top of the script. After commenting >> that out the problem went away. >> >> Does requiring Tk take a lot of memory or something? Any ideas? > >Which version of Ruby are you using and on which platform? > ruby 1.6.7 (2002-03-01) [i686-linux-gnu] I also tried with 1.7.3 on linux and it also segfaulted. It's not a huge problem for me right now as I've changed the code so that the require is done after the large tree structure is built and that works fine - it's just that anytime there's a segfault it could be an indicator that something is rotten somewhere ;-) in this case I'm not sure if it's in the tk extension or Ruby itself. One thing to note: The tree structure is built recursively and in this particular test case the recursion goes pretty deep - could it be some kind of stack overflow problem? Phil -- "Or perhaps the truth is less interesting than the facts?" Amy Weiss (accusing theregister.co.uk of engaging in 'tabloid journalism') Senior VP, Communications Recording Industry Association of America