After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 604632 - gtk 2.19.1 + directfb 1.4.3 Null pointer dereference at initialization
gtk 2.19.1 + directfb 1.4.3 Null pointer dereference at initialization
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: [obsolete] Backend: directfb
2.19.x
Other Linux
: Normal blocker
: ---
Assigned To: gtk-bugs
Michael Emmel
Depends on:
Blocks:
 
 
Reported: 2009-12-15 17:35 UTC by Paulius Zaleckas
Modified: 2010-08-25 02:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix cairo usage (8.95 KB, patch)
2010-02-06 14:36 UTC, André Draszik
none Details | Review

Description Paulius Zaleckas 2009-12-15 17:35:22 UTC
This also happens with gtk 2.19.0 and directfb 1.4.2

I was trying to run svn snapshot of Navit.
Gdb stuff:

Program received signal SIGSEGV, Segmentation fault.
IA__gdk_drawable_get_colormap (drawable=0x0) at gdkdraw.c:276
276	gdkdraw.c: No such file or directory.
	in gdkdraw.c
(gdb) bt
  • #0 IA__gdk_drawable_get_colormap
    at gdkdraw.c line 276
  • #1 gdk_window_real_set_colormap
    at gdkwindow.c line 4708
  • #2 IA__gdk_drawable_set_colormap
    at gdkdraw.c line 259
  • #3 _gdk_windowing_window_init
    at gdkwindow-directfb.c line 350
  • #4 IA__gdk_display_open
    at gdkdisplay-directfb.c line 119
  • #5 IA__gdk_display_open_default_libgtk_only
    at gdk.c line 324
  • #6 IA__gtk_init_check
    at gtkmain.c line 960
  • #7 IA__gtk_init
    at gtkmain.c line 1004
  • #8 plugin_init
    at graphics_gtk_drawing_area.c line 1145
  • #9 plugin_call_init
    at plugin.c line 182
  • #10 plugin_get_type
    at plugin.c line 352
  • #11 plugin_get_graphics_type
    at plugin_def.h line 26
  • #12 graphics_new
    at graphics.c line 142
  • #13 start_element
    at xmlconfig.c line 473
  • #14 xi_start_element
    at xmlconfig.c line 754
  • #15 emit_start_element
    at gmarkup.c line 923
  • #16 IA__g_markup_parse_context_parse
    at gmarkup.c line 1261
  • #17 parse_file
    at xmlconfig.c line 914
  • #18 config_load
    at xmlconfig.c line 983
  • #19 main_real
    at start_real.c line 160
  • #20 main
    at start.c line 25

