After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 330907 - Critical warning when printing text with libgnomeprint
Critical warning when printing text with libgnomeprint
Status: RESOLVED FIXED
Product: gnome-print
Classification: Deprecated
Component: general
CVS
Other All
: Urgent major
: ---
Assigned To: Jody Goldberg
Jody Goldberg
: 335859 348763 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-02-12 17:59 UTC by Paolo Maggi
Modified: 2006-11-07 22:28 UTC
See Also:
GNOME target: 2.14.x
GNOME version: 2.13/2.14


Attachments
patch used for the Ubuntu dapper package (994 bytes, patch)
2006-05-14 22:28 UTC, Sebastien Bacher
none Details | Review

Description Paolo Maggi 2006-02-12 17:59:13 UTC
Steps to reproduce:
Printing with gedit a lot of critical warnings are produced:

(gedit:30988): GnomePrint-CRITICAL **: gnome_rfont_get_glyph_stdadvance:
assertion `glyph < GRF_NUM_GLYPHS (rfont)' failed

(gedit:30988): GnomePrint-CRITICAL **: gnome_rfont_get_glyph_stdbbox: assertion
`glyph < GRF_NUM_GLYPHS (rfont)' failed

(gedit:30988): GnomePrint-CRITICAL **: gnome_rfont_render_glyph_rgb8: assertion
`glyph < GRF_NUM_GLYPHS (rfont)' failed

[snip]

This is not due to gedit or gtksourceview since I get the same warnings using
the "pango" test program in libgnomeprint/tests.

Stack trace:

Here a stacktrace I got using G_DEBUG=fatal_criticals and the "pango" test program:

  • #0 IA__g_logv
    at gmessages.c line 503
  • #1 IA__g_log
    at gmessages.c line 517
  • #2 IA__g_return_if_fail_warning
  • #3 gnome_rfont_get_glyph_stdadvance
    at gnome-rfont.c line 597
  • #4 gnome_pgl_from_gl
    at gnome-pgl.c line 191
  • #5 gnome_print_ps2_glyphlist
    at gnome-print-ps2.c line 497
  • #6 gnome_print_glyphlist_transform_real
    at gnome-print.c line 387
  • #7 glyphlist_impl
    at gnome-print-filter.c line 576
  • #8 glyphlist_impl
    at gnome-print-filter-frgba.c line 229
  • #9 gnome_print_filter_glyphlist
    at gnome-print-filter.c line 1402
  • #10 glyphlist_impl
    at gnome-print-filter.c line 565
  • #11 gnome_print_filter_glyphlist
    at gnome-print-filter.c line 1402
  • #12 gnome_print_glyphlist_transform
    at gnome-print.c line 661
  • #13 gpm_render
    at gnome-print-meta.c line 689
  • #14 gnome_print_meta_render_data_page
    at gnome-print-meta.c line 899
  • #15 gnome_print_meta_render_page
    at gnome-print-meta.c line 833
  • #16 gnome_print_job_print
    at gnome-print-job.c line 695
  • #17 main
    at pango.c line 125


Let me know if you need more info.


Other information:
Comment 1 Paolo Maggi 2006-02-12 18:13:03 UTC
Note that this unfortunately causes crashes for testers given the new policy of enabling fatal-criticals by default
Comment 2 Paolo Maggi 2006-02-22 16:25:24 UTC
This is clearly a blocker for gedit and all the apps using gnome-print to print text.
Comment 3 Behdad Esfahbod 2006-02-28 00:30:54 UTC
Copying from bug #332552.  See that bug for the details of why this patch is needed.

Hum.. In print preview, a bunch of g_return_if_fail (glyph < ...) are making
sure the tab character is not rendered:

  (gedit:21872): GnomePrint-CRITICAL **: gnome_rfont_get_glyph_stdadvance:
assertion `glyph < GRF_NUM_GLYPHS (rfont)' failed

the glyph id that fails the assertion is the new value for an empty glyph... 
Don't know why it's not doing the same for the actually print to PDF.

Lets see if it works: attachment #60192 [details].
Comment 4 Kjartan Maraas 2006-03-14 17:22:07 UTC
Lowering pri on this since critical warning crashers shouldn't be blockers.
Comment 5 Behdad Esfahbod 2006-05-01 14:53:28 UTC
*** Bug 335859 has been marked as a duplicate of this bug. ***
Comment 6 Paolo Maggi 2006-05-01 16:12:16 UTC
behdad: I have just tested your patch, it does _not_ fix the warnings.
I also does not fix bug #335759. Any idea?
Comment 7 Egmont Koblinger 2006-05-02 11:19:46 UTC
Please also take a look at bug #334011, I guess that one is closely related
to this bug (well, at least the critical warning is the same).
Comment 8 Sebastien Bacher 2006-05-14 22:28:49 UTC
Created attachment 65465 [details] [review]
patch used for the Ubuntu dapper package

I've used that patch for the dapper package, that's the same as the previous one with the #ifdef moved after the #define so it actually does try if the value is defined by pango
Comment 9 Behdad Esfahbod 2006-05-14 23:32:58 UTC
Ah, right.
Comment 10 Egmont Koblinger 2006-05-15 14:17:38 UTC
For me, the first patch doesn't fix bug #335859 (closed as a dup of this),
but the recent patch fixes it. Thanks Sebastien!
Comment 11 Kjartan Maraas 2006-08-15 10:17:36 UTC
Commiting this after checking with behdad.
Comment 12 Paolo Maggi 2006-08-21 17:47:53 UTC
*** Bug 348763 has been marked as a duplicate of this bug. ***
Comment 13 Roozbeh Pournader 2006-11-02 16:15:14 UTC
Some version of this bug appears to still be present (with ZWNJ, but not tab). Investigating.
Comment 14 Roozbeh Pournader 2006-11-03 14:12:04 UTC
OK. Another similar case exists in the libgnomeprint function gnome_rfont_get_glyph_stdadvance, triggered by the character U+200C ZERO-WIDTH NON-JOINER. The effect is the same (critical warnings on terminal when printing). The source is also the same: PANGO_GLYPH_EMPTY.
Comment 15 Behdad Esfahbod 2006-11-07 20:37:43 UTC
Roozbeh, so you see boxes too?
Comment 16 Behdad Esfahbod 2006-11-07 20:59:25 UTC
Roozbeh, I'm sure this bug is properly fixed.  You probably are testing with an old libgnomeprint22.   For example, in FC5 and FC6, it's 2.12.1 that is shipped.  The patch was committed on 2006-08-15.  I filed this bug about that:

  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214493
Comment 17 Behdad Esfahbod 2006-11-07 22:28:52 UTC
Well, there still remains the problem that you get those warnings and boxes when Pango tries to render a hexbox.  libgnomeprint should use the pangoft2 fontmaps that don't support hexboxes, not whatever fontmap Gtk+ is using, but that will cause leaks currently, and since cairo+gtk+ is replacing the printing subsystem, I won't bother.

FWIW, libgnomeprint's pango backend should be ported to PangoRenderer.  Again, not worth the time.