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 311299 - Gnome-About halts / uses lots of memory after first person who "brought GNOME to you:"
Gnome-About halts / uses lots of memory after first person who "brought GNOME...
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.9.x
Other Linux
: Urgent critical
: ---
Assigned To: pango-maint
Desktop Maintainers
: 309908 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-07-22 20:20 UTC by Ali Akcaagac
Modified: 2005-07-29 19:46 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
Illustration (58.64 KB, image/png)
2005-07-22 20:22 UTC, Ali Akcaagac
  Details
Valgrind output! (56.11 KB, text/plain)
2005-07-23 12:46 UTC, Ali Akcaagac
  Details
GDB output! (1.14 KB, text/plain)
2005-07-23 12:47 UTC, Ali Akcaagac
  Details
Valgrind output! (90.49 KB, text/plain)
2005-07-23 15:19 UTC, Ali Akcaagac
  Details
GDB output! (9.91 KB, text/plain)
2005-07-23 15:19 UTC, Ali Akcaagac
  Details
This time crashes outside cairo-cache.c (12.53 KB, text/plain)
2005-07-26 23:40 UTC, Carlos Garnacho
  Details
Possible fix for Cairo (5.96 KB, patch)
2005-07-28 19:39 UTC, Owen Taylor
none Details | Review
backtrace (5.83 KB, text/plain)
2005-07-28 20:53 UTC, Carlos Garnacho
  Details
Valgrind output! (6.73 KB, text/plain)
2005-07-28 22:53 UTC, Ali Akcaagac
  Details

Description Ali Akcaagac 2005-07-22 20:20:05 UTC
There seem to be a bug (please refer to the screenshot) that only shows the very
first person and then doesn't do anything afterwards. Looks like the code needs
some review.
Comment 1 Ali Akcaagac 2005-07-22 20:22:27 UTC
Created attachment 49595 [details]
Illustration
Comment 2 Olav Vitters 2005-07-22 20:55:03 UTC
Confirmed. For me it hanged after the first name dissapeared. Started using lots
of memory. Wonder if this is really gnome-about or some lower-level issue (gtk+
/ pango).
Comment 3 Brent Smith (smitten) 2005-07-22 21:25:31 UTC
Here is the stack dump I got:  The dialog stops after displaying the first name
and then it took about 5-10 minutes before it crashed and bug buddy came up.

Backtrace was generated from '/opt/gnome2/bin/gnome-about'

