Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tk - segfaults when I use button - tkUnixRFont.o problem?

23 views
Skip to first unread message

AR

unread,
Mar 30, 2011, 4:09:20 PM3/30/11
to
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 this is a problem related tkUnixRFont.o
Can you please suggest a way to overcome this?

Thanks
Anand

Donal K. Fellows

unread,
Mar 31, 2011, 5:23:18 AM3/31/11
to
On Mar 30, 9:09 pm, AR <anand...@gmail.com> wrote:
> 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

The problem will happen with any widget that uses fonts. That's nearly
all of them, except for frames and toplevels...

> I loaded this in gdb and ran a back trace

[...]


> I think this is a problem related tkUnixRFont.o
> Can you please suggest a way to overcome this?

I think (based on the stack trace you provided) that it's a problem in
your misconfigured local font configuration. Since you're on Linux,
there's a fairly good chance you've got a mistake in it. Consult your
vendor documentation for how to verify and correct problems in it. You
should also try building Tcl and Tk with --enable-symbols so that the
stack trace there is more useful...

It's also possible that there is a misconfiguration in the build (a
failure to link against an XML parsing library would do it). A
possible workaround is to specify --disable-xft when configuring the
Tk library build, which switches to the old font engine.

Donal.

AR

unread,
Mar 31, 2011, 5:08:37 PM3/31/11
to
Hi Donal,

Compiling with --disable-xft fixed the problem.

Thanks
Anand

0 new messages