X under valgrind?

Jeremy Huddleston jeremyhu at apple.com
Sat Oct 30 12:58:51 PDT 2010


Nix, have you made any progress on this issue?

My guess is that we're running into a reference count issue.  This has apparently been an issue for quite some time, but it had been benign.  We commented out and eventually removed logging of the "fixed" reference count, but I don't think the underlying issue was ever discovered or corrected:

commit 1033eb03368701dc4a52f40a737341b2931ab986
Author: Ben Byer <bbyer at bbyer.apple.com>
Date:   Thu Dec 13 20:46:33 2007 -0800

    Silence FPE error message; according to ajax, this bug is known
    but not worth fixing.


Here's a patch to re-add the logging.  It would be interesting to see if it's getting hit.  Are you able to reproduce this 100% of the time?


diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index e22eabe..0f2cbec 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1648,6 +1648,9 @@ FreeFontPath(FontPathElementPtr *list, int n, Bool force)
 		    found++;
 	    }
 	    if (list[i]->refcount != found) {
+		ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n",
+		       list[i]->name_length, list[i]->name,
+		       list[i]->refcount, found);
 		list[i]->refcount = found; /* ensure it will get freed */
 	    }
 	}

On Oct 20, 2010, at 13:11, Nix wrote:

> I'm trying to track down a strange bug in X 1.9.0.901 (and probably .902
> as well), whereby after a suspend/resume cycle long enough to time out
> nonlocal TCP connections, my X server crashes the first time I map an
> XEmacs window (probably 'the first thing that uses core fonts at all')
> with this unhelpful backtrace:
> 
> Backtrace:
> 0: X (xorg_backtrace+0x28) [0x49b7d8]
> 1: X (0x400000+0x5dde9) [0x45dde9]
> 2: /lib/libpthread.so.0 (0x7f50fc27f000+0xe9b0) [0x7f50fc28d9b0]
> 3: /lib/libc.so.6 (0x7f50fb1f3000+0x731c0) [0x7f50fb2661c0]
> 4: /lib/libc.so.6 (cfree+0x6c) [0x7f50fb269abc]
> 5: /usr/lib/libXfont.so.1 (FontFileFreeEntry+0x8f) [0x7f50fbdf12ef]
> 6: /usr/lib/libXfont.so.1 (FontFileFreeTable+0x2e) [0x7f50fbdf136e]
> 7: /usr/lib/libXfont.so.1 (FontFileFreeDir+0xd) [0x7f50fbdf139d]
> 8: /usr/lib/libXfont.so.1 (FontFileFreeFPE+0x12) [0x7f50fbdf4692]
> 9: X (0x400000+0x2d04b) [0x42d04b]
> 10: X (0x400000+0x2fa8b) [0x42fa8b]
> 11: X (ProcessWorkQueue+0x21) [0x4307e1]
> 12: X (WaitForSomething+0x82) [0x456f72]
> 13: X (0x400000+0x2bf92) [0x42bf92]
> 14: X (0x400000+0x209ee) [0x4209ee]
> 15: /lib/libc.so.6 (__libc_start_main+0xfd) [0x7f50fb211d6d]
> 16: X (0x400000+0x205a9) [0x4205a9]
> Segmentation fault at address 0xffffffff0241b148
> 
> gdb is not much more helpful (I mean, yes, obviously we have a
> double-free(), but why? something to do with the font server I've got at
> the end of the font path specifically to trip bitrot like this, I
> suppose), so I'm planning to valgrind it... but I'm a bit chary of that
> because the last time I valground the X server, horrible disasters
> resulted which ended in a system lockup and massive filesystem
> corruption. Of course, that was before the era of KMS: perhaps things
> are better now that X hardly touches the hardware.
> 
> So... has anyone ever valground the X server? Does it work? (Of course
> it will be slow. I'm expecting *that*.)
> _______________________________________________
> xorg at lists.freedesktop.org: X.Org support
> Archives: http://lists.freedesktop.org/archives/xorg
> Info: http://lists.freedesktop.org/mailman/listinfo/xorg
> Your subscription address: jeremyhu at freedesktop.org



More information about the xorg-devel mailing list