RE: Random crashes when printing on OS X





I am now also getting this when I print, after having added a cairo_clip() to bound my drawings into a (0,0),(1,1) region. But I do not get it when I am displaying to screen, only printing, and I use the same function for both, one simply gets the cairo_t from the drawing area, the other retrieves it from the printer.

Any ideas?

Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFont: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFontSize: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetTextMatrix: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextClearRect: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetRGBFillColor: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextShowGlyphsAtPoint: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFont: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFontSize: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetTextMatrix: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextClearRect: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetRGBFillColor: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextShowGlyphsAtPoint: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFont: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFontSize: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetTextMatrix: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextClearRect: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetRGBFillColor: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextShowGlyphsAtPoint: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFont: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFontSize: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetTextMatrix: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextClearRect: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetRGBFillColor: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextShowGlyphsAtPoint: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFont: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFontSize: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetTextMatrix: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextClearRect: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetRGBFillColor: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextShowGlyphsAtPoint: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFont: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFontSize: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetTextMatrix: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextClearRect: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetRGBFillColor: invalid context 0x0
Thu Feb  4 17:04:16 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextShowGlyphsAtPoint: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFont: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFontSize: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetTextMatrix: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextClearRect: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetRGBFillColor: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextShowGlyphsAtPoint: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFont: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFontSize: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetTextMatrix: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextClearRect: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetRGBFillColor: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextShowGlyphsAtPoint: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFont: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetFontSize: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetTextMatrix: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextClearRect: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextSetRGBFillColor: invalid context 0x0
Thu Feb  4 17:04:18 Shawn-Bakhtiars-iMac.local orderdesk[39199] <Error>: CGContextShowGlyphsAtPoint: invalid context 0x0




From: shashaness hotmail com
To: gtk-app-devel-list gnome org; gtk-devel-list gnome org; gtk-osx-users lists sourceforge net
Subject: Random crashes when printing on OS X
Date: Thu, 4 Feb 2010 18:44:10 -0500



I am using the GtkPrint* functions to print. However at what seems to be random occurrences the application crashes with the following error:

Gdk:ERROR:gdkeventloop-quartz.c:559:select_thread_collect_poll: assertion failed: (ufds[i].fd == current_pollfds[i].fd)
Abort trap
 

When the user clicks on the print button a signal is generated and the application comand function executes based on the following case statement:


...

    case ISI_PERM_MENU_COMPONENT_FORMULA_PRINT:

                if( isi_app_check_permission(prev_self, ISI_PERM_MENU_COMPONENT_FORMULA_PRINT) && prev_self->component != NULL){

                    isi_display_page_setup( prev_self->display, prev_self->component,FALSE);
                    isi_display_print(prev_self->display);

                } else {

                    isi_user_message(NULL,"Not Allowed","You do not have permission to print formulas.",0);
                }

            break;

...


void isi_display_print(IsiDisplay *self){

  
    GtkPrintOperation *print = NULL;
    GtkPrintSettings *printer_settings = NULL;
    GtkPageSetup *page_setup = NULL;
    GtkPaperSize *paper_size = NULL;
    guint ctype;

    /* Sanity Check */
    g_return_if_fail(self != NULL);
    g_return_if_fail(ISI_IS_DISPLAY(self) != FALSE);
    g_return_if_fail(self->priv != NULL);
    g_return_if_fail(self->priv->dispose_has_run != TRUE);

    /* Create a new print operation */
    print = gtk_print_operation_new();
   
    /* Create new page setup and paper size */
    page_setup = gtk_page_setup_new();
    paper_size = gtk_paper_size_new(GTK_PAPER_NAME_LETTER);
    gtk_page_setup_set_paper_size(page_setup,paper_size);

    /* Set the default to the new page setup */
    gtk_print_operation_set_default_page_setup(print,page_setup);
   
   
    /* Make sure we always do full page printing*/
    gtk_print_operation_set_unit(print,GTK_UNIT_INCH);
    gtk_print_operation_set_use_full_page(print,TRUE);
    gtk_print_operation_set_n_pages (print, self->priv->page_count);

    g_signal_connect(print, "draw-page", G_CALLBACK(isi_display_print_event),(gpointer)self);
   
   
   
    /* SOMEWHERE IN THIS FUNCTION THE DIALOG BLOWS UP!! */
    gtk_print_operation_run(print,GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,NULL,NULL);


return;}


Any help would be greatly appreciated.

The problem is pervasive will most printer types, but is exacerbated with the HP CP3525 Color Laserjet printer.
Shawn






i'm EMAILING FOR THE GREATER GOOD
Join me


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]