Using host libthread_db library "/lib/tls/libthread_db.so.1".
`system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1224669504 (LWP 24589)]
0xffffe410 in __kernel_vsyscall ()
  • #0 __kernel_vsyscall
  • #1 __waitpid_nocancel
    from /lib/tls/libpthread.so.0
  • #2 libgnomeui_segv_handle
    at gnome-ui-init.c line 749
  • #3 <signal handler called>
  • #4 _cairo_surface_acquire_source_image
    at cairo-surface.c line 308
  • #5 _cairo_pattern_acquire_surface_for_surface
    at cairo-pattern.c line 1288
  • #6 _cairo_pattern_acquire_surface
    at cairo-pattern.c line 1397
  • #7 _cairo_pattern_acquire_surfaces
    at cairo-pattern.c line 1487
  • #8 _cairo_image_surface_composite
    at cairo-image-surface.c line 554
  • #9 _cairo_surface_composite
    at cairo-surface.c line 535
  • #10 _transform_glyph_bitmap
    at cairo-ft-font.c line 831
  • #11 _cairo_ft_unscaled_font_create_glyph
    at cairo-ft-font.c line 913
  • #12 _image_glyph_cache_create_entry
    at cairo-font.c line 1136
  • #13 _cairo_cache_lookup
    at cairo-cache.c line 447
  • #14 _cairo_ft_scaled_font_glyph_extents
    at cairo-ft-font.c line 1296
  • #15 _cairo_scaled_font_glyph_extents
    at cairo-font.c line 784
  • #16 cairo_scaled_font_glyph_extents
    at cairo-font.c line 1031
  • #17 compute_glyph_extents
    at pangocairo-fcfont.c line 189
  • #18 pango_cairo_fc_font_get_glyph_info
    at pangocairo-fcfont.c line 213
  • #19 pango_cairo_fc_font_get_glyph_extents
    at pangocairo-fcfont.c line 231
  • #20 pango_font_get_glyph_extents
    at fonts.c line 1190
  • #21 set_glyph
    at hangul-fc.c line 62
  • #22 render_basic
    at hangul-fc.c line 300
  • #23 hangul_engine_shape
    at hangul-fc.c line 367
  • #24 _pango_engine_shape_shape
    at pango-engine.c line 73
  • #25 pango_shape
    at shape.c line 47
  • #26 shape_run
    at pango-layout.c line 2685
  • #27 process_item
    at pango-layout.c line 2776
  • #28 process_line
    at pango-layout.c line 2961
  • #29 pango_layout_check_lines
    at pango-layout.c line 3258
  • #30 pango_layout_get_extents_internal
    at pango-layout.c line 2009
  • #31 pango_layout_get_extents
    at pango-layout.c line 2174
  • #32 pango_layout_get_pixel_size
    at pango-layout.c line 2261
  • #33 gnome_canvas_text_set_property
    at gnome-canvas-text.c line 1089
  • #34 IA__g_object_set_valist
    at gobject.c line 708
  • #35 gnome_canvas_item_set_valist
    at gnome-canvas.c line 562
  • #36 gnome_canvas_item_set
    at gnome-canvas.c line 543
  • #37 display_contributors
    at gnome-about.c line 203
  • #38 animate_contributor
    at gnome-about.c line 119
  • #39 g_timeout_dispatch
    at gmain.c line 3293
  • #40 g_main_dispatch
    at gmain.c line 1934
  • #41 IA__g_main_context_dispatch
    at gmain.c line 2484
  • #42 g_main_context_iterate
    at gmain.c line 2565
  • #43 IA__g_main_loop_run
    at gmain.c line 2769
  • #44 IA__gtk_main
    at gtkmain.c line 972
  • #45 main
    at gnome-about.c line 1229

Comment 4 Olav Vitters 2005-07-22 21:30:18 UTC
Most recent gnome-about commit was a patch 31 hours ago from bug 309384. I
reverted that patch, still crashed. Change before that is 2005-04-13. Note that
the memory usage only starts drastically increasing after 30sec - 1 minute.
Stacktrace also mentions cairo, pango.

Owen: Nasty bug confirmed by 3 persons.
Comment 5 Owen Taylor 2005-07-22 22:21:57 UTC
Cairo bug

2005-07-22  Owen Taylor  <otaylor@redhat.com>

        * src/cairo-ft-font.c: Protect against division by zero in various places.
        (http://bugzilla.gnome.org/show_bug.cgi?id=311299, reported by Ali Akcaagac)
Comment 6 Ali Akcaagac 2005-07-23 12:45:54 UTC
Owen, unfortunately your fix leads into a segfault after a short while. I
triggered it with valgrind and gdb and applied both logs as attachment here.
Maybe I am missing something but I doubt since I updated cairo, pango, gtk+ and
gnome-desktop today.
Comment 7 Ali Akcaagac 2005-07-23 12:46:33 UTC
Created attachment 49612 [details]
Valgrind output!
Comment 8 Ali Akcaagac 2005-07-23 12:47:02 UTC
Created attachment 49613 [details]
GDB output!
Comment 9 Ali Akcaagac 2005-07-23 15:18:26 UTC
I made 2 more attempts to catch even more info from gnome-about. This time I
recompiled several parts with "-O0 -g", kept the sources intact and ran valgrind
and gdb again.
Comment 10 Ali Akcaagac 2005-07-23 15:19:04 UTC
Created attachment 49618 [details]
Valgrind output!
Comment 11 Ali Akcaagac 2005-07-23 15:19:32 UTC
Created attachment 49619 [details]
GDB output!
Comment 12 Ali Akcaagac 2005-07-23 15:20:42 UTC
reopening bug!
Comment 13 Owen Taylor 2005-07-26 21:40:29 UTC
Can you try disabling out line 454-456 of cairo-cache.c:

#if 0
    if (cache->live_entries && cache->max_memory)
        _cairo_cache_shrink_to (cache, cache->max_memory);
#endif 

And see what the effect is on this bug? (That makes all the cairo
caches grow indefinitely ... not something you'd want to run 
with long term, but knowing whether it affects this bug would help
me trace it down.)

Comment 14 Carlos Garnacho 2005-07-26 22:51:45 UTC
it still keeps crashing for me... 
Comment 15 Owen Taylor 2005-07-26 23:13:07 UTC
What if you comment out the first lines in the cache_arrangements array in that
file:

#if 0
    { 16,               43,             41        },
    { 32,               73,             71        },
    { 64,               151,            149       },
    { 128,              283,            281       },
    { 256,              571,            569       },
    { 512,              1153,           1151      },
#endif

Does that make a difference?
Comment 16 Carlos Garnacho 2005-07-26 23:40:06 UTC
Created attachment 49814 [details]
This time crashes outside cairo-cache.c

hope that this helps :)
Comment 17 Owen Taylor 2005-07-28 19:39:47 UTC
Created attachment 49895 [details] [review]
Possible fix for Cairo
Comment 18 Owen Taylor 2005-07-28 20:22:44 UTC
I've committed the patch above with confirmation from Behdad that it
fixed his (quite similar) patch. Can you test with current Cairo CVS
to see if it fixes the gnome-about problem as well?

2005-07-28  Owen Taylor  <otaylor@redhat.com>

        * src/cairo-font.c src/cairo-ft-font.c src/cairo-win32-font.c
        src/cairoint.h: Move the font options into the base
        cairo_scaled_font_t object so that we have them available
        to use when we are removing a scaled font from the cache.
        (http://bugzilla.gnome.org/show_bug.cgi?id=#311299,
        Ali Akcaagac, Behdad Esfahbod)

Comment 19 Carlos Garnacho 2005-07-28 20:51:57 UTC
hmmm, maybe it's unrelated (guess not), but after lots of time of mad-clicking
(much more than what it took me yesterday to make it crash) I got an X error:

Gdk-ERROR **: The program 'gnome-about' received an X Window System error.
This probably reflects a bug in the program.
The error was 'RenderBadGlyphSet (invalid GlyphSet parameter)'.
  (Details: serial 1349707 error_code 186 request_code 159 minor_code 22)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
aborting...


followed the break and --sync advices, and after a random time I got the
backtrace I'm going to attach
Comment 20 Carlos Garnacho 2005-07-28 20:53:20 UTC
Created attachment 49901 [details]
backtrace

should I reopen?
Comment 21 Ali Akcaagac 2005-07-28 21:01:00 UTC
Hmmm, I was just up to comment that everything works for me now and then saw
that Carlos commented on it again.

I must say that I don't get any errors and crashes anymore. Even without the
patch above I didn't get any errors anymore but then I was also updating

fontconfig, glitz, libpixman, cairo, pango, glib, gtk+ today again. When I last
commented on it I of course updated the above modules too (from CVS head) so in
the meanwhile something must have been changed. I also applied Owen's patch
above and everything still works rock stable. Also made the mouse click madness
here by pressing on the mouse during the gnome-about scroller and everything
seems to be working fairly well.

So from my side the stuff (as of now) seems to be working properly.
Comment 22 Owen Taylor 2005-07-28 21:53:19 UTC
Carlos: I think your crash is unrelated. Would you mind filing it 
in bugzilla.freedesktop.org against Cairo (Cc me explicitely).

I also have a guess as to its cause - could you try adding:

    glyphset_cache_t *cache = abstract_cache;
    glyphset_cache_entry_t *entry = abstract_entry;

+   if (entry->glyph) {
    _cairo_unscaled_font_destroy (entry->key.unscaled);
    XRenderFreeGlyphs (cache->display, entry->glyphset,
                       &(entry->glyph), 1);
+   }
    free (entry);

To cairo-xlib-surface.c:xlib_glyphset_cache_destroy_entry()
and see if that fixes your problem?
Comment 23 Behdad Esfahbod 2005-07-28 21:56:31 UTC
Just for the record, I didn't have any crash or CPU usage problem, but found the
same problem exists by using a memory-checker tool, valgrind's memcheck in this
case.  So, if it doesn't crash doesn't really mean the problem is fixed :)
Comment 24 Ali Akcaagac 2005-07-28 22:53:41 UTC
Created attachment 49906 [details]
Valgrind output!

I let that stuff running for nearly one hour with Valgrind now, here the log in
case it may help!
Comment 25 Owen Taylor 2005-07-28 23:36:34 UTC
If it was crashing reliably before, and doesn't crash at all now, that sounds
like a fix to me. (The valgrind log looks clean as well)
Comment 26 Behdad Esfahbod 2005-07-29 01:48:33 UTC
Cool.  Ali, you may want to fix the leaks though.
Comment 27 Sebastien Bacher 2005-07-29 11:54:54 UTC
*** Bug 309908 has been marked as a duplicate of this bug. ***
Comment 28 Owen Taylor 2005-07-29 19:46:58 UTC
Carlos: it turns out that I actually *didn't* commit the changes to cairo;
so if you were testing without applying the patch explicitely, you weren't
testing the patch.