# Segfault with tk.rb

**URL:** <https://rubytalk.org/t/segfault-with-tk-rb/26199>\
**Category:** ruby-talk\
**Created:** [28 March 2006 22:23 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199 "2006-03-28T22:23:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wybo\_Dekker](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@Wybo\_Dekker](https://rubytalk.org/u/Wybo_Dekker)\
**Post date:** [28 March 2006 22:23 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/1 "2006-03-28T22:23:55Z")

</div>

This works OK:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#!/usr/bin/ruby

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;require 'tk'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class TkVariable  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def to\_m  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"%.2f" % [self.to\_i.abs/100.0]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts TkVariable.new(12345).to\_m

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-\> 123.45

But when I add the -w option to the first line, I get:

/usr/local/lib/ruby/1.8/tk.rb:2313: warning: redefine encoding=  
/usr/local/lib/ruby/1.8/tk.rb:2316: warning: redefine encoding  
123.45  
Segmentation fault

and this takes 45 seconds. What's wrong?

> **···**
>
> --  
> Wybo

---

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)\
**Post date:** [29 March 2006 05:01 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/2 "2006-03-29T05:01:55Z")

</div>

Message-ID: \<Pine.LNX.4.64.0603290017030.8945@servalys.nl\>

> But when I add the -w option to the first line, I get:
> 
> /usr/local/lib/ruby/1.8/tk.rb:2313: warning: redefine encoding=  
> /usr/local/lib/ruby/1.8/tk.rb:2316: warning: redefine encoding  
> 123.45  
> Segmentation fault
> 
> and this takes 45 seconds.  
> What's wrong?

I cannot cause SEGV on my Linux box.  
Probably, we need more information to solve your trouble.

> **···**
>
> From: Wybo Dekker \<wybo@servalys.nl\>  
> Subject: segfault with tk.rb  
> Date: Wed, 29 Mar 2006 07:23:55 +0900  
> --  
> Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

---

<div class="post-metadata">

**Author:** ![Wybo\_Dekker](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@Wybo\_Dekker](https://rubytalk.org/u/Wybo_Dekker)\
**Post date:** [29 March 2006 08:43 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/3 "2006-03-29T08:43:43Z")

</div>

n Wed, 29 Mar 2006, Hidetoshi NAGAI wrote:

> I cannot cause SEGV on my Linux box.  
> Probably, we need more information to solve your trouble.

what would you suggest me to do?

I tried the profiler:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#!/usr/bin/ruby -w  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;require 'profiler'

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;require 'tk'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class TkVariable  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def to\_m  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"%.2f" % [self.to\_i.abs/100.0]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Profiler\_\_::start\_profile  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts TkVariable.new(12345).to\_m  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rescue  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Profiler\_\_::stop\_profile  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Profiler\_\_::print\_profile($stdout)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end

but then the problem is gone.

I also tried -rdebug, but then I first get, as I always do when using  
tk.rb, a Runtime Error: can't unset "v00000": no such variable, and then  
when I continue, the problem is gone again:

$ ruby -rdebug t  
Debug.rb  
Emacs support available.

t:3:require 'tk'  
(rdb:1) c  
/usr/local/lib/ruby/1.8/tk.rb:2313: warning: redefine encoding=  
/usr/local/lib/ruby/1.8/tk.rb:2316: warning: redefine encoding  
/usr/local/lib/ruby/1.8/tk/variable.rb:290: `can't unset "v00000": no  
such variable' (RuntimeError)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from /usr/local/lib/ruby/1.8/tk/variable.rb:290:in `initialize'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from t:11  
/usr/local/lib/ruby/1.8/tk/variable.rb:290:  
INTERP.\_unset\_global\_var(@id)  
(rdb:1) c  
123.45

> **···**
>
> --  
> Wybo

---

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)\
**Post date:** [29 March 2006 23:34 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/4 "2006-03-29T23:34:08Z")

</div>

Message-ID: \<Pine.LNX.4.64.0603291033430.8945@servalys.nl\>

> what would you suggest me to do?

Oh, I'm sorry.  
SEGV trouble on Ruby/Tk depends on tcltklib.so.  
# Of course, if the trouble realy depends on Ruby/Tk. 😉  
To check the reason, information of your environment  
(OS, nativethread suuport, library verion, and so on) are required.

If you can, please report the followings.

# If you can also, please try the latest tcltklib.

