Bug 1404 - Xnest crashing because of uninitialized GetWindowPixmap
Summary: Xnest crashing because of uninitialized GetWindowPixmap
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/DDX/Xnest (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Roland Mainz
QA Contact:
URL:
Whiteboard:
Keywords:
: 1092 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-17 07:25 UTC by Alexander Gottwald
Modified: 2004-12-07 03:03 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
fill ScreenRec structure with 0 after allocating it (593 bytes, patch)
2004-09-17 07:26 UTC, Alexander Gottwald
no flags Details | Splinter Review
[FIXED_X11R68x] Allocate ScreenRec structure filled with 0 (patch for 2004-09-18-trunk) (2.71 KB, patch)
2004-09-18 16:16 UTC, Roland Mainz
roland.mainz: 6.8-branch+
Details | Splinter Review

Description Alexander Gottwald 2004-09-17 07:25:17 UTC
pScreen->GetWindowPixmap is never initialized in Xnest startup and contains
random data. After some server resets it crashes with segfault because
pScreen->GetWindowPixmap is called but is not a valid function.

A quick fix was to set the complete ScreenRec structure to null after allocating
it in dix/main.c (AddScreen)
Comment 1 Alexander Gottwald 2004-09-17 07:26:49 UTC
Created attachment 928 [details] [review]
fill ScreenRec structure with 0 after allocating it
Comment 2 Stefan Dirsch 2004-09-18 15:31:24 UTC
*** Bug 1092 has been marked as a duplicate of this bug. ***
Comment 3 Roland Mainz 2004-09-18 16:06:35 UTC
The patch fixes this and other problems (for example bug 1092) in Xnest, however
it could be done slightly "easier" via using |xcalloc()| instead of the
|xalloc()m;emset(...,0,...)|-sequence...
Comment 4 Roland Mainz 2004-09-18 16:10:15 UTC
Taking bug ...
Comment 5 Roland Mainz 2004-09-18 16:16:44 UTC
Created attachment 939 [details] [review]
[FIXED_X11R68x] Allocate ScreenRec structure filled with 0 (patch for 2004-09-18-trunk)
Comment 6 Roland Mainz 2004-09-18 16:19:28 UTC
Patch checked-in...

/cvs/xorg/xc/ChangeLog,v  <--  ChangeLog
new revision: 1.382; previous revision: 1.381
/cvs/xorg/xc/programs/Xserver/dix/main.c,v  <--  main.c
new revision: 1.4; previous revision: 1.3
Mailing the commit message to xorg-commit@pdx.freedesktop.org...

... marking bug as FIXED.
Comment 7 Stefan Dirsch 2004-09-19 03:45:31 UTC
Great! This fixes the Xnest segfault for me. :-) 
Comment 8 Roland Mainz 2004-11-04 23:11:33 UTC
Comment on attachment 939 [details] [review]
[FIXED_X11R68x] Allocate ScreenRec structure filled with 0 (patch for 2004-09-18-trunk)

Requesting approval for X11R6.8.2. The patch fixes random crashes (like in
DAMAGE code etc.) in Xnest due
uninitalised GetWindowPixmap."): This is the fix for the Xnest
TOPCRASHER. Most distributions (like SuSE etc.) already ship with that patch
since otherwise Xnest is unuseable in most cases.
Comment 9 Alan Coopersmith 2004-11-04 23:21:00 UTC
Stuart independently discovered this bug and applied the same fix to the Xsun 
& Xnest source on Solaris when porting Damage to Solaris Xsun.   I vote for 
putting it in the 6.8.2 branch.
Comment 10 Roland Mainz 2004-11-19 07:35:00 UTC
Comment on attachment 939 [details] [review]
[FIXED_X11R68x] Allocate ScreenRec structure filled with 0 (patch for 2004-09-18-trunk)

Approved for the X11R6.8.x branch in the 2004-11-17 release-wranglers phone
call.
Please don't commit it yourself, I'll handle that once the CVS service is
available again.
Comment 11 Roland Mainz 2004-12-07 22:03:32 UTC
Comment on attachment 939 [details] [review]
[FIXED_X11R68x] Allocate ScreenRec structure filled with 0 (patch for 2004-09-18-trunk)

Patch checked-in into X11R6.8.x stable branch:

/cvs/xorg/xc/ChangeLog,v  <--  ChangeLog
new revision: 1.365.2.9; previous revision: 1.365.2.8
cvs commit: Using deprecated info format strings.  Convert your scripts to use
the new argument format and remove '1's from your info file format strings.
/cvs/xorg/xc/programs/Xserver/dix/main.c,v  <--  main.c
new revision: 1.3.4.1; previous revision: 1.3
cvs commit: Using deprecated info format strings.  Convert your scripts to use
the new argument format and remove '1's from your info file format strings.
Mailing the commit message to xorg-commit@lists.freedesktop.org...


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.