Bug 590503 - Trivial ruby tk application crashes
Trivial ruby tk application crashes
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: ruby (Show other bugs)
12
i686 Linux
low Severity high
: ---
: ---
Assigned To: Jeroen van Meeuwen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-09 19:43 EDT by Tom Bennet
Modified: 2010-08-23 17:56 EDT (History)
4 users (show)

See Also:
Fixed In Version: ruby-1.8.6.399-4.fc12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-26 17:50:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
unset control variable oddity (598 bytes, text/plain)
2010-05-12 22:48 EDT, Tom Bennet
no flags Details
Python version of checkbox example (284 bytes, text/plain)
2010-05-13 22:53 EDT, Tom Bennet
no flags Details

  None (edit)
Description Tom Bennet 2010-05-09 19:43:05 EDT
Description of problem:

Trivial ruby tk application crashes with a glib-detected allocation error.  Here's one:

-----------------------------------------------------------------------------
#!/usr/bin/ruby
require 'tk'

# GUI.new
root = TkRoot.new('background' => '#990000')
topframe = TkFrame.new(root)
Tk.mainloop
-----------------------------------------------------------------------------


Version-Release number of selected component (if applicable):

Fedora release 12 (Constantine)

ruby-1.8.6.399-1.fc12.i686
ruby-tcltk-1.8.6.399-1.fc12.i686
tk-8.5.7-3.fc12.i686
tcl-8.5.7-5.fc12.i686

How reproducible:

Run the above program.  Explodes with "ruby boom.rb" or by setting executable
flag and running directly.


