From: Joel VanderWerf Date: 2009-02-10T03:34:08+09:00 Subject: Re: A Tk window Hidetoshi NAGAI wrote: > From: Joel VanderWerf > Subject: Re: A Tk window > Date: Mon, 9 Feb 2009 05:43:28 +0900 > Message-ID: <498F4419.5080507@path.berkeley.edu> >> I haven't gotten ruby/tk to work with 8.5. It's been ok with 8.4 but >> segfaults with 8.5. >> >> This is on ubuntu. I build tcl8.5.6 and tk8.5.6 with >> >> ./configure --disable-threads --prefix=/usr/local >> make && make install >> >> The tk demos run correctly. >> >> Then I build ruby (1.8.6-p287) with: >> >> ./configure --disable-pthread --with-tcl-dir=/usr/local >> --with-tk-dir=/usr/local --disable-tcl-thread >> make && make install >> >> (I tried just rebuilding ext/tk as described in README.tcltklib, but the >> effect was the same.) >> >> Then *some* of the ruby/tk demos run but some segfault. For example: > > Probably, your Tcl/Tk libraries are compiled with threads support option. > The following table is the relation of thread support between > Ruby and Tcl/Tk. > > | Tcl/Tk with threads | without threads > -------------------+-----------------------+------------------------ > Ruby with pthread | work | possibly work > -------------------+-----------------------+------------------------ > without pthread | NOT work (freq. SEGV) | work > -------------------+-----------------------+------------------------ > > "--disable-tcl-thread" option doesn't change thread support status of > Tcl/Tk libraries. You're right about my tk lib using pthread, but I'm not sure why: $ ldd libtk8.5.so | grep thread libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7b2d000) But I did rebuild tcl and tk with the options shown above, including --disable-threads. The strange thing is that this worked for me in the past with 8.4. Is there some other option that I have to pass to configure to disable pthread? Interestingly, $ ldd libtcl8.5.so | grep thread has empty output. So somehow tk is building with pthread, but tcl is not. I used the same configure arguments for both. I just rebuilt tk8.5.6 again with ./configure --disable-threads --prefix=/usr/local and the still the resulting libtk8.5.so depends on libpthread. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407