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 355919 - evolution crashes when display depth set to 8 on sparc machine
evolution crashes when display depth set to 8 on sparc machine
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Do Not Use
2.8.x (obsolete)
Other All
: Normal major
: ---
Assigned To: Harish Krishnaswamy
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2006-09-14 07:49 UTC by Xiurong Simon Zheng
Modified: 2013-09-13 12:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
patch (1.34 KB, patch)
2006-09-14 08:57 UTC, Xiurong Simon Zheng
committed Details | Review

Description Xiurong Simon Zheng 2006-09-14 07:49:56 UTC
Please describe the problem:
evolution crashes when display depth set to 8 on some machine.

Steps to reproduce:
1. Launch evolution on sparc machine like ultra 60
2. Setting up local user mail account in default depth 24
3. logout the gnome and then switch display depth to 8
4. Login again and start evolution.


Actual results:
evolution crashs and shows the following message.

(evolution-1.4:2354): Gdk-WARNING **: Attempt to draw a drawable with depth 24 to a drawable with depth 8
The program 'evolution-1.4' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 2728 error_code 8 request_code 131 minor_code 3)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)


Expected results:
Evolution can be launched properly.

Does this happen every time?
Yes.

Other information:
Comment 1 Xiurong Simon Zheng 2006-09-14 08:57:00 UTC
Created attachment 72761 [details] [review]
patch

gdk_rgb_get_visual()->depth just returns the preferred visual depth, which sometimes isn't equal to the that of current window. So we should put -1 for that argument instead of gdk_rgb_get_visual().
Comment 2 Srinivasa Ragavan 2007-05-08 04:51:17 UTC
Simonz, Im not sure of this patch. How would this affect non-sparc or other machine? Any one else to help me review this?
Comment 3 Xiurong Simon Zheng 2007-05-08 07:21:02 UTC
Here're reference manual pages about gdk_pixmap_new() and gdk_rgb_get_visual().

------------------------------------------------------------------------
GdkPixmap*          gdk_pixmap_new                      (GdkDrawable *drawable,
                                                         gint width,
                                                         gint height,
                                                         gint depth);

Create a new pixmap with a given size and depth.
drawable : 	A GdkDrawable, used to determine default values for the new pixmap. Can be NULL if depth is specified,
width : 	The width of the new pixmap in pixels.
height : 	The height of the new pixmap in pixels.
depth : 	The depth (number of bits per pixel) of the new pixmap. If -1, and drawable is not NULL, the depth of the new pixmap will be equal to that of drawable.

---------------------------------------------------------------------------
GdkVisual*          gdk_rgb_get_visual                  (void);

Gets a "preferred visual" chosen by GdkRGB for rendering image data on the default screen. In previous versions of GDK, this was the only visual GdkRGB could use for rendering. In current versions, it's simply the visual GdkRGB would have chosen as the optimal one in those previous versions. GdkRGB can now render to drawables with any visual.

Returns : 	The GdkVisual chosen by GdkRGB.

Comment 4 Xiurong Simon Zheng 2007-05-08 07:30:25 UTC
Xserver supports multiple depths and the visual call simply returns the 
max depth supported by the Xserver. For example, Xserver support 24bits, 16bits and 8bits, then gdk_rgb_get_visual()->depth possible return 24 rather than 8.

Using -1 will match the depth of the pixmap window to what you have in drawable window, which is your first argument of gdk_pixmap_new().

Additionally, Xsun is default X server on sparc machine, whereas, xorg is the default one on X86 platform. This results in some difference of multiple depths between sparc and X86. when display depth is set as 8, only 8 bits is in support depth on X86, but for sparc machine, 24, 16 and 8 bits are all possibly in the list.

Hope I have explained the root cause clearly.:)
Comment 5 Srinivasa Ragavan 2007-05-12 10:12:26 UTC
Please commit to head only.
Comment 6 Xiurong Simon Zheng 2007-05-12 10:44:55 UTC
Srag, thanks. Just committed to HEAD.