Julien Cristau <[email protected]> (30/12/2011):
> If dladdr returns 0, don't go and use the returned Dl_info, it may
> contain garbage.
> 
> X.Org bug#44315 <https://bugs.freedesktop.org/show_bug.cgi?id=44315>
> 
> Reported-and-tested-by: Cyril Brulebois <[email protected]>
> Signed-off-by: Julien Cristau <[email protected]>
> ---
>  os/backtrace.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/os/backtrace.c b/os/backtrace.c
> index 58b4b1f..298bf18 100644
> --- a/os/backtrace.c
> +++ b/os/backtrace.c
> @@ -46,7 +46,11 @@ void xorg_backtrace(void)
>      ErrorF("\nBacktrace:\n");
>      size = backtrace(array, 64);
>      for (i = 0; i < size; i++) {
> -     dladdr(array[i], &info);
> +     int rc = dladdr(array[i], &info);
> +     if (rc == 0) {
> +         ErrorF("%d: ?? [%p]\n", i, array[i]);
> +         continue;
> +     }
>       mod = (info.dli_fname && *info.dli_fname) ? info.dli_fname : "(vdso)";
>       if (info.dli_saddr)
>           ErrorF("%d: %s (%s+0x%lx) [%p]\n", i, mod,
> -- 

Reviewed-by: Cyril Brulebois <[email protected]>

I'll probably propose that commit along with the ia64 build fix for a
pull later today.

Mraw,
KiBi.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to