Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Xorg versus -current



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Feb 7, 2008, at 22:08, Magnus Henoch wrote:

Magnus Henoch <mange%freemail.hu@localhost> writes:

                retaddr = __builtin_return_address(0); /* __GNUC__ only */

After noticing that gcc treats __builtin_return_adress(0) different from
__builtin_return_adress(N), I tried this patch:

--- rtld.c      7 Dec 2007 20:34:05 -0000       1.117
+++ rtld.c      8 Feb 2008 03:04:06 -0000
@@ -801,6 +801,12 @@
        return(NULL);
 }

+static void *
+hackish_return_address(void)
+{
+       return __builtin_return_address(1);
+}
+
 __strong_alias(__dlsym,dlsym)
 void *
 dlsym(void *handle, const char *name)
@@ -820,7 +828,8 @@
        case (intptr_t)RTLD_NEXT:
        case (intptr_t)RTLD_DEFAULT:
        case (intptr_t)RTLD_SELF:
-               retaddr = __builtin_return_address(0); /* __GNUC__ only */
+               /* retaddr = __builtin_return_address(0);*/ /* __GNUC__ only */
+               retaddr = hackish_return_address();
                if ((obj = _rtld_obj_from_addr(retaddr)) == NULL) {
                        _rtld_error("Cannot determine caller's shared object");
                        return NULL;


And indeed, X.org no longer crashes, but works just like it did before.
("Before" is some time before the jemalloc merge, but seemingly
unrelated, as all of this is still with jemalloc disabled.)

Confirmed, works here as well.

have fun
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQEVAwUBR7CI/spnzkX8Yg2nAQICtgf9ENTI+DvEHhd8Qv99bI/Usdi5npcbVbtj
+vXjRQsEOJJipPgYteYeJ6Rtr5YXrEMzBBNyFGgF/T4L6/qwLlG9U08A0aYpLFfS
MZ6coRkrPUtgESp0Ohh+dZFbmO4ODfY7Q49c/haLwV8UoSnzHW/RBKmaKxyXNWVG
DlwGDHAkmqVJVDPuItEcEfemvuZE7zDKhXVsNpH3gTpmvR0beGqkduNPFiNj4kEm
0/2wU8WOwJ6WNCMEr9AKWPrGUaLmC0ncsxKbX63LYMXsfivzD++b3vyXd2zH3KLi
alHTyY6ai3yX6rB/zU4y5PsbX9ZgHArhnn7C+CtsMssCq28jJENuxQ==
=eSrj
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index