Tk-segfaults当我使用小部件(按钮,文本) [英] Tk - segfaults when I use widget (button, text)

查看:179
本文介绍了Tk-segfaults当我使用小部件(按钮,文本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Tcl / Tk编译到我的应用程序中。当我打开我的应用程序,我得到一个窗口(由于Tk_init),我可以操作:

 > wm标题。 mysh
> wm几何。 300x300

但是当我尝试按钮或任何其他小部件时,它会删除

 >按钮.b 
分段错误

我在gdb中加载了这个,并运行了一个back trace



 程序接收信号SIGSEGV,分段故障。 
[切换到主题182897358752(LWP 14112)]
0x0000000100000000在?? ()
(gdb)bt
#0 0x0000000100000000 in ?? ()
#1 XML_ParseBuffer()中的$ 0x0000000000fe3004< 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&本地> / software / gcc_64 / include / c ++ / 3.3.6 / bits / stl_pair.h:83
#4在FcInitLoadConfigAndFonts()中的$ 0x0000000000f9d416< local> / software / gcc_64 / include / c ++ /3.3.6/bits/stl_pair.h:83
#5 FcInit()中的$ 0x0000000000f9d5bd< local> / software / gcc_64 / include / c ++ / 3.3.6 / bits / stl_pair.h中的
:83
#6 FcConfigGetCurrent()中的$ 0x0000000000f97015 $&$ / $ / $ / $ / $ / $ / $ / $ / $ / $ / $ / $ FcConfigSubstituteWithPat()
at< local> / software / gcc_64 / include / c ++ / 3.3.6 / bits / stl_pair.h:83
#8 0x0000000000edf28c in InitFont()
at&本地> /软件/ gcc_64 / includ在tkpGetFontFromAttributes()
< local> /软件/ gcc_64 / include / c ++ / 3.3.6 / bits / e / c ++ / 3.3.6 / bits / stl_pair.h:83
#9 0x0000000000edf52f 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.0 0x0000000000efa4d2 DoObjConfig()
at< local> / software / gcc_64 / include / c ++ / 3.3.6 / bits / stl_pair.h:83
#12 0x0000000000efaa3a in Tk_InitOptions()
在< local> / software / gcc_64 / include / c ++ / 3.3.6 / bits / stl_pair.h:83
#13 ButtonCreate()中的0x0000000000e70db2
在< local> / software / gcc_64 / include / c ++ / 3.3.6 / bits / stl_pair.h:83
#14 0x0000000001588581在TclEvalObjvInternal()

我认为Fonts有一些问题。任何想法来解决这个问题?



编辑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(2011年4月04日)

 %cat / etc / * -release 
CentOS版本4.6(最终)

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


解决方案

您在 comp.lang.tcl ,而解决方法是在配置时指定 - disable-xft Tk。



我怀疑真正的原因是无法链接XML解析器,由于系统的原因,这在一些最新版本的Linux上被报告为潜在的问题更改为传递依赖关系的处理方式。 (我忘记了哪个供应商负责;我最近没有对开发人员的讨论付出很多的关注)。你能报告什么是 ldd Tk的报告图书馆(没有解决方法)以及你正在建立的确切操作系统?此外,您正在尝试建立哪个版本的Tk?还要注意,在跟踪问题时,使用T $和Tk的 - enable-symbols 配置选项将更为有用,因为这样可以让您在堆栈中获得更好的信息痕迹。


I have compiled Tcl/Tk into my application. When I open my application, I get a window (due to Tk_init) which I can manipulate:

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

But when I try button or any of the other widgets it segfaults

> button .b
Segmentation fault

I loaded this in gdb and ran a back trace

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

I think there is some problem with Fonts. Any idea to fix this?

EDIT 1 (Apr 01 2011):

% 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 (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.

这篇关于Tk-segfaults当我使用小部件(按钮,文本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