Deterministic SIGSEGV using tcltk and ruby 1.8.1

Hi,

I am getting a SIGSEGV using ruby-tk (ruby 1.8.1 under red-hat linux).
Linux version 2.4.18-5 (bhcompile@daffy.perf.redhat.com) (gcc version 2.96
20000731 (Red Hat Linux 7.3 2.96-110)) #1 Mon Jun 10 15:31:48 EDT 2002

Debugging the program reveals the following callstack (deterministically).
Has anybody experienced similar problems or
can anybody give me a hint how to narrow down the problem?

My application basically consists of 3 threads:

  • GUI thread building up the GUI and entering tk’s mainloop
  • networking-thread (for communication), receiving data from a TCP
    connection and updates data displayed in the GUI’s text-widgets
  • main thread
    • spawns GUI thread
    • establishes tcp-connection to server
    • spawns networking thread that shares the established session (tcp
      connection socket)
    • transfers some initial data to the server
    • joins all the threads

Thanks in advance,
Chris

···

############################################################################
########################

Program received signal SIGSEGV, Segmentation fault.
0x32203e2d in ?? ()
(gdb) bt
#0 0x32203e2d in ?? ()
#1 0x40545dc8 in Tcl_GetCommandInfo () from
/user/gc097931/installed_projects/lib/ruby/1.8/i686-linux/tcltklib.so
#2 0x404e2db6 in ip_invoke_real (argc=4, argv=0x8156b80, obj=1078296164) at
tcltklib.c:2060
#3 0x404e3490 in invoke_queue_handler (evPtr=0x8129b08, flags=-1) at
tcltklib.c:2202
#4 0x40577780 in Tcl_ServiceEvent () from
/user/foo/installed_projects/lib/ruby/1.8/i686-linux/tcltklib.so
#5 0x405779a6 in Tcl_DoOneEvent () from
/user/foo/installed_projects/lib/ruby/1.8/i686-linux/tcltklib.so
#6 0x404e037c in lib_eventloop_core (check_root=1, check_var=0x0) at
tcltklib.c:464
#7 0x404e0504 in lib_eventloop_main (check_rootwidget=2) at tcltklib.c:520
#8 0x0805aef0 in rb_ensure (b_proc=0x404e04cc <lib_eventloop_main>,
data1=2, e_proc=0x404e0520 <lib_eventloop_ensure>, data2=1078167364) at
eval.c:4717
#9 0x404e06cb in lib_eventloop_launcher (check_rootwidget=2) at
tcltklib.c:555
#10 0x404e0733 in lib_mainloop (argc=1, argv=0xbfffa930, self=1078302604) at
tcltklib.c:576
#11 0x0805bcb1 in rb_call0 (klass=1078302364, recv=1078302604, id=11265,
oid=11265, argc=1, argv=0xbfffa930, body=0x40459688, nosuper=0) at
eval.c:4932
#12 0x0805c669 in rb_call (klass=1078302364, recv=1078302604, mid=11265,
argc=1, argv=0xbfffa930, scope=0) at eval.c:5287
#13 0x080573af in rb_eval (self=1078293684, n=0x403ec51c) at eval.c:3076
#14 0x0805c229 in rb_call0 (klass=1078300044, recv=1078293684, id=11265,
oid=11265, argc=0, argv=0x0, body=0x403ec51c, nosuper=0) at eval.c:5194
#15 0x0805c669 in rb_call (klass=1078300044, recv=1078293684, mid=11265,
argc=0, argv=0x0, scope=0) at eval.c:5287
#16 0x080573af in rb_eval (self=1078213584, n=0x40090ff8) at eval.c:3076
#17 0x0805a103 in rb_yield_0 (val=1078210324, self=1078213584, klass=0,
flags=2, avalue=2) at eval.c:4293
#18 0x0806520e in rb_thread_yield (arg=1078210324, th=0x81bcfe8) at
eval.c:9774
#19 0x08064f74 in rb_thread_start_0 (fn=0x806516c <rb_thread_yield>,
arg=0x40442f14, th=0x81bcfe8) at eval.c:9688
#20 0x0806530e in rb_thread_start (klass=1074434296, args=1078210324) at
eval.c:9813
#21 0x0805bcb1 in rb_call0 (klass=1074434276, recv=1074434296, id=5009,
oid=5009, argc=0, argv=0x0, body=0x400a906c, nosuper=0) at eval.c:4932
#22 0x0805c669 in rb_call (klass=1074434276, recv=1074434296, mid=5009,
argc=0, argv=0x0, scope=0) at eval.c:5287
#23 0x080573af in rb_eval (self=1078213584, n=0x40091188) at eval.c:3076
#24 0x080565bd in rb_eval (self=1078213584, n=0x40090fbc) at eval.c:2796
#25 0x08057f9a in rb_eval (self=1078213584, n=0x40092bf0) at eval.c:3279
#26 0x0805c229 in rb_call0 (klass=1078171624, recv=1078213584, id=2961,
oid=2961, argc=0, argv=0x0, body=0x40092bf0, nosuper=0) at eval.c:5194
#27 0x0805c669 in rb_call (klass=1078171624, recv=1078213584, mid=2961,
argc=0, argv=0x0, scope=3) at eval.c:5287
#28 0x0805cae3 in rb_call_super (argc=0, argv=0x0) at eval.c:5405
#29 0x08057836 in rb_eval (self=1078213584, n=0x4009bf48) at eval.c:3128
#30 0x0805c229 in rb_call0 (klass=1078170264, recv=1078213584, id=2961,
oid=2961, argc=0, argv=0x0, body=0x4009bf48, nosuper=0) at eval.c:5194
#31 0x0805c669 in rb_call (klass=1078170264, recv=1078213584, mid=2961,
argc=0, argv=0x0, scope=1) at eval.c:5287
#32 0x0805c929 in rb_funcall2 (recv=1078213584, mid=2961, argc=0, argv=0x0)
at eval.c:5362
#33 0x0805ec4f in rb_obj_call_init (obj=1078213584, argc=0, argv=0x0) at
eval.c:6430
#34 0x08080a34 in rb_class_new_instance (argc=0, argv=0x0, klass=1078170264)
at object.c:849
#35 0x0805bcb1 in rb_call0 (klass=1074449656, recv=1078170264, id=3369,
oid=3369, argc=0, argv=0x0, body=0x400abb3c, nosuper=0) at eval.c:4932
#36 0x0805c669 in rb_call (klass=1074449656, recv=1078170264, mid=3369,
argc=0, argv=0x0, scope=0) at eval.c:5287
#37 0x080573af in rb_eval (self=1078170264, n=0x40449ff8) at eval.c:3076
#38 0x08057edb in rb_eval (self=1078170264, n=0x40449f44) at eval.c:3259
#39 0x0805c229 in rb_call0 (klass=1078170244, recv=1078170264, id=5057,
oid=5057, argc=0, argv=0x0, body=0x40449f44, nosuper=0) at eval.c:5194
#40 0x0805c669 in rb_call (klass=1078170244, recv=1078170264, mid=5057,
argc=0, argv=0x0, scope=0) at eval.c:5287
#41 0x080573af in rb_eval (self=1074444816, n=0x4009c1c8) at eval.c:3076
#42 0x08053524 in eval_node (self=1074444816, node=0x4009c1c8) at
eval.c:1267
#43 0x080539fe in ruby_exec () at eval.c:1436
#44 0x08053a5a in ruby_run () at eval.c:1457
#45 0x08051e76 in Letext () at main.c:50
#46 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6

I am getting a SIGSEGV using ruby-tk (ruby 1.8.1 under red-hat linux).
Linux version 2.4.18-5 (bhcompile@daffy.perf.redhat.com) (gcc version 2.96
20000731 (Red Hat Linux 7.3 2.96-110)) #1 Mon Jun 10 15:31:48 EDT 2002

Try the patch given in [ruby-talk:88830]

Guy Decoux