473,685 Members | 2,942 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

import gtk : gives error message

varuns
39 New Member
i have installed following packages in same order as shown

1) python2.5
2) Glib 2.12.12
3) atk-1.9.1
4) cairo 1.4.6
5) pango 1.16.4
6) gtk+-2.10.0
7) pycairo 1.4.0
8) pygobject 2.13.1
9) pygtk-2.8.6

installation succeeds but while importing gtk following error is displayed

Expand|Select|Wrap|Line Numbers
  1. Python 2.5 (r25:51908, Jun  4 2007, 14:10:43)
  2. [GCC 4.1.1] on linux2
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>> import gtk
  5. Traceback (most recent call last):
  6.   File "<stdin>", line 1, in <module>
  7.   File "/usr/local/lib/python2.5/site-packages/gtk-2.0/gtk/__init__.py", line 45, in <module>
  8.     from _gtk import *
  9. ImportError: /usr/local/lib/python2.5/site-packages/gtk-2.0/gtk/_gtk.so: undefined symbol: gdk_keyval_convert_case
please help me to solve this problem..

my OS is Ubuntu Linux the edgy 6.10

thanks in advance for your help
Jun 5 '07 #1
13 6043
bartonc
6,596 Recognized Expert Expert
I've seen lots of compile troubles such as this, with missing symbols, but no one has ever posted back with their solution to this type of error. I think that if one is good with a compiler and has lots of patience, these types of errors can be chased out.

Thank you for such a detailed list of intalled versions. Perhaps this information will enable someone to assist you.

And please, if you come up with a solution before one is found on this site, wont you help us help others by posting back?

Sorry that I couldn't be of more assistance. There are several *nix Pythoneers who check in on this forum, so keep your fingers crossed.
Jun 5 '07 #2
Smygis
126 New Member
Installed everything thru the apt sources or did you compile anything on your own?

Seeing that you are using python 2.5 from 2007 i have to guess you compiled it youreself.

What happens if you try with python2.4?
Jun 5 '07 #3
varuns
39 New Member
i have installed pygtk-2.10.4 (not pygtk-2.8.6 as posted in post 1)

the errors r same with 2.4 also
Expand|Select|Wrap|Line Numbers
  1. >>> import gtk
  2. Traceback (most recent call last):
  3.   File "<stdin>", line 1, in ?
  4.   File "gtk/__init__.py", line 48, in ?
  5.     from gtk import _gtk
  6.   File "/usr/lib/python2.4/ihooks.py", line 409, in import_module
  7.     self.ensure_fromlist(m, fromlist)
  8.   File "/usr/lib/python2.4/ihooks.py", line 474, in ensure_fromlist
  9.     submod = self.import_it(sub, subname, m)
  10.   File "/usr/lib/python2.4/ihooks.py", line 495, in import_it
  11.     m = self.loader.load_module(fqname, stuff)
  12.   File "/usr/lib/python2.4/ihooks.py", line 268, in load_module
  13.     m = self.hooks.load_dynamic(name, filename, file)
  14.   File "ltihooks.py", line 50, in load_dynamic
  15.     return ihooks.Hooks.load_dynamic(self, name, filename, file)
  16.   File "/usr/lib/python2.4/ihooks.py", line 172, in load_dynamic
  17.     return imp.load_dynamic(name, filename, file)
  18. ImportError: gtk/.libs/_gtk.so: undefined symbol: gdk_keyval_convert_case
i m installing all these on scratchbox
Jun 6 '07 #4
bartonc
6,596 Recognized Expert Expert
i have installed pygtk-2.10.4 (not pygtk-2.8.6 as posted in post 1)

the errors r same with 2.4 also
Expand|Select|Wrap|Line Numbers
  1. >>> import gtk
  2. Traceback (most recent call last):
  3.   File "<stdin>", line 1, in ?
  4.   File "gtk/__init__.py", line 48, in ?
  5.     from gtk import _gtk
  6.   File "/usr/lib/python2.4/ihooks.py", line 409, in import_module
  7.     self.ensure_fromlist(m, fromlist)
  8.   File "/usr/lib/python2.4/ihooks.py", line 474, in ensure_fromlist
  9.     submod = self.import_it(sub, subname, m)
  10.   File "/usr/lib/python2.4/ihooks.py", line 495, in import_it
  11.     m = self.loader.load_module(fqname, stuff)
  12.   File "/usr/lib/python2.4/ihooks.py", line 268, in load_module
  13.     m = self.hooks.load_dynamic(name, filename, file)
  14.   File "ltihooks.py", line 50, in load_dynamic
  15.     return ihooks.Hooks.load_dynamic(self, name, filename, file)
  16.   File "/usr/lib/python2.4/ihooks.py", line 172, in load_dynamic
  17.     return imp.load_dynamic(name, filename, file)
  18. ImportError: gtk/.libs/_gtk.so: undefined symbol: gdk_keyval_convert_case
i m installing all these on scratchbox
My friend, smygis, makes a good point:
"Python 2.5 (r25:51908, Jun 4 2007, 14:10:43)" looks like you have compiled a subversion.
On Windows we get a clear message stating that packages won't run with a particular version of python. Trying the packages that you have with Python 2.4 is certainly worth a shot.
Jun 6 '07 #5
varuns
39 New Member
After a long search, i have got some hint regarding why it gives error of Undefined symbol: gdk_keyval_conv ert_case

Its because i want to use gtk+ with directfb as target not the default target - X11. Currently the function gdk_keyval_conv ert_case is not defined in GDK-DFB ie in file gdk/direcfb/gdkkeys-directfb.c

I looked at x11 support and there its wrapped with #ifdef HAVE_XCONVERTCA SE.

So now i m looking to find a solution for that until its supported by gtk-dfb.
Jun 8 '07 #6
bartonc
6,596 Recognized Expert Expert
After a long search, i have got some hint regarding why it gives error of Undefined symbol: gdk_keyval_conv ert_case

Its because i want to use gtk+ with directfb as target not the default target - X11. Currently the function gdk_keyval_conv ert_case is not defined in GDK-DFB ie in file gdk/direcfb/gdkkeys-directfb.c

I looked at x11 support and there its wrapped with #ifdef HAVE_XCONVERTCA SE.

So now i m looking to find a solution for that until its supported by gtk-dfb.
Thank you so much for keeping us up-to-date! This is sure to help others in the near future and beyond.
Jun 8 '07 #7
varuns
39 New Member
i got a solution so i have just copied it here
i tried it but didn't worked on my machine
may be it will be helpful to other. Its from a solution posted on a forum


Hello,

Attilio Fiandrotti wrote:
> patrickd at vmware.com wrote:
>> Hey guys,
>>
>> I'm trying to get pygtk to work with the GTK-DFB project and so far have
>> run into some stumbling blocks. I've gotten DirectFB to work and can get
>> gtk-demo to run from the directions given at the GTK_on_DirectFB wiki
>> page.
>>
>> I recompiled the pygtk-2.8.6 source using the
>> PREFIX/LD_LIBRARY_PATH/PKG_CONFIG_PATH env settings recommended on the
>> GTK-DFB wiki page and used:
>>
>> ./configure --prefix=$PREFIX --without-x
>>
>> to build it. I set up PYTHONPATH to use $PREFIX/lib/python2.4 and
>> $PREFIX/lib/python2.4/site-packages/gtk-2.0. So far I seem to be able to
>> almost get it to work, however when I try to import gtk in python I run
>> into this error:
>>
>>
>>>>> import gtk
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in ?
>> File "/usr/gtkdfb/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 45, in ?
>> from _gtk import *
>> ImportError: /usr/gtkdfb/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so: undefined symbol: gdk_keyval_conv ert_case
>>
>> I'm I correct in assuming gdk_keyval_conv ert_case isn't yet implemented in
>> GTK-DFB? I haven't yet started pulling apart the source.
>
> gdk_keyval_conv ert_case is an empty stub and currently is commented out
> in gdkkeys-directfb.c (i dunno why, but you could try to uncomment it):
> what version of gtkdfb are you using (you should be using mainstream
> version 2.9 from cvs.gnome.org) ?

I have a fresh SVN checkout from the trunk and gdk_keyval_conv ert_case
seems to be completely removed from gdk/directfb/gdkkeys-directfb.c. I
was looking in the x11 support and there it is wrapped with an #ifdef
HAVE_XCONVERTCA SE. Maybe a simple solution for now would be to put the
same ifdef (if it's available there) in pygtk. I know that's not fixing
the problem the right way but maybe a quick hack until it is supported
by gtk-dfb.

-Rob
I ran into the same problem when I looked at doing this about 6 months ago
and haven't had time to pick it back up again. Pygtk support would be
really, really, really nice to have.

--Patrick.


On Thu, 11 Jan 2007, Rob Shortt wrote:

> Hello,
>
> Attilio Fiandrotti wrote:
>> patrickd at vmware.com wrote:
>>> Hey guys,
>>>
>>> I'm trying to get pygtk to work with the GTK-DFB project and so far have
>>> run into some stumbling blocks. I've gotten DirectFB to work and can get
>>> gtk-demo to run from the directions given at the GTK_on_DirectFB wiki
>>> page.
>>>
>>> I recompiled the pygtk-2.8.6 source using the
>>> PREFIX/LD_LIBRARY_PATH/PKG_CONFIG_PATH env settings recommended on the
>>> GTK-DFB wiki page and used:
>>>
>>> ./configure --prefix=$PREFIX --without-x
>>>
>>> to build it. I set up PYTHONPATH to use $PREFIX/lib/python2.4 and
>>> $PREFIX/lib/python2.4/site-packages/gtk-2.0. So far I seem to be able to
>>> almost get it to work, however when I try to import gtk in python I run
>>> into this error:
>>>
>>>
>>>>>> import gtk
>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in ?
>>> File "/usr/gtkdfb/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py",
>>> line 45, in ?
>>> from _gtk import *
>>> ImportError: /usr/gtkdfb/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so:
>>> undefined symbol: gdk_keyval_conv ert_case
>>>
>>> I'm I correct in assuming gdk_keyval_conv ert_case isn't yet implemented in
>>> GTK-DFB? I haven't yet started pulling apart the source.
>>
>> gdk_keyval_conv ert_case is an empty stub and currently is commented out in
>> gdkkeys-directfb.c (i dunno why, but you could try to uncomment it): what
>> version of gtkdfb are you using (you should be using mainstream version 2.9
>> from cvs.gnome.org) ?
>
> I have a fresh SVN checkout from the trunk and gdk_keyval_conv ert_case seems
> to be completely removed from gdk/directfb/gdkkeys-directfb.c. I was looking
> in the x11 support and there it is wrapped with an #ifdef HAVE_XCONVERTCA SE.
> Maybe a simple solution for now would be to put the same ifdef (if it's
> available there) in pygtk. I know that's not fixing the problem the right
> way but maybe a quick hack until it is supported by gtk-dfb.
>
> -Rob
>
Patrick Devine wrote:
> I ran into the same problem when I looked at doing this about 6 months ago
> and haven't had time to pick it back up again. Pygtk support would be
> really, really, really nice to have.

I agree. I've been working all day at this: cairo-1.3.10 snapshot,
pycairo from CVS; pango, gtk+, pygobject, pygtk from SVN.

I spent some time on gtk+ figuring out how the symbols work there:

Index: gdk/gdk.symbols
=============== =============== =============== =============== =======
--- gdk/gdk.symbols (revision 17133)
+++ gdk/gdk.symbols (working copy)
@@ -796,6 +796,7 @@
gdk_keyval_is_u pper G_GNUC_CONST
gdk_keyval_to_l ower G_GNUC_CONST
gdk_keyval_to_u pper G_GNUC_CONST
+gdk_keyval_con vert_case
#endif
#endif


Basicly I think that tells it to use the gdk_keyval_conv ert_case from
gdk/gdkkeys.c and not one implimented in gdk/directfb.

I thought I would be home free now but python -c "import gtk" segfaults
on me now, for what reason is unknown.. it may not even be related. I'm
starting to get discouraged here but willing to continue if others are
on board. I may put the stub of gdk_keyval_conv ert_case back into
gdkkeys-directfb.c and move the symbols entry to correspond, maybe that
will help.

-Rob
Rob Shortt wrote:
> I thought I would be home free now but python -c "import gtk" segfaults
> on me now, for what reason is unknown.. it may not even be related. I'm
> starting to get discouraged here but willing to continue if others are
> on board. I may put the stub of gdk_keyval_conv ert_case back into
> gdkkeys-directfb.c and move the symbols entry to correspond, maybe that
> will help.

I just tried that, and also removed the corresponding binding from
pygtk, still segfaults. Time to find out how to run this through gdb I
guess.

-Rob
Rob Shortt wrote:
> Patrick Devine wrote:
>
>>I ran into the same problem when I looked at doing this about 6 months ago
>>and haven't had time to pick it back up again. Pygtk support would be
>>really, really, really nice to have.
>
>
> I agree. I've been working all day at this: cairo-1.3.10 snapshot,
> pycairo from CVS; pango, gtk+, pygobject, pygtk from SVN.
>
> I spent some time on gtk+ figuring out how the symbols work there:
>
> Index: gdk/gdk.symbols
> =============== =============== =============== =============== =======
> --- gdk/gdk.symbols (revision 17133)
> +++ gdk/gdk.symbols (working copy)
> @@ -796,6 +796,7 @@
> gdk_keyval_is_u pper G_GNUC_CONST
> gdk_keyval_to_l ower G_GNUC_CONST
> gdk_keyval_to_u pper G_GNUC_CONST
> +gdk_keyval_con vert_case
> #endif
> #endif
>
>
> Basicly I think that tells it to use the gdk_keyval_conv ert_case from
> gdk/gdkkeys.c and not one implimented in gdk/directfb.
>
> I thought I would be home free now but python -c "import gtk" segfaults
> on me now, for what reason is unknown.. it may not even be related. I'm
> starting to get discouraged here but willing to continue if others are
> on board. I may put the stub of gdk_keyval_conv ert_case back into
> gdkkeys-directfb.c and move the symbols entry to correspond, maybe that
> will help.

Hi

Grep'ing the directfb dir and looking at the directfb TODO file, i see
that gdk_keyval_conv ert_case() has not been implemented yet: since Mike
Emmel should be commiting a round of patches i sent him recently, could
you try to write a patch that provides the missing gdk function without
relying on XConvertCase (do we have somthing similar in DFB ?).
For the short term a simple empty stub may do.

About the crash you are experiencing with python gtk bindings, could it
be that's because those bindings are bound to gtk/x11 and not gtk/dfb ?
pherhaps you need rebuilding against gtk/dfb? just a hypotesis..

cheers

Attilio
Attilio Fiandrotti wrote:
> Grep'ing the directfb dir and looking at the directfb TODO file, i see
> that gdk_keyval_conv ert_case() has not been implemented yet: since Mike
> Emmel should be commiting a round of patches i sent him recently, could
> you try to write a patch that provides the missing gdk function without
> relying on XConvertCase (do we have somthing similar in DFB ?).

I am not sure about the DirectFB equivalent.


> For the short term a simple empty stub may do.

In my copy I've added the stub back:

Index: gdk/directfb/gdkkeys-directfb.c
=============== =============== =============== =============== =======
--- gdk/directfb/gdkkeys-directfb.c (revision 17133)
+++ gdk/directfb/gdkkeys-directfb.c (working copy)
@@ -2008,6 +2008,14 @@
return 0;
}

+void
+gdk_keyval_con vert_case (guint symbol,
+ guint *lower,
+ guint *upper)
+{
+
+ g_warning("Unim plemented: gdk_keyval_conv ert_case\n");
+}

#define __GDK_KEYS_DIRE CTFB_C__
#include "gdkaliasde f.c"
Index: gdk/gdk.symbols
=============== =============== =============== =============== =======
--- gdk/gdk.symbols (revision 17133)
+++ gdk/gdk.symbols (working copy)
@@ -828,6 +828,7 @@
gdk_keymap_get_ for_display
gdk_keymap_look up_key
gdk_keymap_tran slate_keyboard_ state
+gdk_keyval_con vert_case
gdk_keyval_from _name
gdk_keyval_name G_GNUC_CONST
#endif


But doing this conflicts with the gdk_keyval_conv ert_case() in
gdk/gdkkeys.c. This isn't an issue with the one in the x11 support
because one is wrapped in #ifndef HAVE_XCONVERTCA SE and the other in
#ifdef HAVE_XCONVERTCA SE. That must be defined on my system, I have
some x libs and headers installed (but am NOT building the x11 backend).
As a quick hack I simply removed the function in gdkkeyc.c.

>
> About the crash you are experiencing with python gtk bindings, could it
> be that's because those bindings are bound to gtk/x11 and not gtk/dfb ?
> pherhaps you need rebuilding against gtk/dfb? just a hypotesis..

No, I've built them fresh against gtk/dfb.

-Rob
Hi, I just wanted to post an update.