Meanwhile I am trying to dig deeper into this problem...
Comment 1 Paulius Zaleckas 2009-12-15 22:09:00 UTC
The same happens with gtk 2.18.5
Comment 2 Hiroyuki Ikezoe 2009-12-22 08:05:00 UTC
The patch in bug #600789 may fix this crash.
Comment 3 Paulius Zaleckas 2009-12-31 13:15:41 UTC
(In reply to comment #2)
> The patch in bug #600789 may fix this crash.

Sorry for late reply...
Sadly this patch doesn't fix this particular problem.
private->parent is NULL in gdk_window_real_set_colormap() when it calls gdk_drawable_get_colormap(). And nothing sets it in _gdk_windowing_window_init().

I tried used following patch to overcome this issue, but then another crash happens...

--- gtk+-2.18.5/gdk/gdkwindow.c.orig    2009-12-08 17:13:05.000000000 +0200
+++ gtk+-2.18.5/gdk/gdkwindow.c 2009-12-16 13:46:05.208592895 +0200
@@ -4779,7 +4779,7 @@ gdk_window_real_set_colormap (GdkDrawabl
   private = (GdkWindowObject *)drawable;

   /* different colormap than parent, requires native window */
-  if (!private->input_only &&
+  if (!private->input_only && private->parent &&
       cmap != gdk_drawable_get_colormap ((GdkDrawable *)(private->parent)))
     gdk_window_ensure_native ((GdkWindow *)drawable);
Comment 4 Paulius Zaleckas 2009-12-31 13:21:29 UTC
Forgot to mention that I was testing your patch with gtk 2.18.5
Comment 5 Paulius Zaleckas 2010-01-03 15:53:36 UTC
Did some more testing.
With my patch and without yours I get the same bug you pointed me to. Your patch really fixes it. It is very strange that Yan Weichuan did not experience my crash before the one in bug 600789.

After applying both patches I hit assert in cairo_directfb_surface_create()
In the following backtrace you can see that dfbsurface=0x0 is passed and so assert in cairo happens...

  • #0 cairo_directfb_surface_create
    at cairo-directfb-surface.c line 1959
  • #1 _gdk_windowing_create_cairo_surface
    at gdkdrawable-directfb.c line 1622
  • #2 gdk_window_create_cairo_surface
    at gdkwindow.c line 4847
  • #3 _gdk_drawable_create_cairo_surface
    at gdkdraw.c line 1904
  • #4 gdk_window_ref_cairo_surface
    at gdkwindow.c line 4884
  • #5 _gdk_drawable_ref_cairo_surface
    at gdkdraw.c line 1297
  • #6 gdk_window_clear_backing_region_direct
    at gdkwindow.c line 4425
  • #7 gdk_window_clear_region_internal
    at gdkwindow.c line 4536
  • #8 gdk_window_clear_area_internal
    at gdkwindow.c line 4570
  • #9 IA__gdk_window_clear
    at gdkwindow.c line 4476
  • #10 gdk_event_translate
    at gdkevents-directfb.c line 773
  • #11 dfb_events_process_window_event
    at gdkevents-directfb.c line 160
  • #12 dfb_events_io_func
    at gdkevents-directfb.c line 233
  • #13 g_io_unix_dispatch
    at giounix.c line 162
  • #14 g_main_dispatch
    at gmain.c line 1960
  • #15 IA__g_main_context_dispatch
    at gmain.c line 2513
  • #16 g_main_context_iterate
    at gmain.c line 2591
  • #17 IA__g_main_loop_run
    at gmain.c line 2799
  • #18 event_glib_main_loop_run
    at event_glib.c line 34
  • #19 event_main_loop_run
    at event.c line 36
  • #20 main_real
    at start_real.c line 174
  • #21 main
    at start.c line 25

Comment 6 André Draszik 2010-02-06 14:36:55 UTC
Created attachment 153137 [details] [review]
fix cairo usage

the attached patch fixes cairo usage and cures the segfault
Comment 7 André Draszik 2010-02-06 15:07:50 UTC
(In reply to comment #6)
> Created an attachment (id=153137) [details] [review]

the removal of the cairo version check in the above patch should not be a problem, since gtk requires cairo >= 1.6 anyway
Comment 8 André Draszik 2010-02-09 01:24:24 UTC
Comment on attachment 153137 [details] [review]
fix cairo usage

the patch is incorrect, will have a better version soon :-)
Comment 9 Vasily Khoruzhick 2010-03-16 15:44:56 UTC
Any update on cairo-related patch? I'm hitting this bug too...
Comment 10 junkmailnotread 2010-04-25 01:09:23 UTC
I have the same problem; gdk_window_real_set_colormap() passes a NULL pointer to gdk_drawable_get_colormap(), which duly crashes the process.

I'm using gtk+-2.19.7 and DirectFB-1.4.2 running on an HP iPAQ hx4700 (armv5tel).
Comment 11 junkmailnotread 2010-04-28 10:40:51 UTC
Comments on the gtk-devel-list and gtk-list suggest that the DirectFB backend is "in a badly maintained state", is "heavily broken", that "the DirectFB route is a dead-end", and that "it seems no one works on fixing it". I have not followed development of the DirectFB backend so I am not able to comment.

However, if these comments do accurately describe the current state of the DirectFB backend then shouldn't the maintainers be making a decision about its future? Namely that the DirectFB backend will be fixed or will be dropped.
Comment 12 JesseStone 2010-07-24 22:44:30 UTC
apt-get install fbset
fbset -i

gedit /boot/grub/grub.cfg
find 
quiet splash
to
quiet splash vga=789

gedit /etc/initramfs-tools/modules
add 
fbcon
vesafb

gedit /etc/modprobe.d/blacklist-framebuffer.conf
blacklist vesafb
to
#blacklist vesafb

cd /dev
ln -s fb0 fb

update-initramfs -u 

gedit /usr/x11dfb/etc/directfbrc
system=FBDev
fbdev=/dev/fb0
wm=default
mode=800x600
depth=32
pixelformat=ARGB

https://wiki.ubuntu.com/FrameBuffer 



Open 2 vmwares

one use Gdbserver and another GDB in eclipse, 

easier to debug gtk in directfb mode

http://www.wretch.cc/blog/fatalfeel
Comment 13 Michael Emmel 2010-07-25 05:39:51 UTC
(In reply to comment #11)
> Comments on the gtk-devel-list and gtk-list suggest that the DirectFB backend
> is "in a badly maintained state", is "heavily broken", that "the DirectFB route
> is a dead-end", and that "it seems no one works on fixing it". I have not
> followed development of the DirectFB backend so I am not able to comment.
> 
> However, if these comments do accurately describe the current state of the
> DirectFB backend then shouldn't the maintainers be making a decision about its
> future? Namely that the DirectFB backend will be fixed or will be dropped.

Your probably referring to my comments. The problem is no community has really formed around it thus its support is probably best described as adhoc vs unmaintained. I don't think its bad enough to be removed just a bit sad really.

And to be honest I think the real problem is that the primary users of the port are companies and so far at least no company has stepped up to provide long term support despite the fact a fair number have benefited. This is a big problem with embedded opensource in general not just gtk/directfb.

If this means the port is maintained via random patches form time to time then thats the way it works. As I said a bit sad but its just the way things have worked out. I don't think it should result in pulling the port. What needs to happen somehow is companies involved in embedded opensource software need to wakeup and realize they need to fund the fundamental support and help develop a vibrant opensource community. And we need world peace :)
One of those two events might happen. If you pull the port then you can be pretty certain the embedded community will never become a good opensource citizen.

Hopefully this sets the record strait.
Comment 14 JesseStone 2010-07-26 23:06:53 UTC
(In reply to comment #11)
> Comments on the gtk-devel-list and gtk-list suggest that the DirectFB backend
> is "in a badly maintained state", is "heavily broken", that "the DirectFB route
> is a dead-end", and that "it seems no one works on fixing it". I have not
> followed development of the DirectFB backend so I am not able to comment.
> However, if these comments do accurately describe the current state of the
> DirectFB backend then shouldn't the maintainers be making a decision about its
> future? Namely that the DirectFB backend will be fixed or will be dropped.


Here is a good debug way use IDE for directfb

http://www.wretch.cc/blog/fatalfeel
Comment 15 JesseStone 2010-07-26 23:20:36 UTC
(In reply to comment #5)
> Did some more testing.
> With my patch and without yours I get the same bug you pointed me to. Your
> patch really fixes it. It is very strange that Yan Weichuan did not experience
> my crash before the one in bug 600789.
> After applying both patches I hit assert in cairo_directfb_surface_create()
> In the following backtrace you can see that dfbsurface=0x0 is passed and so
> assert in cairo happens...

If anyone fixed directfb bug in GTK 2.20.X or above please let me know
Comment 16 JesseStone 2010-07-26 23:21:07 UTC
(In reply to comment #15)
> (In reply to comment #5)
> > Did some more testing.
> > With my patch and without yours I get the same bug you pointed me to. Your
> > patch really fixes it. It is very strange that Yan Weichuan did not experience
> > my crash before the one in bug 600789.
> > After applying both patches I hit assert in cairo_directfb_surface_create()
> > In the following backtrace you can see that dfbsurface=0x0 is passed and so
> > assert in cairo happens...
> If anyone fixed directfb bug in GTK 2.20.X or above please let me know

email:fatalfeel@hotmail.com
Comment 17 Matthias Clasen 2010-08-25 02:35:50 UTC
The directfb backend has been removed form GTK 3