error in xorg_backtrace

Alan Zheng machinecat1666 at
Thu Sep 17 01:28:11 PDT 2009

Hi all:

I am compiling the xorg-server-, but I got a compiling error for
below function.

The error message is:* undefined reference to `dladdr**' *

void xorg_backtrace(void)
    void *array[64];
    char *mod;
    int size, i;
    Dl_info info;
    size = backtrace(array, 64);
    for (i = 0; i < size; i++) {
        dladdr(array[i], &info);
        mod = (info.dli_fname && *info.dli_fname) ? info.dli_fname :
        if (info.dli_saddr)
            ErrorF("%d: %s (%s+0x%lx) [%p]\n", i, mod,
                   info.dli_sname, array[i] - info.dli_saddr, array[i]);
            ErrorF("%d: %s (%p+0x%lx) [%p]\n", i, mod,
                   info.dli_fbase, array[i] - info.dli_fbase, array[i]);

So I have to temp fix this function with xorg-server-1.6.3 coding likes

void xorg_backtrace(void)
    void *array[32]; /* deeper nesting than this means something's wrong */
    size_t size, i;
    char **strings;
    size = backtrace(array, 32);
    strings = backtrace_symbols(array, size);
    for (i = 0; i < size; i++)
        ErrorF("%d: %s\n", i, strings[i]);

Did anyone know it's my config issue or it's the xorg-server-
coding issue?

Thanks & Regards

Refer to:

Best Regards

Alan Zheng
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the xorg-devel mailing list