Bug 1402

Summary: Xnest crashes if SHM is compiled in but not available
Product: xorg Reporter: Alexander Gottwald <ago>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: roland.mainz, sndirsch
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
proposed patch
none
fix xf86bigfont.c compile problems
none
[FIXED_X11R68x] revised patch roland.mainz: 6.8-branch+

Description Alexander Gottwald 2004-09-17 05:01:57 UTC
the bigfont extension tests for available shm and skips the allocation of the
FontPrivate index if it is not available. Later the index is used regardless if
it was allocated. 

The patch wraps all parts which use shm or the FontPrivate with a test for
badSysCall (which indicates that shm is not available)
Comment 1 Alexander Gottwald 2004-09-17 05:05:38 UTC
Created attachment 926 [details] [review]
proposed patch

I'll ship the 6.8.1 packages for cygwin with this patch and will commit it
tomorrow if there are no objections
Comment 2 Roland Mainz 2004-09-17 15:34:19 UTC
BTW: It may be possible to work around the crash via % Xnest -extension
XFree86-Bigfont ... # (that extension can be turned off since bug 1361) ...
Comment 3 Alexander Gottwald 2004-09-19 06:00:25 UTC
/cvs/xorg/xc/ChangeLog,v  <--  ChangeLog
new revision: 1.384; previous revision: 1.383
/cvs/xorg/xc/programs/Xserver/Xext/xf86bigfont.c,v  <--  xf86bigfont.c
new revision: 1.3; previous revision: 1.2