Actual results:
[tom@laptop tmp]$ ruby boom.rb 
*** glibc detected *** ruby: free(): invalid next size (fast): 0x08cee808 ***
======= Backtrace: =========
/lib/libc.so.6[0x7797f1]
/usr/lib/libtcl8.5.so(TclpFree+0x1e)[0x5636ee]
/usr/lib/libtcl8.5.so(Tcl_Free+0x1e)[0x56e24e]
/usr/lib/libtcl8.5.so(+0xc1061)[0x604061]
/usr/lib/libtcl8.5.so(+0x28b1e)[0x56bb1e]
/usr/lib/libtcl8.5.so(Tcl_GetByteArrayFromObj+0x3c)[0x56bb9c]
/usr/lib/ruby/1.8/i386-linux/tcltklib.so(+0x6e2f)[0x116e2f]
/usr/lib/ruby/1.8/i386-linux/tcltklib.so(+0x7af6)[0x117af6]
/usr/lib/ruby/1.8/i386-linux/tcltklib.so(+0x7cd1)[0x117cd1]
/usr/lib/ruby/1.8/i386-linux/tcltklib.so(+0x8246)[0x118246]
/usr/lib/ruby/1.8/i386-linux/tcltklib.so(+0x855f)[0x11855f]
/usr/lib/libruby.so.1.8[0xc74eb0]
/usr/lib/libruby.so.1.8[0xc7fc1e]
/usr/lib/libruby.so.1.8[0xc7fdba]
/usr/lib/libruby.so.1.8[0xc7d117]
/usr/lib/libruby.so.1.8[0xc7c452]
/usr/lib/libruby.so.1.8[0xc7fab9]
/usr/lib/libruby.so.1.8[0xc7fdba]
/usr/lib/libruby.so.1.8[0xc7d028]
/usr/lib/libruby.so.1.8[0xc7c452]
/usr/lib/libruby.so.1.8[0xc7d5bf]
/usr/lib/libruby.so.1.8[0xc7fab9]
/usr/lib/libruby.so.1.8[0xc7fdba]
/usr/lib/libruby.so.1.8[0xc7d028]
/usr/lib/libruby.so.1.8[0xc7fab9]
/usr/lib/libruby.so.1.8[0xc7fdba]
/usr/lib/libruby.so.1.8[0xc7d028]
/usr/lib/libruby.so.1.8[0xc7fab9]
/usr/lib/libruby.so.1.8[0xc7fdba]
/usr/lib/libruby.so.1.8[0xc7d028]
/usr/lib/libruby.so.1.8[0xc7fab9]
/usr/lib/libruby.so.1.8[0xc7fdba]
/usr/lib/libruby.so.1.8(rb_call_super+0x8d)[0xc88f7d]
/usr/lib/libruby.so.1.8[0xc7aa20]
/usr/lib/libruby.so.1.8[0xc7fab9]
/usr/lib/libruby.so.1.8[0xc7fdba]
/usr/lib/libruby.so.1.8(rb_funcall2+0x69)[0xc806c9]
/usr/lib/libruby.so.1.8(rb_obj_call_init+0x58)[0xc80768]
/usr/lib/libruby.so.1.8(rb_class_new_instance+0x3b)[0xcaf75b]
/usr/lib/ruby/1.8/i386-linux/tkutil.so(+0x2931)[0x1ed931]
/usr/lib/libruby.so.1.8[0xc74eb0]
/usr/lib/libruby.so.1.8[0xc7fc1e]
/usr/lib/libruby.so.1.8[0xc7fdba]
/usr/lib/libruby.so.1.8[0xc7d117]
/usr/lib/libruby.so.1.8[0xc7c452]
/usr/lib/libruby.so.1.8[0xc8c138]
/usr/lib/libruby.so.1.8(ruby_exec+0x23)[0xc8c183]
/usr/lib/libruby.so.1.8(ruby_run+0x35)[0xc8c1c5]
ruby[0x804867e]
/lib/libc.so.6(__libc_start_main+0xe6)[0x721bb6]
ruby[0x80485a1]
======= Memory map: ========
00110000-00128000 r-xp 00000000 08:02 101468     /usr/lib/ruby/1.8/i386-linux/tcltklib.so
00128000-00129000 rw-p 00017000 08:02 101468     /usr/lib/ruby/1.8/i386-linux/tcltklib.so
00129000-00131000 r-xp 00000000 08:02 20681      /usr/lib/libXrender.so.1.3.0
00131000-00132000 rw-p 00008000 08:02 20681      /usr/lib/libXrender.so.1.3.0
00132000-001c6000 r-xp 00000000 08:02 18193      /usr/lib/libfreetype.so.6.3.22
001c6000-001ca000 rw-p 00094000 08:02 18193      /usr/lib/libfreetype.so.6.3.22
001ca000-001e7000 r-xp 00000000 08:02 18177      /usr/lib/libxcb.so.1.1.0
001e7000-001e8000 rw-p 0001c000 08:02 18177      /usr/lib/libxcb.so.1.1.0
001e8000-001ea000 r-xp 00000000 08:02 18174      /usr/lib/libXau.so.6.0.0
001ea000-001eb000 rw-p 00001000 08:02 18174      /usr/lib/libXau.so.6.0.0
001eb000-001f1000 r-xp 00000000 08:02 104959     /usr/lib/ruby/1.8/i386-linux/tkutil.so
001f1000-001f2000 rw-p 00006000 08:02 104959     /usr/lib/ruby/1.8/i386-linux/tkutil.so
001f2000-001fd000 r-xp 00000000 08:02 8853       /lib/libnss_files-2.11.1.so
001fd000-001fe000 r--p 0000a000 08:02 8853       /lib/libnss_files-2.11.1.so
001fe000-001ff000 rw-p 0000b000 08:02 8853       /lib/libnss_files-2.11.1.so
0020e000-00330000 r-xp 00000000 08:02 104709     /usr/lib/libtk8.5.so
00330000-00340000 rw-p 00122000 08:02 104709     /usr/lib/libtk8.5.so
00340000-00366000 r-xp 00000000 08:02 18195      /lib/libexpat.so.1.5.2
00366000-00368000 rw-p 00025000 08:02 18195      /lib/libexpat.so.1.5.2
00462000-004a7000 r-xp 00000000 08:02 78977      /lib/libfreebl3.so
004a7000-004a8000 rw-p 00045000 08:02 78977      /lib/libfreebl3.so
004a8000-004ac000 rw-p 00000000 00:00 0 
004f6000-0050a000 r-xp 00000000 08:02 13510      /usr/lib/libXft.so.2.1.13
0050a000-0050b000 rw-p 00013000 08:02 13510      /usr/lib/libXft.so.2.1.13
00543000-0065b000 r-xp 00000000 08:02 104268     /usr/lib/libtcl8.5.so
0065b000-00665000 rw-p 00118000 08:02 104268     /usr/lib/libtcl8.5.so
006b5000-006d2000 r-xp 00000000 08:02 20820      /lib/libgcc_s-4.4.3-20100127.so.1
006d2000-006d3000 rw-p 0001c000 08:02 20820      /lib/libgcc_s-4.4.3-20100127.so.1
006e9000-00707000 r-xp 00000000 08:02 18159      /lib/ld-2.11.1.so
00707000-00708000 r--p 0001d000 08:02 18159      /lib/ld-2.11.1.so
00708000-00709000 rw-p 0001e000 08:02 18159      /lib/ld-2.11.1.so
0070b000-00879000 r-xp 00000000 08:02 18167      /lib/libc-2.11.1.so
00879000-0087b000 r--p 0016e000 08:02 18167      /lib/libc-2.11.1.so
0087b000-0087c000 rw-p 00170000 08:02 18167      /lib/libc-2.11.1.so
0087c000-0087f000 rw-p 00000000 00:00 0 
00881000-00884000 r-xp 00000000 08:02 18180      /lib/libdl-2.11.1.so
00884000-00885000 r--p 00002000 08:02 18180      /lib/libdl-2.11.1.so
00885000-00886000 rw-p 00003000 08:02 18180      /lib/libdl-2.11.1.so
00888000-0089e000 r-xp 00000000 08:02 13161      /lib/libpthread-2.11.1.so
0089e000-0089f000 r--p 00015000 08:02 13161      /lib/libpthread-2.11.1.so
0089f000-008a0000 rw-p 00016000 08:02 13161      /lib/libpthread-2.11.1.so
008a0000-008a2000 rw-p 00000000 00:00 0 
008a4000-008cc000 r-xp 00000000 08:02 18185      /lib/libm-2.11.1.so
008cc000-008cd000 r--p 00027000 08:02 18185      /lib/libm-2.11.1.so
008cd000-008ce000 rw-p 00028000 08:02 18185      /lib/libm-2.11.1.so
008d0000-008d7000 r-xp 00000000 08:02 78948      /lib/librt-2.11.1.so
008d7000-008d8000 r--p 00006000 08:02 78948      /lib/librt-2.11.1.so
008d8000-008d9000 rw-p 00007000 08:02 78948      /lib/librt-2.11.1.so
008d9000-00a0d000 r-xp 00000000 08:02 18181      /usr/lib/libX11.so.6.3.0
00a0d000-00a11000 rw-p 00133000 08:02 18181      /usr/lib/libX11.so.6.3.0
00b53000-00b54000 r-xp 00000000 00:00 0          [vdso]
00c4f000-00d2f000 r-xp 00000000 08:02 99512      /usr/lib/libruby.so.1.8.6
00d2f000-00d32000 rw-p 000df000 08:02 99512      /usr/lib/libruby.so.1.8.6
00d32000-00d42000 rw-p 00000000 00:00 0 
00d7c000-00daf000 r-xp 00000000 08:02 18208      /usr/lib/libfontconfig.so.1.4.4
00daf000-00db1000 rw-p 00032000 08:02 18208      /usr/lib/libfontconfig.so.1.4.4
07f39000-07f40000 r-xp 00000000 08:02 78978      /lib/libcrypt-2.11.1.so
07f40000-07f41000 r--p 00007000 08:02 78978      /lib/libcrypt-2.11.1.so
07f41000-07f42000 rw-p 00008000 08:02 78978      /lib/libcrypt-2.11.1.so
07f42000-07f69000 rw-p 00000000 00:00 0 
08048000-08049000 r-xp 00000000 08:02 100763     /usr/bin/ruby
08049000-0804a000 rw-p 00000000 08:02 100763     /usr/bin/ruby
08c2e000-08dcd000 rw-p 00000000 00:00 0          [heap]
b74ff000-b7539000 rw-p 00000000 00:00 0 
b753f000-b75de000 rw-p 00000000 00:00 0 
b75de000-b77de000 r--p 00000000 08:02 86427      /usr/lib/locale/locale-archive
b77de000-b786a000 rw-p 00000000 00:00 0 
b787b000-b787c000 rw-p 00000000 00:00 0 
bf9de000-bf9f3000 rw-p 00000000 00:00 0          [stack]
Aborted (core dumped)


Expected results:

Trivial window.


Additional info:

I really did search for this, and I'm sorry if it's already there.  I presume
it must be new, or perhaps everyone is leaving tk for newer things.
Comment 2 Tom Bennet 2010-05-12 22:48:22 EDT
Created attachment 413610 [details]
unset control variable oddity

Demonstrates that a checkbox with an un-initialized control variable (which is really an object) looks disabled.
Comment 3 Tom Bennet 2010-05-12 22:57:51 EDT
Well, I meant this comment to be first, but bugzilla managed to eat it.

I installed the proposed upgrades on 686, just the four that upgrade what was already installed: ruby, ruby-libs, ruby-irb, and ruby-tcltk.  The work much better.  The original test case works fine.  

Thanks for fixing all the important stuff.

A larger script works mostly fine, with the minor problem mentioned above: I have some checkboxes controlled by those strange tk "variables" that are really objects.  When the variable-thats-an-object has been created, but not given a value, the checkbox it controls looks disabled, though it is not.  The above attachment demonstrates this behaviour.
Comment 4 Mamoru TASAKA 2010-05-13 15:29:13 EDT
Well, http://www.dumbo.ai.kyutech.ac.jp/nagai/RubyTk/?TkVariable
(in Japanese) says v = TkVariable.new() sets v.value to "" by default,
so explicit initialization seems needed (note that I am not familiar
with Ruby/Tk !!)
Comment 5 Tom Bennet 2010-05-13 22:44:40 EDT
It is a change of behaviour compared to what I had been running previously, which was Fedora 7.  (So I hate upgrading.)

It is arguably a bug because the widget appears disabled, though it is not. The widget should show its state correctly.

Also, versions of the program written in perl, Python and Tk work fine without initializing the control variable.  (I'll attach the Python one since it's most similar.)

Still, not a big deal.
Comment 6 Tom Bennet 2010-05-13 22:53:52 EDT
Created attachment 413934 [details]
Python version of checkbox example

This is a Python/Tkinter version of the attached ruby program.  It demonstrates that the button looks normal without initializing the variable object.
Comment 7 Mamoru TASAKA 2010-05-14 15:29:54 EDT
From googling tkinter's IntVar() sets '0' as the default value,
while Ruby/Tk's TkVariable.new() sets v.value to "" by default,
which perhaps explains the behavior.

For now I want to leave this initialization issue as it is because
I want to push the new rpm which seems to fix the crash issue reported
first on this bug which is much serious issue. If you want to keep
track of initialization issue, opening a new bug is appreciated because
once the rpms to fix crash issue are pushed into stable repositories,
this bug will once be closed.
Comment 8 Fedora Update System 2010-05-14 15:50:00 EDT
ruby-1.8.6.399-3.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/ruby-1.8.6.399-3.fc13
Comment 9 Fedora Update System 2010-05-14 15:50:24 EDT
ruby-1.8.6.399-3.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/ruby-1.8.6.399-3.fc12
Comment 10 Fedora Update System 2010-05-15 16:42:11 EDT
ruby-1.8.6.399-3.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ruby'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/ruby-1.8.6.399-3.fc12
Comment 11 Fedora Update System 2010-05-17 11:36:19 EDT
ruby-1.8.6.399-4.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/ruby-1.8.6.399-4.fc13
Comment 12 Fedora Update System 2010-05-17 11:38:28 EDT
ruby-1.8.6.399-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/ruby-1.8.6.399-4.fc12
Comment 13 Fedora Update System 2010-05-18 17:59:33 EDT
ruby-1.8.6.399-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ruby'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/ruby-1.8.6.399-4.fc12
Comment 14 Fedora Update System 2010-05-26 17:47:43 EDT
ruby-1.8.6.399-4.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 15 Fedora Update System 2010-05-26 17:49:57 EDT
ruby-1.8.6.399-4.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 16 Fedora Update System 2010-08-22 14:08:08 EDT
ruby-1.8.6.399-6.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/ruby-1.8.6.399-6.fc13
Comment 17 Fedora Update System 2010-08-22 14:11:08 EDT
ruby-1.8.6.399-6.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/ruby-1.8.6.399-6.fc12
Comment 18 Fedora Update System 2010-08-23 17:56:39 EDT
ruby-1.8.6.399-6.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.