[cups.bugs] [CRIT] STR #3816: ppdOpenFile crash on ubuntu 10.10

wenlong.feng wenlong.feng at gmail.com
Fri Mar 18 08:49:50 PDT 2011


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

source code:
#include <stdio.h>
#include <cups/cups.h>
#include <cups/ppd.h>
#include <pthread.h>
static pthread_mutex_t ppd_mutex = {0,0,0};
static void init_ppd(void* printer_name)
{
 pthread_mutex_lock(&ppd_mutex);
 const char* pfilename = cupsGetPPD((char*)printer_name);
 ppd_file_t * ppdfile = ppdOpenFile(pfilename);
 printf("%s : %lld\n", (char*)printer_name, ppdfile);
 unlink(pfilename);
 pthread_mutex_unlock(&ppd_mutex);
 ppdClose(ppdfile);
}

ppd_file_t* pf[100];

int main()
{
 cups_dest_t* dests;
 int count = cupsGetDests( &dests);
 int i=0,j=0,k=0;
 pthread_t initThreads[100];
 for(j=0; j<2; j++)
 {
  for(i=0; i<count; i++)
  {
   pthread_create(&initThreads[j*20+i], NULL, init_ppd, (void*)
dests[i].name);
  }
 }
 sleep(10);
 printf("exit well\n");
}
cups version:
 dpkg -la | grep cups
ii  bluez-cups                              4.69-0ubuntu2                 
                            Bluetooth printer driver for CUPS
ii  cups                                    1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - server
ii  cups-bsd                                1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - BSD commands
ii  cups-client                             1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - client
programs (SysV)
ii  cups-common                             1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - common files
ii  cups-driver-gutenprint                  5.2.6-0ubuntu8                
                            printer drivers for CUPS
ii  cups-ppdc                               1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - PPD
manipulation utilities
ii  ghostscript-cups                        8.71.dfsg.2-0ubuntu7          
                            The GPL Ghostscript PostScript/PDF interpreter
- CUPS filters
ii  hplip-cups                              3.10.6-1ubuntu10.2            
                            HP Linux Printing and Imaging - CUPS Raster
driver (hpcups)
ii  libcups2                                1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - Core library
ii  libcupscgi1                             1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - CGI library
ii  libcupsdriver1                          1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - Driver
library
ii  libcupsimage2                           1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - Raster image
library
ii  libcupsmime1                            1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - MIME library
ii  libcupsppdc1                            1.4.4-6ubuntu2.3              
                            Common UNIX Printing System(tm) - PPD
manipulation library
ii  libgnomecups1.0-1                       0.2.3-3build2                 
                            GNOME library for CUPS interaction
ii  python-cups                             1.9.51-0ubuntu2               
                            Python bindings for CUPS
ii  python-cupshelpers                      1.2.3+20100723-0ubuntu8.1     
                            

crash stack
#0 0xb7e8b83e in ?? () from /lib/libc.so.6
#1 0xb7e8da85 in ?? () from /lib/libc.so.6
#2 0xb7e8ffc4 in malloc () from /lib/libc.so.6
#3 0xb7fa7fa6 in ?? () from /usr/lib/libcups.so.2
#4 0xb7fa8878 in ppdOpen2 () from /usr/lib/libcups.so.2
#5 0xb7fabd42 in ppdOpenFile () from /usr/lib/libcups.so.2
#6 0x080487df in init_ppd ()
#7 0xb7e09cc9 in start_thread () from /lib/libpthread.so.0
#8 0xb7eef69e in clone () from /lib/libc.so.6

Link: http://www.cups.org/str.php?L3816
Version: 1.4.4
Attachment: http://www.cups.org/strfiles/3816/cups.tgz





More information about the cups mailing list