Attached is the patch I am using to add gdk_keyval_conv ert_case() into
the directfb backend. I noticed something while running gtk-demo with
this patch. I get the message "Unimplemen ted: gdk_keyval_conv ert_case"
which makes perfect sense, then the demo exits (I don't see the demo).
The first thing I realized is that I ran the demo successfully earlier,
and I verified this by reversing my patch.

Ok, back to the original problem. After reverting everything:

# python -c "import gtk"
Traceback (most recent call last):
File "<string>", line 1, in ?
File
"/usr/local/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line
48, in ?
from gtk import _gtk
ImportError: /usr/local/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so:
undefined symbol: gdk_keyval_conv ert_case

BUT, that symbol IS defined. I can run gtk-demo again, and it works. I
do not get the "Unimplemen ted: gdk_keyval_conv ert_case" message. I
think that the problem lies with either how gtk+ exposes its symbols or
how pygtk is using the library. In gtk+ I am going to look closer at
the relationship between the backend implimentations and the generic
functions, also with gdk/gdk.symbols and gdk/gdkalias.h /
gdk/gdkaliasdef.c.

-Rob
Rob Shortt wrote:
> Hi, I just wanted to post an update.
>
> Attached is the patch I am using to add gdk_keyval_conv ert_case() into
> the directfb backend. I noticed something while running gtk-demo with
> this patch. I get the message "Unimplemen ted: gdk_keyval_conv ert_case"
> which makes perfect sense, then the demo exits (I don't see the demo).
> The first thing I realized is that I ran the demo successfully earlier,
> and I verified this by reversing my patch.

<snip/>

Uhm, if the gtk-demo app cannot start and exits with a crash after
applying the patch, then i think there must be somtheing wrong in your
patch that maybe also causes py-gtk to crash.
I think you should first get a working gtk-demo with patched gtk/dfb,
and later work on the py-gtk side

regards

Attilio
Attilio Fiandrotti wrote:
> Rob Shortt wrote:
>> Hi, I just wanted to post an update.
>>
>> Attached is the patch I am using to add gdk_keyval_conv ert_case() into
>> the directfb backend. I noticed something while running gtk-demo with
>> this patch. I get the message "Unimplemen ted: gdk_keyval_conv ert_case"
>> which makes perfect sense, then the demo exits (I don't see the demo).
>> The first thing I realized is that I ran the demo successfully earlier,
>> and I verified this by reversing my patch.
>
> <snip/>
>
> Uhm, if the gtk-demo app cannot start and exits with a crash after
> applying the patch, then i think there must be somtheing wrong in your
> patch that maybe also causes py-gtk to crash.

Yes, that's what I was getting at. :) I was only pointing out what I
had done (and undone).

> I think you should first get a working gtk-demo with patched gtk/dfb,
> and later work on the py-gtk side

Gtk-demo is back to working state and also by adding the symbol to
gdk/gdk.symbols I got rid of the undefined symbol error in pygtk. Now
the segfault is occurring there and I have found the problem.

See this backtrace of python -c "import gtk":

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209919808 (LWP 3797)]
0xb7e8e783 in strlen () from /lib/tls/libc.so.6
(gdb) bt
#0 0xb7e8e783 in strlen () from /lib/tls/libc.so.6
#1 0x080840ea in PyString_FromSt ring ()
#2 0xb7a6899b in init_gtk () at gtkmodule.c:134
#3 0x080d631c in _PyImport_LoadD ynamicModule ()
#4 0x080d4315 in PyImport_ExecCo deModule ()
#5 0x080d4a39 in PyImport_Reload Module ()
#6 0x080d4d60 in PyImport_Reload Module ()
#7 0x080d52d4 in PyImport_Import ModuleEx ()
#8 0x080afe91 in _PyBuiltin_Init ()
#9 0x080589d7 in PyObject_Call ()
#10 0x080b3d2d in PyEval_CallObje ctWithKeywords ()
#11 0x080b7a80 in PyEval_EvalFram e ()
#12 0x080ba745 in PyEval_EvalCode Ex ()
#13 0x080ba7a9 in PyEval_EvalCode ()
#14 0x080d38ec in PyImport_ExecCo deModuleEx ()
#15 0x080d3f66 in PyImport_ExecCo deModule ()
#16 0x080d5876 in PyImport_Import Module ()
#17 0x080d4a39 in PyImport_Reload Module ()
#18 0x080d4ee1 in PyImport_Reload Module ()
#19 0x080d50ee in PyImport_Import ModuleEx ()
#20 0x080afe91 in _PyBuiltin_Init ()
#21 0x080589d7 in PyObject_Call ()
#22 0x080b3d2d in PyEval_CallObje ctWithKeywords ()
#23 0x080b7a80 in PyEval_EvalFram e ()
#24 0x080ba745 in PyEval_EvalCode Ex ()
#25 0x080ba7a9 in PyEval_EvalCode ()
#26 0x080dc995 in PyRun_Interacti veOneFlags ()
#27 0x080dcab0 in PyRun_Interacti veLoopFlags ()
#28 0x080dd5b2 in PyRun_AnyFileEx Flags ()
#29 0x08055ba8 in Py_Main ()
#30 0x08055032 in main ()


OK, gtkmodule.c line 134, we're looking at code like this:

/* Add predefined atoms */
#define add_atom(name) { aname = gdk_atom_name(( GDK_##name)); \
printf("DEBUG: %s\n", #name); \
printf("DEBUG: %s\n", aname); \
/* PyModule_AddObj ect(m, #name, PyString_FromSt ring(aname)); */ \
g_free(aname); }

add_atom(SELECT ION_PRIMARY);
add_atom(SELECT ION_SECONDARY);


FYI, I added the DEBUG prints. Here gdk_atom_name() is returning NULL,
forcing the segfault. I need to figure out why all these are NULL for
gtk-directfb. I may have to move this to a different mailing list...
do you know the maintainer for gtk-directfb? I need to understand the
gtk internals a bit more and how the backends relate to the core.

With my DEBUGs, here is the output of python -c "import gtk":

# python -c "import gtk"
DEBUG: SELECTION_PRIMA RY
DEBUG: (null)
DEBUG: SELECTION_SECON DARY
DEBUG: (null)
DEBUG: SELECTION_CLIPB OARD
DEBUG: (null)
DEBUG: TARGET_BITMAP
DEBUG: (null)
DEBUG: TARGET_COLORMAP
DEBUG: (null)
DEBUG: TARGET_DRAWABLE
DEBUG: (null)
DEBUG: TARGET_PIXMAP
DEBUG: (null)
DEBUG: TARGET_STRING
DEBUG: (null)
DEBUG: SELECTION_TYPE_ ATOM
DEBUG: (null)
DEBUG: SELECTION_TYPE_ BITMAP
DEBUG: (null)
DEBUG: SELECTION_TYPE_ COLORMAP
DEBUG: (null)
DEBUG: SELECTION_TYPE_ DRAWABLE
DEBUG: (null)
DEBUG: SELECTION_TYPE_ INTEGER
DEBUG: (null)
DEBUG: SELECTION_TYPE_ PIXMAP
DEBUG: (null)
DEBUG: SELECTION_TYPE_ WINDOW
DEBUG: (null)
DEBUG: SELECTION_TYPE_ STRING
DEBUG: (null)

=============== ========| DirectFB 1.0.0-rc3 |============== =========
(c) 2001-2006 United Cultures of Earth - go for outer space!
(c) 2000-2004 Convergence (integrated media) GmbH
----------------------------------------------------------------

(*) DirectFB/Core: Multi Application Core. (2007-01-02 03:03)
(*) Direct/Thread: Running 'Fusion Dispatch' (MESSAGING, 12772)...
(*) DirectFB/Core: doing sync()...
(*) DirectFB/Genefx: MMX detected and enabled
(*) DirectFB/Graphics: VIA/S3G CLE266/UniChrome 0.4 (-)

(-c:12770): Gdk-CRITICAL **: gdk_drawable_se t_colormap: assertion `cmap
== NULL || gdk_drawable_ge t_depth (drawable) == cmap->visual->depth' failed
(*) Direct/Thread: Running 'EventBufferFee d' (MESSAGING, 12773)...
(!!!) *** WARNING [Application exited without deinitializatio n of
DirectFB!] *** [core.c:745 in dfb_core_deinit _check()]
(!) Direct/Thread: Canceling 'Fusion Dispatch' (12772)!



Thanks,
-Rob
Rob Shortt wrote:
> Attilio Fiandrotti wrote:

<snip/>

>>I think you should first get a working gtk-demo with patched gtk/dfb,
>>and later work on the py-gtk side
>
>
> Gtk-demo is back to working state and also by adding the symbol to
> gdk/gdk.symbols I got rid of the undefined symbol error in pygtk. Now
> the segfault is occurring there and I have found the problem.
>
> See this backtrace of python -c "import gtk":
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1209919808 (LWP 3797)]
> 0xb7e8e783 in strlen () from /lib/tls/libc.so.6
> (gdb) bt
> #0 0xb7e8e783 in strlen () from /lib/tls/libc.so.6
> #1 0x080840ea in PyString_FromSt ring ()
> #2 0xb7a6899b in init_gtk () at gtkmodule.c:134
> #3 0x080d631c in _PyImport_LoadD ynamicModule ()
> #4 0x080d4315 in PyImport_ExecCo deModule ()
> #5 0x080d4a39 in PyImport_Reload Module ()
> #6 0x080d4d60 in PyImport_Reload Module ()
> #7 0x080d52d4 in PyImport_Import ModuleEx ()
> #8 0x080afe91 in _PyBuiltin_Init ()
> #9 0x080589d7 in PyObject_Call ()
> #10 0x080b3d2d in PyEval_CallObje ctWithKeywords ()
> #11 0x080b7a80 in PyEval_EvalFram e ()
> #12 0x080ba745 in PyEval_EvalCode Ex ()
> #13 0x080ba7a9 in PyEval_EvalCode ()
> #14 0x080d38ec in PyImport_ExecCo deModuleEx ()
> #15 0x080d3f66 in PyImport_ExecCo deModule ()
> #16 0x080d5876 in PyImport_Import Module ()
> #17 0x080d4a39 in PyImport_Reload Module ()
> #18 0x080d4ee1 in PyImport_Reload Module ()
> #19 0x080d50ee in PyImport_Import ModuleEx ()
> #20 0x080afe91 in _PyBuiltin_Init ()
> #21 0x080589d7 in PyObject_Call ()
> #22 0x080b3d2d in PyEval_CallObje ctWithKeywords ()
> #23 0x080b7a80 in PyEval_EvalFram e ()
> #24 0x080ba745 in PyEval_EvalCode Ex ()
> #25 0x080ba7a9 in PyEval_EvalCode ()
> #26 0x080dc995 in PyRun_Interacti veOneFlags ()
> #27 0x080dcab0 in PyRun_Interacti veLoopFlags ()
> #28 0x080dd5b2 in PyRun_AnyFileEx Flags ()
> #29 0x08055ba8 in Py_Main ()
> #30 0x08055032 in main ()
>
>
> OK, gtkmodule.c line 134, we're looking at code like this:
>
> /* Add predefined atoms */
> #define add_atom(name) { aname = gdk_atom_name(( GDK_##name)); \
> printf("DEBUG: %s\n", #name); \
> printf("DEBUG: %s\n", aname); \
> /* PyModule_AddObj ect(m, #name, PyString_FromSt ring(aname)); */ \
> g_free(aname); }
>
> add_atom(SELECT ION_PRIMARY);
> add_atom(SELECT ION_SECONDARY);
>
>
> FYI, I added the DEBUG prints. Here gdk_atom_name() is returning NULL,
> forcing the segfault. I need to figure out why all these are NULL for
> gtk-directfb. I may have to move this to a different mailing list...
> do you know the maintainer for gtk-directfb? I need to understand the
> gtk internals a bit more and how the backends relate to the core.

</snip>

ok, we had cases of crashes in gtk/dfb similar to this in the past: this
seems to be a gtk issue, so the correct mailing list to ask for advice
is gtk-devel [1].
I think you should report here the issue you've found (only the
gdk_atom() stuff, letting go the pygtk backgound) and ask if it's ok for
gdk_atom_name() to return NULL: in this case gtkmodule should free aname
only if != NULL.
Otherwise we'll need to patch gtk/dfb to never return NULL from
gdk_atom_name() .
Current maintainer for gtk/dfb is Mike Emmel, former maintainer and
author is Sven Neumann, both are subscribed to both gtk-devel and
directfb-dev.

cheers

Attilio
Jun 19 '07 #8
varuns
39 New Member
hi
finally i got the solution to this problem
no need to look at previous post

open file pygtk-x.x/gtk/gdk.override
search "ignore" in it
than add gdk_keyval_conv ert_case in that block
it should than look like this
%%
ignore
gdk_window_set_ debug_updates
gdk_region_dest roy
gdk_atom_intern _static_string
gdk_pixbuf_from _pixdata
gdk_keyval_conv ert_case
%%

Make a change also in gtk+/gdk/directfb/gdkproperty-directfb.c
search for function gdk_atom_name and replace all statements with these
statements so that it looks like

gchar *
gdk_atom_name (GdkAtom atom)
{
if (!atoms_to_name s)
ensure_atom_tab les();

if (GPOINTER_TO_IN T (atom)-1 >= atoms_to_names->len)
return NULL;
return g_strdup(g_ptr_ array_index (atoms_to_names ,
GPOINTER_TO_INT (atom)-1));
}

after making changes first make install gtk again
than proceed as shown
1. cd pygobject && ./configure PYTHON=pythonx. x && make && make install
(x.x is version of python currently installed)
2. cd pygtk && ./configure PYTHON=pythonx. x && make && make install


cheers
varun
Aug 10 '07 #9
johnwood1967
3 New Member
this solution didn't work for me (probably me doing
something not right)

I still get the following error
ImportError: /usr/gtkdfb/src/pygtk-2.10.0/gtk/.libs/_gtk.so: undefined symbol: gdk_keyval_conv ert_case

GTK-directfb is working correctly with the
regular /usr/gtkdfb/bin/gtk-demo.
Also pygtk is working with the GTK bound to X.

I modified the C sources, re- configured
and re-installed both GTK and pygtk but still
the same error. Any ideas what I might have
wrong?

thanks
John


hi
finally i got the solution to this problem
no need to look at previous post

open file pygtk-x.x/gtk/gdk.override
search "ignore" in it
than add gdk_keyval_conv ert_case in that block
it should than look like this
%%
ignore
gdk_window_set_ debug_updates
gdk_region_dest roy
gdk_atom_intern _static_string
gdk_pixbuf_from _pixdata
gdk_keyval_conv ert_case
%%

Make a change also in gtk+/gdk/directfb/gdkproperty-directfb.c
search for function gdk_atom_name and replace all statements with these
statements so that it looks like

gchar *
gdk_atom_name (GdkAtom atom)
{
if (!atoms_to_name s)
ensure_atom_tab les();

if (GPOINTER_TO_IN T (atom)-1 >= atoms_to_names->len)
return NULL;
return g_strdup(g_ptr_ array_index (atoms_to_names ,
GPOINTER_TO_INT (atom)-1));
}

after making changes first make install gtk again
than proceed as shown
1. cd pygobject && ./configure PYTHON=pythonx. x && make && make install
(x.x is version of python currently installed)
2. cd pygtk && ./configure PYTHON=pythonx. x && make && make install


cheers
varun
Sep 6 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2715
by: Bill Davy | last post by:
I am working with MSVC6 on Windows XP. I have created an MSVC project called SHIP I have a file SHIP.i with "%module SHIP" as the first line (file is below). I run SHIP.i through SWIG 1.3.24 to obtain SHIP_wrap.cpp and SHIP.py; the latter contains the line "import _SHIP". I compile SHIP_wrap.cpp and a bunch of files into a DLL which I have the
3
2608
by: krzychu | last post by:
Hi, I have installed brand new platform - Zope-2-7-6, Python 2.4.1, Plone 2.0.5, OS Debian 1:3.3.6-2. After import a old Plone site from the following platform Zope-2-7-4, Python 2.3.3, Plone 2.0.3 to the new one, I get error when I visit PuthonScript in the ZMI. "invalid syntax (Script (Python), line 1)"
1
6696
by: Dan | last post by:
Could someone please help me with auto importing a series of data files into an Access table. I tried to follow code given below in a previous messagebut i'm getting error messages. Here's my database stats: Path: C:\Database (contains the database and all the text files to be imported) Text files to import: (SampleData4.txt and SampleData3.txt as testing examples)
4
3020
by: Steve Jorgensen | last post by:
I'm restarting this thread with a different focus. The project I'm working on now id coming along and will be made to work, and it's too late to start over with a new strategy. Still, I'm not coming to a firm conclusion over whether it was the better approach, and wonder if I should do it differently the next time I'm faced with a similar issue. I needed an app to automatically import from spreadsheets with a semi-dynamic structure,...
0
1275
by: J. Koskey | last post by:
We're having a problem with the File-Get External Data-Import function on a PC with Access 2000 - it just doesn't work, but gives no error message. When we try to use the File-Get External Data-Import function, Access allows us to select an Excel file and highlight it for importing, but then at that point Access just quits doing that function. No error message and it doesn't make Access crash or anything - it just returns to the...
1
2414
by: Srini | last post by:
Hi, I am trying to import an xml file which has more than 255 fields. Access is unable to import the xml file into tables and gives the error message "Too many fields defined." in ImportErrors column. I was wondering is there any solution to fix the problem. Please reply.
4
4020
by: Mathias Waack | last post by:
Hi, I've embedded python into a legacy application. It works - most of the time. In some special situations the app crashes executing the "import random". There are two different situations: 1. the sources compiled with gcc 4.1.2 crash with illegal instruction error: (running my application)
2
1740
by: mattc66 via AccessMonster.com | last post by:
We import data from ASC files. At times the data contains " quotes in the descrition resulting in Import Errors. What I would like to do is create some sort of query that would show the data in question. The Import error gives me the line# referance. I would like to display this line back to the user doing the import. Does anyone have any examples of how I may be able to handle this issue? Thanks
0
2079
by: Michael Boldin via alt email | last post by:
I installed python 2.5 and used the win package for installing MySQLdb. (Iam running Windows XP) Everything works as expected using python directly (Windows command shell) but using IDLE gives the import error below. Same error with PythonWin as my IDE and everything works using python 2.4-- with IDLE and without, mySQLdb is loaded with out error. Below is the IDLEscreen capture Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) on win32...
2
12417
by: HMS Surprise | last post by:
Greetings. What is the implication of the error message 'cannot import name .....'? It occurs when executing the line: from nBaseTest import nBaseTest The file exists and the class within it exists. Changing it to from nBaseTest import x
0
8580
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8931
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8765
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4307
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2943
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2203
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.