2011-03-30 33 views
0

我編譯了Tcl/Tk到我的應用程序。當我打開我的申請,我得到一個窗口(由於Tk_init),我可以操縱:Tk - 段錯誤,當我使用小部件(按鈕,文本)

> wm title . "mysh" 
> wm geometry . 300x300 

但是當我嘗試按鈕或任何其他部件的它出現segfaults

> button .b 
Segmentation fault 

我裝這在gdb並跑了回去跟蹤

Program received signal SIGSEGV, Segmentation fault. 
    [Switching to Thread 182897358752 (LWP 14112)] 
0x0000000100000000 in ??() 
    (gdb) bt 
#0 0x0000000100000000 in ??() 
#1 0x0000000000fe3004 in XML_ParseBuffer() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#2 0x0000000000fa4955 in FcConfigParseAndLoad() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#3 0x0000000000f9d3cc in FcInitLoadConfig() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#4 0x0000000000f9d416 in FcInitLoadConfigAndFonts() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#5 0x0000000000f9d5bd in FcInit() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#6 0x0000000000f97015 in FcConfigGetCurrent() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#7 0x0000000000f98906 in FcConfigSubstituteWithPat() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#8 0x0000000000edf28c in InitFont() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#9 0x0000000000edf52f in TkpGetFontFromAttributes() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#10 0x0000000000f00c4c in Tk_AllocFontFromObj() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#11 0x0000000000efa4d2 in DoObjConfig() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#12 0x0000000000efaa3a in Tk_InitOptions() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#13 0x0000000000e70db2 in ButtonCreate() 
    at <local>/software/gcc_64/include/c++/3.3.6/bits/stl_pair.h:83 
#14 0x0000000001588581 in TclEvalObjvInternal() 

我認爲有一些字體問題。任何想法解決這個問題?

EDIT 1(2011年4月1日):

% uname -a 
Linux scdbuild04 2.6.9-67.ELsmp #1 SMP Fri Nov 16 12:49:06 EST 2007 x86_64 x86_64 x86_64 GNU/Linux 

% ldd libtk8.5.so 
libX11.so.6 => /usr/X11R6/lib64/libX11.so.6 (0x0000002a957b7000) 
libXss.so.1 => /usr/X11R6/lib64/libXss.so.1 (0x0000002a959b0000) 
libXext.so.6 => /usr/X11R6/lib64/libXext.so.6 (0x0000002a95ab3000) 
libdl.so.2 => /lib64/libdl.so.2 (0x0000002a95bc5000) 
libm.so.6 => /lib64/tls/libm.so.6 (0x0000002a95cc8000) 
libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a95e4e000) 
/lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000) 

EDIT 2(2011年4月4日)

% cat /etc/*-release 
CentOS release 4.6 (Final) 

% cat /proc/version 
Linux version 2.6.9-67.ELsmp ([email protected]) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)) #1 SMP Fri Nov 16 12:49:06 EST 2007 

回答

1

你問上comp.lang.tcl這個問題,並解決方法是指定--disable-xft時配置Tk。

我懷疑真正的原因是未能鏈接XML解析器,由於系統更改了傳遞依賴關係的處理方式,因此報告這是一些最新版本的Linux上的潛在問題。 (我忘記了哪個供應商是負責人的;我沒有特別關注最近發生的開發人員討論)。您能否報告Tk庫的報告(沒有解決方法)以及什麼確切的操作系統建立在?另外,你正在嘗試構建哪種版本的Tk?還要注意,在追蹤問題時使用Tcl和Tk的--enable-symbols配置選項會非常有用,因爲這可以讓您在堆棧跟蹤中獲得更好的信息。

+0

在帖子中添加了'ldd'和'uname -a'信息。我將在後面打開'--enable-symbols'後發佈堆棧跟蹤。 – Anand 2011-04-01 15:40:13

+0

我用'--enable-symbols'和'gdb'中的'bt'編譯了同樣的信息。應該在'gdb'或'tcl/tk'編譯中啓用任何其他開關? – Anand 2011-04-01 17:06:39

+0

@Anand:我真的在想哪個供應商。紅帽? SUSE? Debian的? – 2011-04-02 08:29:00

相關問題