我们的应用程序已tcl
嵌入其中并使用starkit
; tk
静态链接到其中。
当我运行应用程序时,gui
会出现并响应所有键,但是当我点击ctrl+d
终止时它会挂起。我在帖子末尾给出了挂起的回溯。
首先让我描述一下我们是如何嵌入Tcl/Tk
到我们的应用程序中的。
#--------------------------------------------------------------
# (*) install ActiveTcl
# we need starkit and ActiveTcl tclsh is batteries included
#--------------------------------------------------------------
% tar -xzf ActiveTcl8.5.8.1.291945-linux-x86_64-threaded.tar.gz
% cd ActiveTcl8.5.8.1.291945-linux-x86_64-threaded
# specify /a/b/tcltk8.5.8/linux26_x86_64 as install dir in gui
% ./install.sh
我们需要tk
没有真正的字体,因为它会使应用程序崩溃。tk
要从我们需要编译的源安装tcl
:(我不知道如何编译指向 Active-Tcl 目录。如果tk
有--with-tcl
选项请告诉我)
#--------------------------------------------------------------
# (*) install tcl from sources
#--------------------------------------------------------------
% tar -xzf tcl8.5.8-src.tar.gz
% cd tcl8.5.8/unix
% ./configure --prefix=/a/b/tcltk8.5.8/linux26_x86_64 \
--enable-shared=no \
--enable-threads
% gmake
否gmake install
,tcl
因为我们需要保留 ActiveTcl 的 tclsh。接下来安装tk
。
#--------------------------------------------------------------
# (*) install tk from sources
# need to disable xft (true type font) set --disable-xft
#--------------------------------------------------------------
% tar -xzf tk8.5.8-src.tar.gz
% cd tk8.5.8/unix
% ./configure --prefix=/a/b/tcltk8.5.8/linux26_x86_64 \
--enable-shared=no \
--with-tcl=/a/b/tcltk8.5.8/src/tcl8.5.8/unix \
--disable-xft \
--enable-threads
% gmake
% gmake install
现在我使用以下命令运行我的应用程序gdb
:
% gdb rs
% r -gui
我击中ctrl+d
了导致挂起的原因,它给出了以下回溯。有人可以帮我解决这个问题吗?
Program received signal SIGINT, Interrupt.
[Switching to Thread 182897358720 (LWP 9535)]
0x0000003739608b3a in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
(gdb) bt
#0 0x0000003739608b3a in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
#1 0x0000000001833e22 in Tcl_ConditionWait ()
#2 0x0000000001834d41 in Tcl_WaitForEvent ()
#3 0x00000000017fec68 in Tcl_DoOneEvent ()
#4 0x00000000017cb4ad in Tcl_VwaitObjCmd ()
#5 0x000000000178b6ec in TclEvalObjvInternal ()
#6 0x00000000017cd08d in TclExecuteByteCode ()
#7 0x00000000017d5798 in TclCompEvalObj ()
#8 0x000000000178d6ac in TclEvalObjEx ()
#9 0x00000000017939c4 in Tcl_CatchObjCmd ()
#10 0x000000000178b6ec in TclEvalObjvInternal ()
#11 0x00000000017cd08d in TclExecuteByteCode ()
#12 0x00000000017d5a84 in Tcl_ExprObj ()
#13 0x000000000178c3e3 in Tcl_ExprBooleanObj ()
#14 0x0000000001796704 in Tcl_IfObjCmd ()
#15 0x000000000178b6ec in TclEvalObjvInternal ()
#16 0x000000000178cee6 in TclEvalEx ()
#17 0x000000000178d616 in Tcl_EvalEx ()
#18 0x00000000017f1be9 in Tcl_FSEvalFileEx ()
#19 0x000000000179c385 in Tcl_SourceObjCmd ()
#20 0x000000000178b6ec in TclEvalObjvInternal ()
#21 0x000000000178cee6 in TclEvalEx ()
---Type <return> to continue, or q <return> to quit---
#22 0x000000000178d616 in Tcl_EvalEx ()
#23 0x000000000178d9d8 in TclEvalObjEx ()
#24 0x000000000180d45f in Tcl_UplevelObjCmd ()
#25 0x000000000178b6ec in TclEvalObjvInternal ()
#26 0x00000000017cd08d in TclExecuteByteCode ()
#27 0x000000000180e4cd in TclObjInterpProcCore ()
#28 0x000000000178b6ec in TclEvalObjvInternal ()
#29 0x000000000178cee6 in TclEvalEx ()
#30 0x000000000178d616 in Tcl_EvalEx ()
#31 0x000000000178dacd in Tcl_Eval ()
#32 0x00000000008f26aa in xrAppPlatformInit (interp=0x211a410)
at xrAppPlatform.c:430
#33 0x00000000017f69ca in Tcl_Main ()
#34 0x00000000008f2153 in xrMain (argc=3, argv=0x20fe880)
at xrAppPlatform.c:177
#35 0x00000000008f1092 in main (argc=2, argv=0x7fbfffe718) at main.cpp:213