# Core dumps in ruby-tk on Mandriva 2008.1

**URL:** <https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841>\
**Category:** Ruby\
**Created:** [June 8, 2008, 1:32am UTC](https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841 "2008-06-08T01:32:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@tarazed](https://www.ruby-forum.com/u/tarazed)\
**Post date:** [June 8, 2008, 1:32am UTC](https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841/1 "2008-06-08T01:32:04Z")

</div>

This may not be the appropriate forum for this problem but I have  
exhausted other avenues of enquiry, including Bugzilla. The fault  
applies to a particular release of Mandriva Linux; on 2007.0 it did  
not occur and neither in 2008.0. Mandriva 2008 Spring (2008.1)  
however does exhibit the bug or whatever it is. Somebody using  
Cooker, essentially 2009.0, does not see the fault.

Ruby fails almost immediately for any ruby-tk script with a message  
which always has this form:

alloc: invalid block: 0x95e190: ef ef 30  
Abort (core dumped)

The address varies to some extent but the contents or whatever they  
are (registers maybe) always come up as ef ef 30. My guess is that  
there is a failure to initialize some variable or pointer which is  
used in memory allocation. As far as I can see the root window is  
created successfully and it may be possible to run one or two lines of  
code beyond that. Then it breaks. Ruby itself works without a  
problem, likewise fxruby, and Tcl/Tk scripts on their own work and so  
do combinations of Tcl/Tk and C or C++. There are no architecture or  
version mismatches. The test system is x86\_64 dual core with Tk  
8.5a5. Other people have already pointed out that Mandriva should  
have moved on to 8.5b3 by now but that may be irrelevant because Tk  
does work. I have reinstalled 2008.1 two or three times and also  
reverted to 2008.0 to prove that 2008.1 always behaves this way and  
only 2008.1.

Has anybody else here seen this? It would be helpful to me if someone  
with an installation of Mandriva Spring 2008 on a 64-bit machine could  
check this out, maybe using an example from the Pickaxe or Using Ruby  
Gems. I could supply a simple test script if necessary.

TIA

Len

---

<div class="post-metadata">

**Author:** ![tarazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@tarazed](https://www.ruby-forum.com/u/tarazed)\
**Post date:** [June 9, 2008, 8:36am UTC](https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841/2 "2008-06-09T08:36:50Z")

</div>

I had excatly the same problem with a 32 bits mandriva 2008.1 running on  
a single core sempron with 1 Go RAM, but because I did not have any  
need to upgrade, I came back to mandriva 2007.1.

---

<div class="post-metadata">

**Author:** ![tarazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@tarazed](https://www.ruby-forum.com/u/tarazed)\
**Post date:** [June 9, 2008, 8:45am UTC](https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841/3 "2008-06-09T08:45:39Z")

</div>

On Mon, 09 Jun 2008 01:34:09 -0500, michel wrote:

> > beyond that. Then it breaks. Ruby itself works without a problem,  
> > check this out, maybe using an example from the Pickaxe or Using Ruby  
> > Gems. I could supply a simple test script if necessary.
> > 
> > TIA
> > 
> > Len

Further investigation reveals that the ttk themed widget set can be used  
without causing core dumps but any attempt to reference the legacy  
widgets raises signal 6. The change here is from Tk8.5.0 to Tk8.5.1 and  
affects only ruby-tk, not Tcl/Tk.

Len

---

<div class="post-metadata">

**Author:** ![tarazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@tarazed](https://www.ruby-forum.com/u/tarazed)\
**Post date:** [June 9, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841/4 "2008-06-09T22:35:44Z")

</div>

From: Len L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: Core dumps in ruby-tk on Mandriva 2008.1  
Date: Tue, 10 Jun 2008 04:15:21 +0900  
Message-ID: [hef3k.39757$removed\_email\_address@domain.invalid2](mailto:hef3k.39757$removed_email_address@domain.invalid2)

> Here is the version information for the system:
> 
> ruby 1.8.6 (2008-03-03 patchlevel 114) [x86\_64-linux-gnu]  
> ruby-tk-1.8.6-9p114mdv2008.1  
> Tk 8.5.1

I’m very sorry, but I don’t have x86\_64-linux environment.  
Can you try to use ruby 1.8.7, or port C files (tcltklib.c,  
stubs.c, tkutil.c) to ruby 1.8.6 ?

---

<div class="post-metadata">

**Author:** ![tarazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@tarazed](https://www.ruby-forum.com/u/tarazed)\
**Post date:** [June 9, 2008, 9:41pm UTC](https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841/5 "2008-06-09T21:41:04Z")

</div>

On Sat, 07 Jun 2008 23:26:49 +0000, Len L. wrote:

> alloc: invalid block: 0x95e190: ef ef 30 Abort (core dumped)  
> already pointed out that Mandriva should have moved on to 8.5b3 by now
> 
> Len

More debugging runs using various examples from Mark R.'s website  
(first class documentation). So far all the Tcl scripts have worked  
flawlessly but any script which tries to create legacy widgets fails in  
the way described before. Take the Listbox example; peppering the code  
with diagnostics shows that the line:

$countries = TkListbox.new(content) {listvariable $names; height 5}

causes an immediate core dump.

Here is the version information for the system:

ruby 1.8.6 (2008-03-03 patchlevel 114) [x86\_64-linux-gnu]  
ruby-tk-1.8.6-9p114mdv2008.1  
Tk 8.5.1

The legacy widgets seem to be invoked via scripts in /usr/lib/ruby/1.8/  
tk/ such as listbox.rb. I cannot follow any of the code at that level.

Any ideas about what could be wrong?

Len

---

<div class="post-metadata">

**Author:** ![tarazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@tarazed](https://www.ruby-forum.com/u/tarazed)\
**Post date:** [June 10, 2008, 12:06am UTC](https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841/6 "2008-06-10T00:06:15Z")

</div>

On Mon, 09 Jun 2008 15:23:32 -0500, Hidetoshi NAGAI wrote:

> to use ruby 1.8.7, or port C files (tcltklib.c, stubs.c, tkutil.c) to  
> ruby 1.8.6 ?

Rebuilding ruby from 1.8.7 might be the better choice for me. I may be  
gone some time…

Thanks for the advice

Len

---

<div class="post-metadata">

**Author:** ![tarazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@tarazed](https://www.ruby-forum.com/u/tarazed)\
**Post date:** [June 10, 2008, 7:16pm UTC](https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841/7 "2008-06-10T19:16:00Z")

</div>

On Mon, 09 Jun 2008 15:23:32 -0500, Hidetoshi NAGAI wrote:

> to use ruby 1.8.7, or port C files (tcltklib.c, stubs.c, tkutil.c) to  
> ruby 1.8.6 ?

Thanks again for the advice Hidetoshi. Installing 1.8.7 did the trick.  
Everything except photo image support works perfectly. Another thread  
for that problem.

Len

---

<div class="post-metadata">

**Author:** ![tarazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@tarazed](https://www.ruby-forum.com/u/tarazed)\
**Post date:** [June 10, 2008, 10:23pm UTC](https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841/8 "2008-06-10T22:23:14Z")

</div>

On Mon, 09 Jun 2008 01:34:09 -0500, michel wrote:

> > beyond that. Then it breaks. Ruby itself works without a problem,  
> > check this out, maybe using an example from the Pickaxe or Using Ruby  
> > Gems. I could supply a simple test script if necessary.
> > 
> > TIA
> > 
> > Len

If you do need to go back to 2008.1 try installing ruby1.8.7, currently  
only available as a tarball. There should be no problems with that but  
you should check the ruby build environment before you do to figure out  
which options to pass to configure. Drop me a line if you need help  
with  
that. The other good news is that the tkimg package should continue to  
work if you have it installed. The documentation fot ruby and ttk  
indicates that you need to register read and write image format handlers  
for each type of image but the libjpeg etc. code seems to be picked up  
OK.

Len

---

<div class="post-metadata">

**Author:** ![tarazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed8c4c/32.png) [@tarazed](https://www.ruby-forum.com/u/tarazed)\
**Post date:** [June 11, 2008, 8:30am UTC](https://www.ruby-forum.com/t/core-dumps-in-ruby-tk-on-mandriva-2008-1/139841/9 "2008-06-11T08:30:11Z")

</div>

> > > using Cooker, essentially 2009.0, does not see the fault.  
> > > window is created successfully and it may be possible to run one  
> > > Has anybody else here seen this? It would be helpful to me if  
> > > currently only available as a tarball. There should be no problems  
> > > with that but you should check the ruby build environment before you  
> > > do to figure out which options to pass to configure. Drop me a line  
> > > if you need help with that. The other good news is that the tkimg  
> > > package should continue to work if you have it installed. The  
> > > documentation fot ruby and ttk indicates that you need to register  
> > > read and write image format handlers for each type of image but the  
> > > libjpeg etc. code seems to be picked up OK.
> 
> Len

Thanks a lot for your investigation.  
Michel.