marked as fixed
Comment 4 Roland Mainz 2004-09-19 10:33:30 UTC
I am getting the following build failure when compiling "trunk":
-- snip --
gcc -m32 -c -g -DDEBUG_gismobile -ansi -pedantic -Wall -Wpointer-arith
-Wundef    -fno-merge-constants -I. -I../include -I../../../exports/include/X11
-I../../../include/extensions                -I../../../include/fonts -I../mi
-I../render -I../../../programs/Xserver/hw/xfree86/common
-I../../../include/fonts                  -I../hw/dmx  -I../../..
-I../../../exports/include   -Dlinux -D__i386__
-D_POSIX_C_SOURCE=199309L                          -D_POSIX_SOURCE
-D_XOPEN_SOURCE                                 -D_BSD_SOURCE
-D_SVID_SOURCE                                
-D_GNU_SOURCE                           -DSHAPE -DXINPUT -DXKB -DLBX
-DXAPPGROUP  -DXCSECURITY -DTOGCUP    -DXF86BIGFONT -DDPMSExtension    -DPIXPRIV
-DPANORAMIX   -DRENDER -DRANDR       -DXFIXES -DDAMAGE -DCOMPOSITE -DXEVIE
-DGCCUSESGAS -DAVOID_GLYPHBLT -DPIXPRIV
-DSINGLEDEPTH                                 -DXFreeXDGA -DXvExtension         
-DXFree86LOADER  -DXFree86Server                                
-DXF86VIDMODE                           -DXvMCExtension           
-DSMART_SCHEDULE                                 -DBUILDDEBUG
-DXResExtension                           
-DX_BYTE_ORDER=X_LITTLE_ENDIAN                             
-DXORG_VERSION_CURRENT="(((6) * 10000000) + ((8) * 100000) + ((0) * 1000) + 0)"
-DNDEBUG   -DFUNCPROTO=15 -DNARROWPROTO   -DMITMISC -DXTEST -DXTRAP        
-DXSYNC -DXCMISC -DXRECORD      -DMITSHM -DBIGREQS -DXF86VIDMODE       
-DXF86MISC -DDBE -DDPMSExtension -DEVI      -DSCREENSAVER -DXV -DXVMC      
-DGLXEXT -DXF86DRI -DGLX_DIRECT_RENDERING -DGLX_USE_DLOPEN
-DGLX_USE_MESA            -DRES  -DHAS_SHM xf86bigfont.c
xf86bigfont.c: In function `ProcXF86BigfontQueryFont':
xf86bigfont.c:474: error: `badSysCall' undeclared (first use in this function)
xf86bigfont.c:474: error: (Each undeclared identifier is reported only once
xf86bigfont.c:474: error: for each function it appears in.)
xf86bigfont.c:551: warning: comparison between signed and unsigned
xf86bigfont.c:578: warning: comparison between signed and unsigned
xf86bigfont.c:599: warning: comparison between signed and unsigned
xf86bigfont.c:602: warning: comparison between signed and unsigned
xf86bigfont.c:708: warning: comparison between signed and unsigned
make[5]: *** [xf86bigfont.o] Error 1
make[5]: Leaving directory
`/home/gismobile/projects/xorg/work002/xc/programs/Xserver/Xext'
make[4]: *** [Xext] Error 2
make[4]: Leaving directory
`/home/gismobile/projects/xorg/work002/xc/programs/Xserver'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/gismobile/projects/xorg/work002/xc/programs'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/gismobile/projects/xorg/work002/xc'
make[1]: *** [World] Error 2
make[1]: Leaving directory `/home/gismobile/projects/xorg/work002/xc'
make: *** [World] Error 2
-- snip --

Seems to be related to this one...
Comment 5 Shawn Starr 2004-09-19 20:42:28 UTC
Created attachment 947 [details] [review]
fix xf86bigfont.c compile problems

This compiles now with thi patch.
Comment 6 Shawn Starr 2004-09-19 20:53:11 UTC
Comment on attachment 947 [details] [review]
fix xf86bigfont.c compile problems

you may need to do this for shm.c too I think.
Comment 7 Alexander Gottwald 2004-09-20 01:50:44 UTC
I've moved the definition of badSysCall from the OS specific block. It is
defined for all platforms now as False but is only altered on cygwin and bsd.

/cvs/xorg/xc/ChangeLog,v  <--  ChangeLog
new revision: 1.385; previous revision: 1.384
/cvs/xorg/xc/programs/Xserver/Xext/xf86bigfont.c,v  <--  xf86bigfont.c
new revision: 1.4; previous revision: 1.3

Waiting for tinderbox result...
Comment 8 Roland Mainz 2004-09-20 02:18:20 UTC
Alexander:
Can you please attach the build bustage fix here ? Some people need it for their
vendor branches...
Comment 9 Alexander Gottwald 2004-09-20 02:29:10 UTC
Created attachment 948 [details] [review]
[FIXED_X11R68x] revised patch 

moved the definition of badSysCall out of the OS specific block
Comment 10 Alexander Gottwald 2004-09-20 06:14:12 UTC
tinderbox is green again. Marking as fixed
Comment 11 Shawn Starr 2004-09-21 14:57:45 UTC
Comment on attachment 947 [details] [review]
fix xf86bigfont.c compile problems

Not needed anymore,since the correct fix was submitted.
Comment 12 Roland Mainz 2004-10-22 19:52:20 UTC
Comment on attachment 948 [details] [review]
[FIXED_X11R68x] revised patch 

Requesting approval for  checkin into the X11R6.8.x stable branch...
Comment 13 Roland Mainz 2004-10-24 17:28:33 UTC
Comment on attachment 948 [details] [review]
[FIXED_X11R68x] revised patch 

(ignore this change, just testing the release-wranngers mailman filter)
Comment 14 Roland Mainz 2004-10-24 17:46:25 UTC
Comment on attachment 948 [details] [review]
[FIXED_X11R68x] revised patch 

Requesting approval for  checkin into the X11R6.8.x stable branch...
(actually re-requesting as the release-wrangers@freedesktop.org list didn't get
the request in the first cycle...).
Comment 15 Roland Mainz 2004-11-19 07:32:03 UTC
Comment on attachment 948 [details] [review]
[FIXED_X11R68x] revised patch 

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 16 Roland Mainz 2004-12-07 22:41:56 UTC
Comment on attachment 948 [details] [review]
[FIXED_X11R68x] revised patch 

Patch checked-in into X11R68x stable branch:

/cvs/xorg/xc/ChangeLog,v  <--  ChangeLog
new revision: 1.365.2.15; previous revision: 1.365.2.14
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/Xext/xf86bigfont.c,v  <--  xf86bigfont.c
new revision: 1.2.4.1; previous revision: 1.2
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.