문제

TCL / TK를 내 응용 프로그램으로 컴파일했습니다.내 응용 프로그램을 열면, 내가 조작 할 수있는 창 (tk_init로 인해)을 얻습니다.

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

그러나 버튼이나 다른 위젯 중 하나를 시도 할 때

> button .b
Segmentation fault
.

I 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 ()
.

글꼴에 문제가있는 것이 있다고 생각합니다.이 문제를 해결할 생각이 있습니까?

편집 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)
.

편집 2 (04 APR 2011)

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

% cat /proc/version
Linux version 2.6.9-67.ELsmp (mockbuild@builder10.centos.org) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)) #1 SMP Fri Nov 16 12:49:06 EST 2007
.

도움이 되었습니까?

해결책

You asked this question on comp.lang.tcl, and the workaround is to specify --disable-xft when configuring Tk.

I suspect that the real cause is a failure to link an XML parser, which was reported as being a potential issue on some recent versions of Linux due to a system change to the way that transitive dependencies are processed. (I forget which vendor is responsible; I wasn't paying that much attention to the developer discussion where this was thrashed out recently.) Can you report what ldd reports for the Tk library (without the workaround) and what exact OS you're building on? Also, exactly which version of Tk are you trying to build against? Also note that it is enormously more helpful to use the --enable-symbols configure option to Tcl and Tk when tracing down a problem, as that lets you get better information in stack traces.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top