gtk application crash when use gtk_widget_show_all(window)

Composer, ChatZilla and other Mozilla applications, along with Netscape, Galeon, K-Meleon and other products.
Post Reply
rajeshb_ec
Posts: 1
Joined: July 4th, 2013, 1:36 am

gtk application crash when use gtk_widget_show_all(window)

Post by rajeshb_ec »

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 :

/* 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, 2112, tempCount: 0
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2083
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2087
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2090
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2092
gdkwindow-directfb.c,_gdk_directfb_calc_abs, 2099
gdkdraw.c,IA__gdk_drawable_get_size, 165
gdkwindow.c, gdk_window_clear_area_internal, 4601
gdkwindow.c, gdk_window_clear_area_internal, 4617
gdkregion-generic.c,IA__gdk_region_rectangle, 166
gdkregion-generic.c, IA__gdk_region_rectangle, 185
gdkdraw.c,_gdk_drawable_ref_cairo_surface, 1371
gdkwindow.c,gdk_window_ref_cairo_surface, 4922
gdkwindow.c,IA__gdk_window_flush, 3426
gdkwindow.c,gdk_window_flush_outstanding_moves, 3381
gdkwindow.c,gdk_window_get_impl_window, 681
gdkwindow.c,gdk_window_get_impl_window, 681
gdkdraw.c,_gdk_drawable_get_source_drawable, 1978
gdkwindow.c,gdk_window_ref_cairo_surface, 4949
gdkdraw.c,_gdk_drawable_create_cairo_surface, 1992
gdkwindow.c,gdk_window_create_cairo_surface, 4909
gdkdrawable-directfb.c,_gdk_windowing_create_cairo_surface, 1637
gdkdraw.c,IA__gdk_drawable_get_display, 245
gdkdraw.c,IA__gdk_drawable_get_screen, 224
gdkscreen-directfb.c,IA__gdk_screen_get_display, 50
cairo-directfb-surface.c,cairo_directfb_surface_create, 1982
cairo-directfb-surface.c,cairo_directfb_surface_create, 1986
cairo-directfb-surface.c,cairo_directfb_surface_create, 1991
cairo-directfb-surface.c,cairo_directfb_surface_create, 1997
cairo-directfb-surface.c,cairo_directfb_surface_backend_init, 1926
cairo-directfb-surface.c,cairo_directfb_surface_backend_init, 1953
idirectfb.c,IDirectFB_GetDeviceDescription, 338 DFB_OK ret_desc->driver.name:CONEXANT GRAPHICS ACCELERATION DRIVER,
cairo-directfb-surface.c,cairo_directfb_surface_backend_init, 1972
cairo-directfb-surface.c,cairo_directfb_surface_create, 2008
(!) [ 631: 13.771] --> 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, 3446
idirectfbsurface.c,IDirectFBSurface_listener, 3455 RS_REMOVE
idirectfbsurface.c,IDirectFBSurface_listener, 3446
idirectfbsurface.c,IDirectFBSurface_listener, 3455 RS_REMOVE
idirectfbsurface.c,IDirectFBSurface_listener, 3446
idirectfbsurface.c,IDirectFBSurface_listener, 3455 RS_REMOVE
idirectfbsurface.c,IDirectFBSurface_listener, 3446
idirectfbsurface.c,IDirectFBSurface_listener, 3455 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' (632)!
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.

I see the code is crashing in
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);



Thanks in Advance,

Regards,
Rajesh
Post Reply