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 660184 - Running an X client causes a segfault when using software rendering
Running an X client causes a segfault when using software rendering
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: GLX
git master
Other Linux
: Normal major
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-09-26 22:17 UTC by Damien Leone
Modified: 2011-10-16 09:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
cogl-winsys-glx: prevent a NULL pointer to be dereferenced (1.11 KB, patch)
2011-09-26 22:24 UTC, Damien Leone
none Details | Review
x11-tfp: don't call winsys x11_damage_notify without winsys (2.69 KB, patch)
2011-10-01 15:29 UTC, Robert Bragg
none Details | Review

Description Damien Leone 2011-09-26 22:17:03 UTC
Overview:

Cogl segfaults when running an X client while software rendering is used (typically when GLX TFP could not be initialized). It happened when I was using 30-bit color depth.

Steps to Reproduce:

1. Get hardware compatible with 30-bit color depth
2. startx -- -depth 30
3. Run any X client

Actual Results:

A segmentation fault occurs with the following trace:

  • #0 _cogl_winsys_texture_pixmap_x11_damage_notify
    at ./winsys/cogl-winsys-glx.c line 1979
  • #1 cogl_texture_pixmap_x11_update_area_EXP
    at ./winsys/cogl-texture-pixmap-x11.c line 433
  • #2 clutter_x11_texture_pixmap_update_area_real
    at ./x11/clutter-x11-texture-pixmap.c line 740
  • #3 meta_shaped_texture_update_area
    at compositor/meta-shaped-texture.c line 615

Comment 1 Damien Leone 2011-09-26 22:24:30 UTC
Created attachment 197525 [details] [review]
cogl-winsys-glx: prevent a NULL pointer to be dereferenced

This is a workaround to prevent the segfault. The actual fix would be to track where winsys might be dereferenced while its pointer is NULL.
Comment 2 Robert Bragg 2011-10-01 15:29:23 UTC
Created attachment 197963 [details] [review]
x11-tfp: don't call  winsys x11_damage_notify without winsys

thanks for your patch. I've made a slightly different patch that instead does the validation up in cogl-texture-pixmap-x11.c so that the winsys code can always assume a valid tex_pixmap->winsys code - It's only a minor difference but this way we don't lead to duplicate validation code in each winsys.

If you would be able to verify that this patch works for you that would be greatly appreciated.
Comment 3 Damien Leone 2011-10-03 20:48:36 UTC
Thanks for making an actual patch. I applied it and couldn't reproduce the segfault as described in this bug report.
Comment 4 Robert Bragg 2011-10-12 13:33:23 UTC
thanks for testing, I've landed the patch in master now as 1f61868fed78457c0.
Comment 5 Ionut Biru 2011-10-16 09:50:20 UTC
Robert, can we have this change cherry-picked for cogl-1.8 branch?