[cups.development] developing filter (crash on signal 11)

Michael Sweet msweet at apple.com
Tue Feb 19 08:29:17 PST 2013


Michael,

Try using gdb's "waitfor" command to debug the filter as it runs; you'll need to run gdb as root to debug the filter running from cupsd...

(alternately you can attach to the process ID, just add a sleep in your filter to give yourself time to attach...)


On 2013-02-13, at 10:20 PM, michael <mchmok at hotmail.com> wrote:

> Hi all
> I am developing a filter, and I have some troubles.
> Would someone please help?
> 
> The filter uses fwrite() to write print data to stdout, but it crashes occasionally.  The code is like this.
> 
>  fwrite( buff, 1, size, stdout );
> 
> I have checked the buff pointer, its content and the size, they are ok.
> I also added ferror() and fflush() to check on stdout before calling fwrite(), but it does not work.
> However it works fine, if I add many many debug messages before and after the fwrite such as
> 
> fprintf(stderr, "DEBUG: xxxxx\n");
> 
> Can someone please give me some hint?
> Is there another way to check stdout works properly before I use fwrite()?
> 
> Thanks in advance.
> Michael
> 
> 
> 
> _______________________________________________
> cups-dev mailing list
> cups-dev at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups-dev

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair





More information about the cups-devel mailing list