&nbsp;&nbsp;\* ruby version  
&nbsp;&nbsp;\* configure options  
&nbsp;&nbsp;\* result of 'ruby -r tk -e 'p Tk::TK\_PATCHLEVEL; p Tk::PLATFORM'  
&nbsp;&nbsp;\* [depends on your OS] result of ldd your 'ruby' and 'tcltklib.so'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.g. $ ldd /usr/local/lib/ruby/1.8/i686-linux/tcltklib.so  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;linux-gate.so.1 =\> (0xffffe000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libX11.so.6 =\> /usr/X11R6/lib/libX11.so.6 (0xb7e3d000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libdl.so.2 =\> /lib/libdl.so.2 (0xb7e2c000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libpthread.so.0 =\> /lib/i686/libpthread.so.0 (0xb7ddb000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libcrypt.so.1 =\> /lib/libcrypt.so.1 (0xb7dae000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libm.so.6 =\> /lib/i686/libm.so.6 (0xb7d8b000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libc.so.6 =\> /lib/i686/libc.so.6 (0xb7c51000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/lib/ld-linux.so.2 =\> /lib/ld-linux.so.2 (0x80000000)  
&nbsp;&nbsp;\* information which you think useful to solve the trouble 🙂

Anyway, the follwoing wraning and error are expecetd.  
Those have no problem, but the exception may cause SEGV.  
However, I think such troubles on exception are fixed on ruby 1.8.3  
or later. If no case of troubles is escaped notice.

> **···**
>
> From: Wybo Dekker \<wybo@servalys.nl\>  
> Subject: Re: segfault with tk.rb  
> Date: Wed, 29 Mar 2006 17:43:43 +0900
> 
> From: Wybo Dekker \<wybo@servalys.nl\>  
> Subject: Re: segfault with tk.rb  
> Date: Wed, 29 Mar 2006 17:43:43 +0900  
> Message-ID: \<Pine.LNX.4.64.0603291033430.8945@servalys.nl\>
> 
> > $ ruby -rdebug t  
> > Debug.rb  
> > Emacs support available.
> > 
> > t:3:require 'tk'  
> > (rdb:1) c  
> > /usr/local/lib/ruby/1.8/tk.rb:2313: warning: redefine encoding=  
> > /usr/local/lib/ruby/1.8/tk.rb:2316: warning: redefine encoding  
> > /usr/local/lib/ruby/1.8/tk/variable.rb:290: `can't unset "v00000": no  
> > such variable' (RuntimeError)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from /usr/local/lib/ruby/1.8/tk/variable.rb:290:in `initialize'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from t:11  
> > /usr/local/lib/ruby/1.8/tk/variable.rb:290:  
> > INTERP.\_unset\_global\_var(@id)
> 
> --  
> Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

---

<div class="post-metadata">

**Author:** ![Wybo\_Dekker](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@Wybo\_Dekker](https://rubytalk.org/u/Wybo_Dekker)\
**Post date:** [31 March 2006 12:03 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/5 "2006-03-31T12:03:36Z")

</div>

> > what would you suggest me to do?
> 
> Oh, I'm sorry.  
> SEGV trouble on Ruby/Tk depends on tcltklib.so.  
> # Of course, if the trouble realy depends on Ruby/Tk. 😉  
> To check the reason, information of your environment  
> (OS, nativethread suuport, library verion, and so on) are required.
> 
> If you can, please report the followings.
> 
> # If you can also, please try the latest tcltklib.

I suppose it \*is\* the latest, as it comes with ruby-1.8.4?

> \* ruby version

ruby 1.8.4 (2005-12-24) [i686-linux]

> \* configure options

none

> \* result of 'ruby -r tk -e 'p Tk::TK\_PATCHLEVEL; p Tk::PLATFORM'

"8.4.7"  
{"wordSize"=\>"4", "user"=\>"root", "machine"=\>"i686", "platform"=\>"unix", "osVersion"=\>"2.6.8-24.20-default", "os"=\>"Linux", "byteOrder"=\>"littleEndian"}

> \* [depends on your OS] result of ldd your 'ruby' and 'tcltklib.so'

> ldd /usr/local/bin/ruby

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;linux-gate.so.1 =\> (0xffffe000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libdl.so.2 =\> /lib/libdl.so.2 (0x4002d000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libcrypt.so.1 =\> /lib/libcrypt.so.1 (0x40032000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libm.so.6 =\> /lib/tls/libm.so.6 (0x40064000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libc.so.6 =\> /lib/tls/libc.so.6 (0x40087000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/lib/ld-linux.so.2 =\> /lib/ld-linux.so.2 (0x40000000)

> ldd /usr/local/lib/ruby/1.8/i686-linux/tcltklib.so

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;linux-gate.so.1 =\> (0xffffe000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libtk8.4.so =\> /usr/lib/libtk8.4.so (0x40029000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libtcl8.4.so =\> /usr/lib/libtcl8.4.so (0x40104000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libX11.so.6 =\> /usr/X11R6/lib/libX11.so.6 (0x401ac000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libdl.so.2 =\> /lib/libdl.so.2 (0x402a8000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libcrypt.so.1 =\> /lib/libcrypt.so.1 (0x402ac000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libm.so.6 =\> /lib/tls/libm.so.6 (0x402de000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libc.so.6 =\> /lib/tls/libc.so.6 (0x40301000)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/lib/ld-linux.so.2 =\> /lib/ld-linux.so.2 (0x80000000)

OS: SuSE-9.2 kept up to date with its online update tool.

test prog:  
#!/usr/local/bin/ruby -w  
require 'tk'  
class TkVariable  
&nbsp;&nbsp;&nbsp;def to\_m  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"%.2f" % [self.to\_i.abs/100.0]  
&nbsp;&nbsp;&nbsp;end  
end  
puts TkVariable.new(12345).to\_m

Hope that helps...

> **···**
>
> On Thu, 30 Mar 2006, Hidetoshi NAGAI wrote:
> 
> --  
> Wybo

---

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)\
**Post date:** [1 April 2006 00:59 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/6 "2006-04-01T00:59:27Z")

</div>

Thank you for your report.  
I think that depends on the finalize operation of a Tk interpreter  
when Ruby is exiting.  
But now, I have no time to fix the problem.  
If you can, please comment out all part of ip\_finalize(ip) in  
tcltklib.c and try to use it.  
Probably, it causes some problems when the running Ruby releases  
Tk IP objects.  
However, on your case, you may be able to avoid the SEGV trouble.

> **···**
>
> --  
> Hidetoshi NAGAI ([nagai@ai.kyutech.ac.jp](mailto:nagai@ai.kyutech.ac.jp))

---

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)\
**Post date:** [5 April 2006 16:26 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/7 "2006-04-05T16:26:06Z")

</div>

Message-ID: \<20060401.095916.41648212.nagai@ai.kyutech.ac.jp\>

> Thank you for your report.  
> I think that depends on the finalize operation of a Tk interpreter  
> when Ruby is exiting.  
> But now, I have no time to fix the problem.

I'd try to fix the problem. The diff of ruby\_1\_8 branch is  
\<[http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/tcltklib.c.diff?r1=1.40.2.5;r2=1.40.2.6;only\_with\_tag=ruby\_1\_8&gt;\](http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/tcltklib.c.diff?r1=1.40.2.5;r2=1.40.2.6;only_with_tag=ruby_1_8&gt;%5C).  
Could you try it?

> **···**
>
> From: Hidetoshi NAGAI \<nagai@ai.kyutech.ac.jp\>  
> Subject: Re: segfault with tk.rb  
> Date: Sat, 1 Apr 2006 09:59:27 +0900  
> --  
> Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

---

<div class="post-metadata">

**Author:** ![Wybo\_Dekker](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@Wybo\_Dekker](https://rubytalk.org/u/Wybo_Dekker)\
**Post date:** [10 April 2006 09:06 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/8 "2006-04-10T09:06:08Z")

</div>

Sorry for being so late with my reaction. Had other troubles and also had to find out how to get 1.8.4 from cvs.

It does not seem to work. What I did was:

cvs -z4 -d :pserver:anonymous@cvs.ruby-lang.org:/src checkout -r ruby\_1\_8 ruby  
patch -p0 \<patch  
# -\> patching file ruby/ext/tk/tcltklib.c  
# Reversed (or previously applied) patch detected! Assume -R? [n] y  
# Hunk #5 succeeded at 4375 (offset 5 lines).  
# Hunk #6 succeeded at 4385 (offset 5 lines).  
# Hunk #7 succeeded at 4404 (offset 5 lines).  
# Hunk #8 succeeded at 4414 (offset 5 lines).  
# Hunk #9 succeeded at 4472 (offset 5 lines).  
# Hunk #10 succeeded at 4915 (offset 5 lines).  
# Hunk #11 succeeded at 6197 (offset 5 lines).  
# Hunk #12 succeeded at 6376 (offset 5 lines).  
# Hunk #13 succeeded at 7934 (offset 5 lines).  
cd ruby  
autoconf  
./configure  
make  
./ruby ../warntest  
./ruby -w ../warntest

where warntest contained:

require 'tk'  
class TkVariable  
&nbsp;&nbsp;&nbsp;def to\_m  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"%.2f" % [self.to\_i.abs/100.0]  
&nbsp;&nbsp;&nbsp;end  
end  
puts TkVariable.new(12345).to\_m

The first run on warntest worked fine. But the ruby -w ../warntest gave the old problem: very heavy system load  
ending in a segmentation fault.

> **···**
>
> On Thu, 6 Apr 2006, Hidetoshi NAGAI wrote:
> 
> > From: Hidetoshi NAGAI \<nagai@ai.kyutech.ac.jp\>  
> > Subject: Re: segfault with tk.rb  
> > Date: Sat, 1 Apr 2006 09:59:27 +0900  
> > Message-ID: \<20060401.095916.41648212.nagai@ai.kyutech.ac.jp\>
> > 
> > > Thank you for your report.  
> > > I think that depends on the finalize operation of a Tk interpreter  
> > > when Ruby is exiting.  
> > > But now, I have no time to fix the problem.
> > 
> > I'd try to fix the problem. The diff of ruby\_1\_8 branch is  
> > \<[http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/tcltklib.c.diff?r1=1.40.2.5;r2=1.40.2.6;only\_with\_tag=ruby\_1\_8&gt;\](http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/tcltklib.c.diff?r1=1.40.2.5;r2=1.40.2.6;only_with_tag=ruby_1_8&gt;%5C).  
> > Could you try it?
> 
> --  
> Wybo

---

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)\
**Post date:** [10 April 2006 13:23 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/9 "2006-04-10T13:23:30Z")

</div>

Message-ID: \<Pine.LNX.4.64.0604101055500.25724@servalys.nl\>

> Sorry for being so late with my reaction. Had other troubles and  
> also had to find out how to get 1.8.4 from cvs.
> 
> It does not seem to work. What I did was:
> 
> cvs -z4 -d :pserver:anonymous@cvs.ruby-lang.org:/src checkout -r ruby\_1\_8 ruby  
> patch -p0 \<patch  
> # -\> patching file ruby/ext/tk/tcltklib.c  
> # Reversed (or previously applied) patch detected! Assume -R? [n] y

'ruby\_1\_8' branch on CVS is already applied the patch.  
You rolled back tcltklib.c. 🙂  
If you can try the latest version on CVS,  
please try it without the patch.

> **···**
>
> From: Wybo Dekker \<wybo@servalys.nl\>  
> Subject: Re: segfault with tk.rb  
> Date: Mon, 10 Apr 2006 11:05:52 +0200 (CEST)  
> --  
> Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

---

<div class="post-metadata">

**Author:** ![Wybo\_Dekker](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@Wybo\_Dekker](https://rubytalk.org/u/Wybo_Dekker)\
**Post date:** [10 April 2006 20:48 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/10 "2006-04-10T20:48:21Z")

</div>

> You rolled back tcltklib.c. 🙂

Ah, I see... I thought that could not be the case because, before doing the patch, I tried my test and it went wrong.

> If you can try the latest version on CVS,  
> please try it without the patch.

I replaced tcltklib with the original and tried without patching:

> cvs -z4 -d :pserver:anonymous@cvs.ruby-lang.org:/src \

&nbsp;&nbsp;&nbsp;checkout -r ruby\_1\_8 ruby/ext/tk/tcltklib.c

> cd ruby  
> make  
> ./ruby -w ../warntest

/usr/local/lib/ruby/1.8/tk.rb:2313: warning: redefine encoding=  
/usr/local/lib/ruby/1.8/tk.rb:2316: warning: redefine encoding  
123.45  
Segmentation fault

> **···**
>
> On Mon, 10 Apr 2006, Hidetoshi NAGAI wrote:
> 
> --  
> Wybo

---

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)\
**Post date:** [11 April 2006 01:27 UTC](https://rubytalk.org/t/segfault-with-tk-rb/26199/11 "2006-04-11T01:27:06Z")

</div>

Message-ID: \<Pine.LNX.4.64.0604102242320.25724@servalys.nl\>

> Ah, I see... I thought that could not be the case because, before  
> doing the patch, I tried my test and it went wrong.

I'm very sorry that I'm bothering you.  
But I want to ask you one more try.  
At Apr. 6 01:04:47, I committed patches of tk.rb and tk/variable.rb  
to remove some warnings.  
Please check on the latest version of those.  
Possibly, the result helps me to fix the SEGV trouble.

> **···**
>
> From: Wybo Dekker \<wybo@servalys.nl\>  
> Subject: Re: segfault with tk.rb  
> Date: Tue, 11 Apr 2006 05:48:21 +0900  
> --  
> Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
