Re: [PATCH v2] backtrace.c: Fix word cast to a pointer
Hello again, On 23/01/15 19:21, Keith Packard wrote: Vicente Olivert Riera vincent.ri...@imgtec.com writes: Making the cast to a pointer-sized integer, and then to a pointer fixes the problem. Reviewed-by: Keith Packard kei...@keithp.com why this patch (which has already received a reviewed-by) is taking so long to be applied upstream? http://lists.x.org/archives/xorg-devel/2015-January/045226.html Regards, -Vincent ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH v2] backtrace.c: Fix word cast to a pointer
Hello, On 01/23/2015 06:21 PM, Keith Packard wrote: Vicente Olivert Riera vincent.ri...@imgtec.com writes: Making the cast to a pointer-sized integer, and then to a pointer fixes the problem. Reviewed-by: Keith Packard kei...@keithp.com Sorry, I made the ping replying to the wrong email. This one contains the reviewed-by from Keith, and the updated patch can be found here: http://lists.x.org/archives/xorg-devel/2015-January/045226.html Regards, -- Vicente Olivert Riera Graduate Software Engineer, MIPS Platforms Imagination Technologies Limited t: +44 (0)113 2429814 www.imgtec.com ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] backtrace.c: Fix word cast to a pointer
Hello, On 01/08/2015 10:36 PM, Keith Packard wrote: Vicente Olivert Riera vincent.ri...@imgtec.com writes: Making the cast to a pointer-sized integer, and then to a pointer fixes the problem. -if (dladdr((void *)(pip.start_ip + off), dlinfo) dlinfo.dli_fname +if (dladdr((void *)(long)(pip.start_ip + off), dlinfo) dlinfo.dli_fname I'd suggest using uintptr_t instead of long if you want a pointer-sized integer. out of curiosity. Why is taking so long for this patch to be applied upstream? Regards, -- Vicente Olivert Riera Graduate Software Engineer, MIPS Platforms Imagination Technologies Limited t: +44 (0)113 2429814 www.imgtec.com ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH v2] backtrace.c: Fix word cast to a pointer
backtrace.c uses a word size provided by libunwind. In some architectures like MIPS, libunwind makes that word size 64-bit for all variants of the architecture. In the lines #90 and #98, backtrace.c tries to do a cast to a pointer, which fails in all MIPS variants with 32-bit pointers, like MIPS32 or MIPS64 n32, because it's trying to do a cast from a 64-bit wide variable to a 32-bit pointer: Making all in os make[2]: Entering directory `/home/test/test/1/output/build/xserver_xorg-server-1.15.1/os' CC WaitFor.lo CC access.lo CC auth.lo CC backtrace.lo backtrace.c: In function 'xorg_backtrace': backtrace.c:90:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] if (dladdr((void *)(pip.start_ip + off), dlinfo) dlinfo.dli_fname ^ backtrace.c:98:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (void *)(pip.start_ip + off)); ^ cc1: some warnings being treated as errors make[2]: *** [backtrace.lo] Error 1 make[2]: *** Waiting for unfinished jobs Making the cast to a pointer-sized integer, and then to a pointer fixes the problem. Related: https://bugs.freedesktop.org/show_bug.cgi?id=79939 Signed-off-by: Vicente Olivert Riera vincent.ri...@imgtec.com --- Changes v1 - v2: replace long with uintptr_t os/backtrace.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/os/backtrace.c b/os/backtrace.c index 3d1195b..fd129ef 100644 --- a/os/backtrace.c +++ b/os/backtrace.c @@ -87,7 +87,7 @@ xorg_backtrace(void) procname[1] = 0; } -if (dladdr((void *)(pip.start_ip + off), dlinfo) dlinfo.dli_fname +if (dladdr((void *)(uintptr_t)(pip.start_ip + off), dlinfo) dlinfo.dli_fname *dlinfo.dli_fname) filename = dlinfo.dli_fname; else @@ -95,7 +95,7 @@ xorg_backtrace(void) ErrorFSigSafe(%u: %s (%s%s+0x%x) [%p]\n, i++, filename, procname, ret == -UNW_ENOMEM ? ... : , (int)off, -(void *)(pip.start_ip + off)); +(void *)(uintptr_t)(pip.start_ip + off)); ret = unw_step(cursor); if (ret 0) -- 1.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] backtrace.c: Fix word cast to a pointer
backtrace.c uses a word size provided by libunwind. In some architectures like MIPS, libunwind makes that word size 64-bit for all variants of the architecture. In the lines #90 and #98, backtrace.c tries to do a cast to a pointer, which fails in all MIPS variants with 32-bit pointers, like MIPS32 or MIPS64 n32, because it's trying to do a cast from a 64-bit wide variable to a 32-bit pointer: Making all in os make[2]: Entering directory `/home/test/test/1/output/build/xserver_xorg-server-1.15.1/os' CC WaitFor.lo CC access.lo CC auth.lo CC backtrace.lo backtrace.c: In function 'xorg_backtrace': backtrace.c:90:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] if (dladdr((void *)(pip.start_ip + off), dlinfo) dlinfo.dli_fname ^ backtrace.c:98:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (void *)(pip.start_ip + off)); ^ cc1: some warnings being treated as errors make[2]: *** [backtrace.lo] Error 1 make[2]: *** Waiting for unfinished jobs Making the cast to a pointer-sized integer, and then to a pointer fixes the problem. Related: https://bugs.freedesktop.org/show_bug.cgi?id=79939 Signed-off-by: Vicente Olivert Riera vincent.ri...@imgtec.com --- os/backtrace.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/os/backtrace.c b/os/backtrace.c index 3d1195b..3c101ae 100644 --- a/os/backtrace.c +++ b/os/backtrace.c @@ -87,7 +87,7 @@ xorg_backtrace(void) procname[1] = 0; } -if (dladdr((void *)(pip.start_ip + off), dlinfo) dlinfo.dli_fname +if (dladdr((void *)(long)(pip.start_ip + off), dlinfo) dlinfo.dli_fname *dlinfo.dli_fname) filename = dlinfo.dli_fname; else @@ -95,7 +95,7 @@ xorg_backtrace(void) ErrorFSigSafe(%u: %s (%s%s+0x%x) [%p]\n, i++, filename, procname, ret == -UNW_ENOMEM ? ... : , (int)off, -(void *)(pip.start_ip + off)); +(void *)(long)(pip.start_ip + off)); ret = unw_step(cursor); if (ret 0) -- 1.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] backtrace.c: Fix word cast to a pointer
backtrace.c uses a word size provided by libunwind. In some architectures like MIPS, libunwind makes that word size 64-bit for all variants of the architecture. In the lines #90 and #98, backtrace.c tries to do a cast to a pointer, which fails in all MIPS variants with 32-bit pointers, like MIPS32 or MIPS64 n32, because it's trying to do a cast from a 64-bit wide variable to a 32-bit pointer: Making all in os make[2]: Entering directory `/home/test/test/1/output/build/xserver_xorg-server-1.15.1/os' CC WaitFor.lo CC access.lo CC auth.lo CC backtrace.lo backtrace.c: In function 'xorg_backtrace': backtrace.c:90:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] if (dladdr((void *)(pip.start_ip + off), dlinfo) dlinfo.dli_fname ^ backtrace.c:98:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (void *)(pip.start_ip + off)); ^ cc1: some warnings being treated as errors make[2]: *** [backtrace.lo] Error 1 make[2]: *** Waiting for unfinished jobs Making the cast to a pointer-sized integer, and then to a pointer fixes the problem. Related: https://bugs.freedesktop.org/show_bug.cgi?id=79939 Signed-off-by: Vicente Olivert Riera vincent.ri...@imgtec.com --- os/backtrace.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/os/backtrace.c b/os/backtrace.c index 3d1195b..3c101ae 100644 --- a/os/backtrace.c +++ b/os/backtrace.c @@ -87,7 +87,7 @@ xorg_backtrace(void) procname[1] = 0; } -if (dladdr((void *)(pip.start_ip + off), dlinfo) dlinfo.dli_fname +if (dladdr((void *)(long)(pip.start_ip + off), dlinfo) dlinfo.dli_fname *dlinfo.dli_fname) filename = dlinfo.dli_fname; else @@ -95,7 +95,7 @@ xorg_backtrace(void) ErrorFSigSafe(%u: %s (%s%s+0x%x) [%p]\n, i++, filename, procname, ret == -UNW_ENOMEM ? ... : , (int)off, -(void *)(pip.start_ip + off)); +(void *)(long)(pip.start_ip + off)); ret = unw_step(cursor); if (ret 0) -- 1.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: xorg-server : fails to compile for MIPS64 n32
Hello, could some Xorg developer have a look to this patch? (is at the bottom of this email) That patch has been attached to the following bug report: https://bugs.freedesktop.org/show_bug.cgi?id=79939 Please CC me in the replies because I'm not subscribed to the list. Thanks. -- Vicente Olivert Riera Graduate Software Engineer, MIPS Platforms Imagination Technologies Limited t: +44 (0)113 2429814 www.imgtec.com On 12/04/2014 09:09 PM, Peter Hutterer wrote: On Thu, Dec 04, 2014 at 12:36:32PM +, Vicente Olivert Riera wrote: On 12/04/2014 12:09 AM, Peter Hutterer wrote: On Wed, Dec 03, 2014 at 12:05:57PM +, Vicente Olivert Riera wrote: Dear Peter Hutterer, could you please have a look to this bug report: https://bugs.freedesktop.org/show_bug.cgi?id=79939 please send the patch to xorg-devel where it will (hopefully) get some review Do the Xorg developers do not care about the bug reports? development is done via the mailing list, if you already have a patch the chances that someone reviews it when it lands on the list are higher than 'hidden' away in some bugreport. Cheers, Peter From cead7d51f3e014e04ae6e2f7c6ca332df5415b71 Mon Sep 17 00:00:00 2001 From: Vicente Olivert Riera vincent.ri...@imgtec.com Date: Wed, 3 Dec 2014 11:34:47 + Subject: [PATCH] backtrace.c: Fix word cast to a pointer backtrace.c uses a word size provided by libunwind. In some architectures like MIPS, libunwind makes that word size 64bit. In the lines #90 and #98, backtrace.c tries to do a cast to a pointer, which in some architectures may fail, like MIPS64 n32 for instance, because the size of the pointers is not 64bit wide: Making all in os make[2]: Entering directory `/home/test/test/1/output/build/xserver_xorg-server-1.15.1/os' CC WaitFor.lo CC access.lo CC auth.lo CC backtrace.lo backtrace.c: In function 'xorg_backtrace': backtrace.c:90:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] if (dladdr((void *)(pip.start_ip + off), dlinfo) dlinfo.dli_fname ^ backtrace.c:98:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (void *)(pip.start_ip + off)); ^ cc1: some warnings being treated as errors make[2]: *** [backtrace.lo] Error 1 make[2]: *** Waiting for unfinished jobs Making the cast to a pointer-sized integer, and then to a pointer fixes the problem. Related: https://bugs.freedesktop.org/show_bug.cgi?id=79939 Signed-off-by: Vicente Olivert Riera vincent.ri...@imgtec.com --- os/backtrace.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/os/backtrace.c b/os/backtrace.c index 3d1195b..3c101ae 100644 --- a/os/backtrace.c +++ b/os/backtrace.c @@ -87,7 +87,7 @@ xorg_backtrace(void) procname[1] = 0; } -if (dladdr((void *)(pip.start_ip + off), dlinfo) dlinfo.dli_fname +if (dladdr((void *)(long)(pip.start_ip + off), dlinfo) dlinfo.dli_fname *dlinfo.dli_fname) filename = dlinfo.dli_fname; else @@ -95,7 +95,7 @@ xorg_backtrace(void) ErrorFSigSafe(%u: %s (%s%s+0x%x) [%p]\n, i++, filename, procname, ret == -UNW_ENOMEM ? ... : , (int)off, -(void *)(pip.start_ip + off)); +(void *)(long)(pip.start_ip + off)); ret = unw_step(cursor); if (ret 0) -- 1.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel