GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Apr 25, 2014 5:03 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: gtk application crash when use gtk_widget_show_all(window)
PostPosted: Wed Jul 03, 2013 4:33 am 
Offline

Joined: Thu Mar 14, 2013 10:25 am
Posts: 3
Hi Folks,

I am ported gtk-2.20 on DirectFb 1.4.3. After porting gtk, all basic app functionalities are working good.

But when I use below code

Code :

Code:
/* Color Test */
#include <gtk/gtk.h>
/* another callback */
static gboolean delete_event( GtkWidget *widget,
                              GdkEvent  *event,
                              gpointer   data )
{
    gtk_main_quit ();
    return FALSE;
}

int main( int   argc,
          char *argv[] )
{
    /* GtkWidget is the storage type for widgets */
    GtkWidget *window;
    GtkWidget *vMainbox;
    GdkColor color;
    GtkWidget *hUpbox;
    GtkWidget *hUpch1box;

    GtkWidget *hDownbox;
    GtkWidget   *area;

    gtk_init (&argc, &argv);

    /* Create a new window */
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

    gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
    gtk_window_set_title(GTK_WINDOW(window), "Epg Screen");
    gtk_widget_set_size_request(GTK_WIDGET(window),820,600);
    gtk_window_set_title (GTK_WINDOW (window), "Hello Buttons!");

    g_signal_connect (window, "delete-event",
            G_CALLBACK (delete_event), NULL);

    gtk_container_set_border_width (GTK_CONTAINER (window), 10);
    vMainbox = gtk_vbox_new (FALSE, 0);
    gtk_container_add (GTK_CONTAINER (window), vMainbox);
    hUpbox = gtk_hbox_new (FALSE, 0);
    gtk_container_add (GTK_CONTAINER (vMainbox), hUpbox);
    hUpch1box = gtk_hbox_new (FALSE, 0);
    gtk_container_add (GTK_CONTAINER (hUpbox), hUpch1box);

    area = gtk_drawing_area_new();
    gtk_widget_set_size_request(area, 10, 10);
    gdk_color_parse( "red" /*SCREEN_BG_COLOR*/, &color );

  /* set the color */
  gtk_widget_modify_bg (area, GTK_STATE_NORMAL, &color);
   gtk_box_pack_start (GTK_BOX (hUpch1box), area, TRUE, TRUE, 0);
    hDownbox = gtk_hbox_new (FALSE, 0);
    gtk_container_add (GTK_CONTAINER (vMainbox), hDownbox);
    gtk_widget_show_all(window);
    gtk_main ();
}


It is crashing after gtk_widget_show_all(). Logs are

gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2111, tempCount: 0
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2082
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2086
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2089
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2091
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2098
gdkregion-generic.c,IA__gdk_region_rectangle, 165
gdkdraw.c,IA__gdk_drawable_get_display, 235
gdkdraw.c,IA__gdk_drawable_get_screen, 214
gdkscreen-directfb.c,IA__gdk_screen_get_display, 50
idirectfb.c,IDirectFB_GetDeviceDescription, 336 DFB_OK
(!) [ 691: 12.047] --> Caught signal 11 (at 0x8, invalid address) <--
(!!!) *** WARNING [still objects in 'Window Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
-> ref context 0x20018000...
(!!!) *** WARNING [still objects in 'Layer Region Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in 'Layer Context Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in 'Surface Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
idirectfbsurface.c,IDirectFBSurface_listener, 3440
idirectfbsurface.c,IDirectFBSurface_listener, 3449 RS_REMOVE
idirectfbsurface.c,IDirectFBSurface_listener, 3440
idirectfbsurface.c,IDirectFBSurface_listener, 3449 RS_REMOVE
idirectfbsurface.c,IDirectFBSurface_listener, 3440
idirectfbsurface.c,IDirectFBSurface_listener, 3449 RS_REMOVE
idirectfbsurface.c,IDirectFBSurface_listener, 3440
idirectfbsurface.c,IDirectFBSurface_listener, 3449 RS_REMOVE
(!) FUSION_PROPERTY_CEDE --> Input/output error
core.c,dfb_core_world, 664
core.c,dfb_core_world, 667 core_dfb
(!) Direct/Thread: Canceling 'Fusion Dispatch' (692)!
Aborted.

If I comment out gtk_box_pack_start (GTK_BOX (hUpch1box), area, TRUE, TRUE, 0); Call then it is displaying a window without color surface.

Please help us what could be the problem.

Thanks,
Rajesh.


Top
 Profile  
 
 Post subject: Re: gtk application crash when use gtk_widget_show_all(wind
PostPosted: Wed Jul 03, 2013 6:57 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 709
Location: UK
Hello,

GTK+ 2.20 is very old an not supported any more. Have you tried upgrading GTK+ to 2.24 which is the last of the 2.xx series of GTK+ to support the direct FB. Direct FB has now been dropped in the GTK+ v3.xx series due to the number of bugs in the back end code of GTK for direct FB and the lack of people willing to update it.

The error log looks like the crash occurs deep within direct FB and not within GTK or GDK. If could be a parameter passing error on the part of GDK, so try upgrading to GTK+ 2.24 if possible.

Is there a good reason to use the direct FB back end? As this has never been very well supported.

_________________
E.


Top
 Profile  
 
 Post subject: Re: gtk application crash when use gtk_widget_show_all(wind
PostPosted: Thu Jul 04, 2013 6:38 am 
Offline

Joined: Thu Mar 14, 2013 10:25 am
Posts: 3
HI Micah,

very very thanks for your reply.

I am using gtk on Directfb because it is already ported on my board. Using that I want to proceed.
I have added clear log for above code.

--> After gtk_widget_show_all()
gdkevents-directfb.c,dfb_events_io_func, 216
gdkevents-directfb.c,dfb_events_io_func, 234
gdkevents-directfb.c,dfb_events_io_func, 245
gdkevents-directfb.c,dfb_events_process_window_event, 137
gdkwindowid.c,gdk_directfb_window_id_table_lookup, 67
gdkevents-directfb.c,dfb_events_process_window_event, 165
gdkevents-directfb.c,gdk_event_translate, 502
gdkdraw.c,IA__gdk_drawable_get_display, 235
gdkdraw.c,IA__gdk_drawable_get_screen, 214
gdkdraw.c,IA__gdk_drawable_get_screen, 214
gdkscreen-directfb.c,IA__gdk_screen_get_display, 50
gdkevents-directfb.c,gdk_event_translate, 764
gdkevents-directfb.c,gdk_event_translate, 771
gdkevents-directfb.c,gdk_event_translate, 800
gdkwindow-directfb.c,_gdk_directfb_move_resize_child, 1433
gdkevents-directfb.c,gdk_event_translate, 807
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2082
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2086
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2089
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2091
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2098
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2111, tempCount: 0
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2082
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2086
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2089
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2091
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2098
gdkwindow.c, gdk_window_clear_area_internal, 4583
gdkwindow.c, gdk_window_clear_area_internal, 4599
gdkregion-generic.c,IA__gdk_region_rectangle, 166
gdkregion-generic.c, IA__gdk_region_rectangle, 185
gdkdrawable-directfb.c,_gdk_windowing_create_cairo_surface, 1637
gdkdraw.c,IA__gdk_drawable_get_display, 235
gdkdraw.c,IA__gdk_drawable_get_screen, 214
gdkscreen-directfb.c,IA__gdk_screen_get_display, 50
cairo-directfb-surface.c,cairo_directfb_surface_create, 1928
cairo-directfb-surface.c,cairo_directfb_surface_backend_init, 1867
cairo-directfb-surface.c,cairo_directfb_surface_backend_init, 1895
idirectfb.c,IDirectFB_GetDeviceDescription, 338 DFB_OK ret_desc->driver.name:CONEXANT GRAPHICS ACCELERATION DRIVER,
cairo-directfb-surface.c,cairo_directfb_surface_backend_init, 1914
cairo-directfb-surface.c,cairo_directfb_surface_create, 1939
(!) [ 638: 13.049] --> Caught signal 11 (at 0x8, invalid address) <--
(!!!) *** WARNING [still objects in 'Window Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
-> ref context 0x20018000...
(!!!) *** WARNING [still objects in 'Layer Region Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in 'Layer Context Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in 'Surface Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
idirectfbsurface.c,IDirectFBSurface_listener, 3442
idirectfbsurface.c,IDirectFBSurface_listener, 3451 RS_REMOVE
idirectfbsurface.c,IDirectFBSurface_listener, 3442
idirectfbsurface.c,IDirectFBSurface_listener, 3451 RS_REMOVE
idirectfbsurface.c,IDirectFBSurface_listener, 3442
idirectfbsurface.c,IDirectFBSurface_listener, 3451 RS_REMOVE
idirectfbsurface.c,IDirectFBSurface_listener, 3442
idirectfbsurface.c,IDirectFBSurface_listener, 3451 RS_REMOVE
(!) FUSION_PROPERTY_CEDE --> Input/output error
core.c,dfb_core_world, 664
core.c,dfb_core_world, 667 core_dfb
(!) Direct/Thread: Canceling 'Fusion Dispatch' (639)!
Aborted
#

Please help me in this regards,

Thanks,
Rajesh


Top
 Profile  
 
 Post subject: Re: gtk application crash when use gtk_widget_show_all(wind
PostPosted: Thu Jul 04, 2013 8:51 am 
Offline

Joined: Thu Mar 14, 2013 10:25 am
Posts: 3
Code is Crashing at

dfbsurface->AddRef (dfbsurface); API in below API.

file : cairo-directfb-surface.c
API: cairo_surface_t * cairo_directfb_surface_create (IDirectFB *dfb, IDirectFBSurface *dfbsurface)
{
cairo_directfb_surface_t *surface;
DFBSurfacePixelFormat format;
DFBSurfaceCapabilities caps;
D_ASSERT (dfb != NULL);
D_ASSERT (dfbsurface != NULL);

cairo_directfb_surface_backend_init (dfb);

surface = calloc (1, sizeof (cairo_directfb_surface_t));
if (surface == NULL)
{
return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
}

printf("%s,%s, %d \n ", __FILE__, __FUNCTION__, __LINE__ );
/* code is crashing here */
dfbsurface->AddRef (dfbsurface);
dfbsurface->GetPixelFormat (dfbsurface, &format);
dfbsurface->GetSize (dfbsurface, &surface->width, &surface->height);
surface->dfb = dfb;
surface->dfbsurface = dfbsurface;
surface->format = _directfb_to_cairo_format (format);
surface->content = _directfb_format_to_content (format);

dfbsurface->GetCapabilities (dfbsurface, &caps);
if (caps & DSCAPS_PREMULTIPLIED)
surface->blit_premultiplied = TRUE;
_cairo_surface_init (&surface->base, &_cairo_directfb_surface_backend, surface->content);
return &surface->base;
}

code crashing here:
dfbsurface->AddRef (dfbsurface);

Please help me in this issue..

Thanks in advance,

Regards,
Rajesh


Top
 Profile  
 
 Post subject: Re: gtk application crash when use gtk_widget_show_all(wind
PostPosted: Thu Jul 04, 2013 6:15 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 709
Location: UK
If this is an API function then I can not help you with debugging the source to an old version of GTK+.

_________________
E.


Top
 Profile  
 
 Post subject: Re: gtk application crash when use gtk_widget_show_all(wind
PostPosted: Sat Aug 10, 2013 5:50 am 
Offline
Familiar Face

Joined: Wed Jan 23, 2013 5:18 pm
Posts: 23
Hi,
Errol is right , I too faced the same problem but as Errol suggested I moved to gtk 2.24, now my application is running without crashing.
Please try latest version without changing Directfb version.
Thanks to Errol.
Let me know if any query's.

_________________
Thanks,
Arief.
None of us is stronger than all of us


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group