GNOME Bugzilla – Bug 311299
Gnome-About halts / uses lots of memory after first person who "brought GNOME to you:"
Last modified: 2005-07-29 19:46:58 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.
Created attachment 49595 [details] Illustration
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).
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 ()
+ Trace 61953
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.
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)
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.
Created attachment 49612 [details] Valgrind output!
Created attachment 49613 [details] GDB output!
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.
Created attachment 49618 [details] Valgrind output!
Created attachment 49619 [details] GDB output!
reopening bug!
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.)
it still keeps crashing for me...
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?
Created attachment 49814 [details] This time crashes outside cairo-cache.c hope that this helps :)
Created attachment 49895 [details] [review] Possible fix for Cairo
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)
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
Created attachment 49901 [details] backtrace should I reopen?
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.
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?
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 :)
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!
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)
Cool. Ali, you may want to fix the leaks though.
*** Bug 309908 has been marked as a duplicate of this bug. ***
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.