nanogui: nano-X libpng : read a png image crash nano-X on a arm target (but work well on host x86)


Previous by date: 4 Aug 2009 12:09:15 -0000 Re: PNG and transparency, Bajimohanreddy Bandi
Next by date: 4 Aug 2009 12:09:15 -0000 Case ID Number: PP-503-410-563, service.paypal.com
Previous in thread: 4 Aug 2009 12:09:15 -0000 nano-X libpng : read a png image crash nano-X on a arm target (but work well on host x86), BRACH Vincent
Next in thread:

Subject: Re: [nanogui] nano-X libpng : read a png image crash nano-X on a arm target (but work well on host x86)
From: Bajimohanreddy Bandi ####@####.####
Date: 4 Aug 2009 12:09:15 -0000
Message-Id: <6eca7d50908040509l2c655469r24d7457ac84e7f85@mail.gmail.com>

HAVE_PNG_SUPPORT         = Y
INCPNG                   =
/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/target/usr/include/libpng/
LIBPNG                   =
/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/target/usr/lib/libpng.a

and use LINK_APP_INTO_SERVER     = Y im this case no need to run seperate
nano-x server.

i am also running Nano-X on ARM Board.there is nothing special to do  for
arm board.
i am using arm tool chain cross compiled libraries.
if u want u can cross compile PNG library and u can give that paths .i tried
that one also.its working fine for me.

i hope it will help u..

regards,
Mohan.

On Thu, Jul 30, 2009 at 3:57 PM, BRACH Vincent ####@####.#### wrote:

> Hello all,
>
> I've a problem with nano-X (CVS sources) and GrLoadImageFromFile for PNG
> type image only with the cross-compiled version of nano-X on my target
> (arm - CPU PXA270) but not with the nano-X binary running on my host
> (x86) : I investigate the problem (following step of investigations) and
> found the line code that generate a SEGFAULT in nano-X in this
> situation :
>
> 1/ To support PNG I've build the libpng (version 1.2.38 sources from
> http://www.libpng.org) and zlib (version 1.2.3 sources from
> http://www.zlib.org) for my target architecture (with arm-linux-gnueabi
> tool chain), install them in the cross-chain location, and rebuild
> nano-X with same cross-chain and use this previous libs.
>
> some config of nano-X are :
> ARCH                     = LINUX-ARM
>
> HAVE_PNG_SUPPORT         = Y
> INCPNG                   = /usr/local/arm-linux/arm-linux/include/
> LIBPNG
> = /usr/local/arm/oe/arm-linux-gnueabi/lib/libpng.a
> INCZ                     = /usr/local/arm-linux/arm-linux/include/
> LIBZ
> = /usr/local/arm/oe/arm-linux-gnueabi/lib/libz.a
>
> Everything compiled with success (nano-X + demos) and copy into the
> target.
>
> 2/ On the target when I run ./nano-X & ./nxview image.png , nano-X crash
> with a Segmentation fault.
> Note that running ./nano-X & ./nvxiew image.png on my host (x86) (with
> nano-X and demos compiled for x86 architecture) work perfectly !
>
> 3/ I've rebuild nano-X and demos with DEBUG=Y and OPTFLAGS += -ggdb -O0
> to be able to run nano-X with gdbserver on the target and watch with gdb
> exactly the problem
> After this step (and some long time to compil and crosscompil
> gdb/gdbserver ;)) I check the followings :
>    Program received signal SIGSEGV, Segmentation fault.
>    0x00017f6c in GdImageBufferRead (buffer=0x0, dest=0xbe82a4f4,
> size=8) at /home/vincent/microwindows-cvs/src/engine/devimage.c:78
>
> In fact, a NULL pointer for buffer for the call of int
> GdImageBufferRead(buffer_t *buffer, void *dest, unsigned long size) (in
> devimage.c) called by the png_read_buffer function (in image_png.c), and
> the first line of GdImageBufferRead that is buffer->offset generate a
> SEGFAULT
> With add of if (buffer==0 || dest==0) return -1; at the begenning of the
> GdImageBufferRead function and same procedure, nano-X doesn't crash,
> nvxiew display 'Can't load image file' and both terminate normaly.
>
> 4/ Continuing my investigations with step by step on ddd (on host side)
> and gdbserver (on target side) I notice that in GdDecodePNG
> (image_png.c) png_structp state always contain 0 for all fields BUT
> during step execution of png_init_io(state, src); (into this function,
> into the lib) the contents of the structure seems to be good, but not
> after leaving and return in the GdDecodePNG function. (strange)
>
> I note that when compiling nano-X I've got this warning: passing
> argument 2 of 'png_init_io' from incompatible pointer type. Argument 2
> if the src pointer (buffer_t *) and png_init_io require a png_FILE_p
> type, but even when casting (png_FILE_p)src for the png_init_io call (no
> more warning) but same result...
>
> Now I can't continue some investigations and require some helps...
>
> Does anybody try and reach to cross compil nano-X with libpng for arm
> architecture and display some PNG image with ??
> Is there's some particular options for the libpng or/and zlib build to
> work with nano-X ?
>
> Sorry for this long mail but need to be clear.
>
> Can anybody help me please ?
>
> Regards,
> Vincent BRACH
>
>

Previous by date: 4 Aug 2009 12:09:15 -0000 Re: PNG and transparency, Bajimohanreddy Bandi
Next by date: 4 Aug 2009 12:09:15 -0000 Case ID Number: PP-503-410-563, service.paypal.com
Previous in thread: 4 Aug 2009 12:09:15 -0000 nano-X libpng : read a png image crash nano-X on a arm target (but work well on host x86), BRACH Vincent
Next in thread:


Powered by ezmlm-browse 0.20.