Summary: | [Xorg/XPRINT] Xprt crashes when using PMF fonts | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | xprint | Reporter: | Roland Mainz <roland.mainz> | ||||||
Component: | Server: Font engine: PMF | Assignee: | Alan Coopersmith <alan.coopersmith> | ||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||
Severity: | blocker | ||||||||
Priority: | high | CC: | alan.coopersmith, roland.mainz | ||||||
Version: | unspecified | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Whiteboard: | |||||||||
i915 platform: | i915 features: | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 461 | ||||||||
Attachments: |
|
Description
Roland Mainz
2004-04-13 11:07:08 UTC
Mhhh, before one crash I got: -- snip -- Error: Couldn't allocate bitmaps (0) -- snip -- Full stack trace of one if the crashes: -- snip -- AUDIT: Wed Apr 14 23:16:21 2004: 17475 Xprt: client 1 disconnected Could not init font path element /usr/X11R6/lib/X11/fonts/encodings, removing from list! Could not init font path element /usr/X11R6/lib/X11/fonts/kwintv, removing from list! Could not init font path element /usr/X11R6/lib/X11/fonts/local, removing from list! AUDIT: Wed Apr 14 23:16:22 2004: 17475 Xprt: client 1 connected from local host Error: Couldn't allocate bitmaps (0) Xprint server pid=17475 done, exitcode=0. gismobile@puzzle:/tmp/yyy/xprint> file core core: ELF 32-bit LSB core file of 'Xprt' (signal 11), Intel 80386, version 1 (SYSV), from 'Xprt' gismobile@puzzle:/tmp/yyy/xprint> gdb ./install/usr/X11R6/bin/Xprt core GNU gdb 5.3 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i586-suse-linux"... Core was generated by `/tmp/yyy/xprint/install/usr/X11R6/bin/Xprt -ac -pn -nolisten tcp -audit 4 -fp /'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/lib/libfreetype.so.6...done. Loaded symbols for /usr/lib/libfreetype.so.6 Reading symbols from /lib/libz.so.1...done. Loaded symbols for /lib/libz.so.1 Reading symbols from /lib/libm.so.6...done. Loaded symbols for /lib/libm.so.6 Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 #0 0x08068b6f in FreeFPE (fpe=0x0) at dixfonts.c:233 233 fpe->refcount--; (gdb) where #0 0x08068b6f in FreeFPE (fpe=0x0) at dixfonts.c:233 #1 0x08068fbc in doOpenFont (client=0x8699268, c=0x868b4a8) at dixfonts.c:377 #2 0x08069226 in OpenFont (client=0x8699268, fid=2097168, flags=0, lenfname=61, pfontname=0x8710dec "-adobe-avantgarde-demi-r-normal--50-*-2540-2540-p-*-iso8859-1\001\003") at dixfonts.c:471 #3 0x08074fc8 in ProcOpenFont (client=0x8699268) at dispatch.c:1297 #4 0x080733e1 in Dispatch () at dispatch.c:454 #5 0x0805a6f1 in main (argc=11, argv=0xbffff224, envp=0xbffff254) at main.c:440 #6 0x400c48ae in __libc_start_main () from /lib/libc.so.6 (gdb) quit -- snip -- Created attachment 201 [details] [review] Workaround (patch for 2004-04-15-trunk) The patch seems to work around the problem... ... but I have no clue why. Alan: Any ideas ? Somehow I feel the NUM_SEGMENTS() call is completely on drugs here: In xc/lib/font/include/bitmap.h |NUM_SEGMENTS()| is defined as -- snip -- /* number of encoding entries in one segment */ #define BITMAP_FONT_SEGMENT_SIZE 128 [snip] #define NUM_SEGMENTS(n) \ (((n)+BITMAP_FONT_SEGMENT_SIZE-1)/BITMAP_FONT_SEGMENT_SIZE) -- snip -- Adding a simple fprintf(stderr, ...) to print the size of the macro input and output like this: -- snip -- Index: xc/lib/font/bitmap/pcfread.c =================================================================== RCS file: /cvs/xorg/xc/lib/font/bitmap/pcfread.c,v retrieving revision 1.1.4.2.6.1 diff -u -r1.1.4.2.6.1 pcfread.c --- a/xc/lib/font/bitmap/pcfread.c 4 Mar 2004 17:47:10 -0000 1.1.4.2.6.1 +++ b/xc/lib/font/bitmap/pcfread.c 20 Apr 2004 04:59:22 -0000 @@ -896,8 +896,18 @@ nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) * (pFont->info.lastRow - pFont->info.firstRow + 1); +#if 1 + /* Workaround for http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=464 + * ("[Xorg/XPRINT] Xprt crashes when using PMF fonts") */ + encoding = (CharInfoPtr **) xcalloc(MAX(NUM_SEGMENTS(nencoding), 512+1), + sizeof(CharInfoPtr*)); + +fprintf(stderr, "pmf: 1=%ld, 2=%ld\n", (long)NUM_SEGMENTS(nencoding), (long)nencoding); +#else encoding = (CharInfoPtr **) xcalloc(NUM_SEGMENTS(nencoding), sizeof(CharInfoPtr*)); +#endif + if (!encoding) { pcfError("pmfReadFont(): Couldn't allocate encoding (%d*%d)\n", nencoding, sizeof(CharInfoPtr)); goto Bail; -- snip -- results in the following output: -- snip -- AUDIT: Tue Apr 20 05:52:29 2004: 16811 Xprt: client 1 connected from local host pmf: 1=2, 2=224 pmf: 1=2, 2=224 pmf: 1=2, 2=224 pmf: 1=2, 2=224 pmf: 1=2, 2=224 pmf: 1=2, 2=224 pmf: 1=2, 2=224 pmf: 1=2, 2=224 pmf: 1=2, 2=224 pmf: 1=2, 2=224 pmf: 1=2, 2=224 pmf: 1=2, 2=224 AUDIT: Tue Apr 20 05:52:31 2004: 16811 Xprt: client 1 disconnected -- snip -- ... no wonder this goes BOOOM! ... ;-( Created attachment 217 [details] [review] Patch for 2004-04-20-trunk The previous analysis was slighly wrong, it seems to be sufficient to remove the |encoding[i] = 0;| statement as it was done by keithp for the PCF copy of that code long ago for XF86... Patch checked-in... Checking in lib/font/bitmap/pcfread.c; /cvs/xorg/xc/lib/font/bitmap/pcfread.c,v <-- pcfread.c new revision: 1.1.4.2.6.1.6.1; previous revision: 1.1.4.2.6.1 done Mailing the commit message to xorg-commit@pdx.freedesktop.org... Mailing xorg-commit-diffs@freedesktop.org... Generating notification message... Generating notification message... done. ... marking bug as FIXED. |
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.