import gtk : gives error message

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • varuns
    New Member
    • Jun 2007
    • 39

    import gtk : gives error message

    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

    Code:
    Python 2.5 (r25:51908, Jun  4 2007, 14:10:43)
    [GCC 4.1.1] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import gtk
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python2.5/site-packages/gtk-2.0/gtk/__init__.py", line 45, in <module>
        from _gtk import *
    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
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    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.

    Comment

    • Smygis
      New Member
      • Jun 2007
      • 126

      #3
      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?

      Comment

      • varuns
        New Member
        • Jun 2007
        • 39

        #4
        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
        Code:
        >>> import gtk
        Traceback (most recent call last):
          File "<stdin>", line 1, in ?
          File "gtk/__init__.py", line 48, in ?
            from gtk import _gtk
          File "/usr/lib/python2.4/ihooks.py", line 409, in import_module
            self.ensure_fromlist(m, fromlist)
          File "/usr/lib/python2.4/ihooks.py", line 474, in ensure_fromlist
            submod = self.import_it(sub, subname, m)
          File "/usr/lib/python2.4/ihooks.py", line 495, in import_it
            m = self.loader.load_module(fqname, stuff)
          File "/usr/lib/python2.4/ihooks.py", line 268, in load_module
            m = self.hooks.load_dynamic(name, filename, file)
          File "ltihooks.py", line 50, in load_dynamic
            return ihooks.Hooks.load_dynamic(self, name, filename, file)
          File "/usr/lib/python2.4/ihooks.py", line 172, in load_dynamic
            return imp.load_dynamic(name, filename, file)
        ImportError: gtk/.libs/_gtk.so: undefined symbol: gdk_keyval_convert_case
        i m installing all these on scratchbox
        Last edited by varuns; Jun 6 '07, 05:20 AM. Reason: to provide more information

        Comment

        • bartonc
          Recognized Expert Expert
          • Sep 2006
          • 6478

          #5
          Originally posted by varuns
          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
          Code:
          >>> import gtk
          Traceback (most recent call last):
            File "<stdin>", line 1, in ?
            File "gtk/__init__.py", line 48, in ?
              from gtk import _gtk
            File "/usr/lib/python2.4/ihooks.py", line 409, in import_module
              self.ensure_fromlist(m, fromlist)
            File "/usr/lib/python2.4/ihooks.py", line 474, in ensure_fromlist
              submod = self.import_it(sub, subname, m)
            File "/usr/lib/python2.4/ihooks.py", line 495, in import_it
              m = self.loader.load_module(fqname, stuff)
            File "/usr/lib/python2.4/ihooks.py", line 268, in load_module
              m = self.hooks.load_dynamic(name, filename, file)
            File "ltihooks.py", line 50, in load_dynamic
              return ihooks.Hooks.load_dynamic(self, name, filename, file)
            File "/usr/lib/python2.4/ihooks.py", line 172, in load_dynamic
              return imp.load_dynamic(name, filename, file)
          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.

          Comment

          • varuns
            New Member
            • Jun 2007
            • 39

            #6
            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.

            Comment

            • bartonc
              Recognized Expert Expert
              • Sep 2006
              • 6478

              #7
              Originally posted by varuns
              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.

              Comment

              • varuns
                New Member
                • Jun 2007
                • 39

                #8
                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

                Comment

                • varuns
                  New Member
                  • Jun 2007
                  • 39

                  #9
                  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

                  Comment

                  • johnwood1967
                    New Member
                    • Sep 2007
                    • 3

                    #10
                    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


                    Originally posted by varuns
                    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

                    Comment

                    • varuns
                      New Member
                      • Jun 2007
                      • 39

                      #11
                      Originally posted by johnwood1967
                      ImportError: /usr/gtkdfb/src/pygtk-2.10.0/gtk/.libs/_gtk.so: undefined symbol: gdk_keyval_conv ert_case
                      can you post what r the steps you have taken to install pygtk.

                      Comment

                      • johnwood1967
                        New Member
                        • Sep 2007
                        • 3

                        #12
                        Ok, here is my setup...
                        I followed the example of getting GTK on Directfb from source:

                        http://www.directfb.or g/wiki/index.php/Projects:GTK_on _DirectFB

                        I installed pango-1.15.3, Python-2.4.4, pygobject-2.13.0,
                        cairo-1.4.6, gtk+-2.10.13 and pygtk-2.10.0

                        I set up environment variables
                        export PREFIX=/usr/gtkdfb
                        export LD_LIBRARY_PATH =$PREFIX/lib
                        export PKG_CONFIG_PATH =$LD_LIBRARY_PA TH/pkgconfig
                        export CFLAGS="-g"

                        then untarred, configure, make, make install with
                        the options as follows.

                        For cairo
                        configure --prefix=$PREFIX --enable-directfb --disable-xlib --disable-win32

                        For gtk
                        configure --prefix=$PREFIX --with-gdktarget=direc tfb --without-x

                        for others, used no extra options

                        After installing, when I run
                        /usr/gtkdfb/bin/gtk-demo
                        works correctly; I get gtk demo within a directfb framebuffer and no
                        X frills.

                        I applied the fixes to the source files, then re-installed
                        gtk and pygtk.
                        Still getting the error

                        ImportError: /usr/local/lib/python2.5/site-packages/gtk-2.0/gtk/_gtk.so: undefined symbol: gdk_keyval_conv ert_case

                        I tried adding the dummy function as recommended by earlier post
                        to make it non-blank but C compiler complained that it was already
                        defined etc.

                        Thanks for any help.
                        pygtk+directfb would be a great combination to help embedded
                        system development.

                        John






                        Originally posted by varuns
                        can you post what r the steps you have taken to install pygtk.

                        Comment

                        • varuns
                          New Member
                          • Jun 2007
                          • 39

                          #13
                          [QUOTE=
                          for others, used no extra options

                          [/QUOTE]

                          every thing seems to be correct

                          have you installed pygobject and pygtk as given below, if so it should work.

                          1. cd pygobject && ./configure --prefix=$PREFIX PYTHON=pythonx. x && make && make install
                          (x.x is version of python currently installed)
                          2. cd pygtk && ./configure --prefix=$PREFIX PYTHON=pythonx. x && make && make install

                          Comment

                          • johnwood1967
                            New Member
                            • Sep 2007
                            • 3

                            #14
                            Ok, thanks I got it to work with the changes
                            you suggested.
                            I had some leftover symlinks to the fedora
                            GTK system and libraries.

                            pygtk on directfb is a very useful package
                            for embedded - way smaller than java + X
                            Calculate it <10 Mbytes for the whole
                            working system as replacement for X and Java.

                            Comment

                            Working...