You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Once I corrected the errors in your sample code (updated version attached) I tried the program and was unable to reproduce your crash on CUPS trunk with the supplied PPDs (which all fail cupstestppd, BTW...)
This STR has not been updated by the submitter for two or more weeks and has been closed as required by the CUPS Configuration Management Plan. If the issue still requires resolution, please re-submit a new STR.
Version: 1.4.4
CUPS.org User: fwlx
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
The text was updated successfully, but these errors were encountered: