Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - RVDS support for QNX: (23 Items)
   
RVDS support for QNX  
I have built couple of libraries and one application that uses these libraries using RVDS(used EABI technique). I have 
created the QNX executable using GNU linker available with momentics. The final executable crashes at some swich case 
with SIGSEGV in 'memset' library call.

If I comment all the 'memset' calls in the project then it runs for a while and then crashes with SIGSEGV

1. What could be the reason for it to crash in memset and how to resolve this ?
2. Even if I remove the memset it crashes in the switch case(same project created in momentics is running fine and hence
 I am sure there is no problem in the code), what could be the reason and how exactly I can debug this kind of binary ?
3. Is there any wrapper available in QNX to use RVDS ?
Re: RVDS support for QNX  
When it crashes on memset did you try to use memory analysis tool to see if it is buffer overflow?

On 29/09/10 03:39 AM, Girisha SG wrote:
> I have built couple of libraries and one application that uses these libraries using RVDS(used EABI technique). I have
 created the QNX executable using GNU linker available with momentics. The final executable crashes at some swich case 
with SIGSEGV in 'memset' library call.
> 
> If I comment all the 'memset' calls in the project then it runs for a while and then crashes with SIGSEGV
> 
> 1. What could be the reason for it to crash in memset and how to resolve this ?
> 2. Even if I remove the memset it crashes in the switch case(same project created in momentics is running fine and 
hence I am sure there is no problem in the code), what could be the reason and how exactly I can debug this kind of 
binary ?
> 3. Is there any wrapper available in QNX to use RVDS ?
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post68949
> 
Re: RVDS support for QNX  
traces.rmat file on the target is empty however in the GDB promt of momentics IDE I am getting an error 'Cannot access 
memory at address 0xe7c3c99c'. As I have mentioned earlier the source code in the momentics and ARM workbench are bit 
different and hence it is not possible for me to step in into the code(I am getting the error 'No source file named 
exampleAppMainMixer.c' in GDB prompt).


Also I am getting error 'ldd:FATAL: Could not preload library librcheck.so' during run time.

How can I resolve all these ?
Re: RVDS support for QNX  
One more thing is when I run the executable for debugging I am getting the following error,(after pressing F5)

203^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x00100de0",at="<main>",times="0"}
(gdb) 
204-exec-continue
204^running
(gdb) 
204*stopped,reason="exited",exit-code="01"
Re: RVDS support for QNX  
> One more thing is when I run the executable for debugging I am getting the 
> following error,(after pressing F5)
> 
> 203^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="
> 0x00100de0",at="<main>",times="0"}
> (gdb) 
> 204-exec-continue
> 204^running
> (gdb) 
> 204*stopped,reason="exited",exit-code="01"

Also the console log has ....

Process 225300 (MainMixerTestApplication_g_RVDS_NMemSet.exeGGanapathy128583433304920) terminated SIGSEGV code=1 fltno=11
 ip=00104d44(MainMixerTestApplication_g_RVDS_NMemSet.exeGGanapathy128583433304920@_Feraise+0x2378) ref=0007fff8
Re: RVDS support for QNX  
You need this library on target to work with memory analysis. Put it in the image or upload from 
<installation>/target/qnx6/<architecture>/usr/lib/librcheck.so

On 30/09/10 03:15 AM, Girisha SG wrote:
> traces.rmat file on the target is empty however in the GDB promt of momentics IDE I am getting an error 'Cannot access
 memory at address 0xe7c3c99c'. As I have mentioned earlier the source code in the momentics and ARM workbench are bit 
different and hence it is not possible for me to step in into the code(I am getting the error 'No source file named 
exampleAppMainMixer.c' in GDB prompt).
> 
> 
> Also I am getting error 'ldd:FATAL: Could not preload library librcheck.so' during run time.
> 
> How can I resolve all these ?
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post69125
> 
Re: RVDS support for QNX  
After copying the said .so file in /tmp folder now I am getting the following error during run time,

unknown symbol: main
ldd:FATAL: Could not resolve all symbols 
Re: RVDS support for QNX  
One more error is

MainMixerTestApplication_g_RVDS.exe: Can't access shared library

How can I find out which shared library and where to copy it ?
Re: RVDS support for QNX  
One more error after copying the libc.so.3(came to know the dependency after opening the executable in momentics) the 
following error:

Error starting remote application.
Target launcher@<10.90.73.53:8000>: Error: Unable to locate an appropriate pty device on the target. Please ensure that 
a pty device (such as devc-pty) is running on the target.
Re: RVDS support for QNX  
> 
> One more error after copying the libc.so.3(came to know the dependency after 
> opening the executable in momentics) the following error:
> 
> Error starting remote application.
> Target launcher@<10.90.73.53:8000>: Error: Unable to locate an appropriate pty device on the 
> target. Please ensure that a pty device (such as devc-pty) is running on the 
> target.

devc-pty is already running on the target.
Re: RVDS support for QNX  
You can discard all the previous errors as I have narrowed down the problem for crash as MEMSET & MEMCPY.

Executable crashes at memcpy or memset(ofcourse even if I declare a variable t[44] and I try to copy 15 elements then 
also it crashes :( and I am very sure that there is no array overshooting as per the logic)

Please help me out to fix this... ITS REALLY IMPORTANT
Re: RVDS support for QNX  
> You can discard all the previous errors as I have narrowed down the problem 
> for crash as MEMSET & MEMCPY.
> 
> Executable crashes at memcpy or memset(ofcourse even if I declare a variable t
> [44] and I try to copy 15 elements then also it crashes :( and I am very sure 
> that there is no array overshooting as per the logic)
> 
> Please help me out to fix this... ITS REALLY IMPORTANT


Also I have declared the below functions,

void  __aeabi_memclr (void *dest, size_t n) {
	memset( dest, 0, n );
}

void __aeabi_memclr4 () __attribute__ ((alias ("__aeabi_memclr")));
void __aeabi_memclr8 () __attribute__ ((alias ("__aeabi_memclr")));

void __aeabi_memcpy (void *dest, void *src, size_t n) {
	memcpy(dest, src, n);
}

void __aeabi_memcpy4 () __attribute__ ((alias ("__aeabi_memcpy")));
void __aeabi_memcpy8 () __attribute__ ((alias ("__aeabi_memcpy")));
Re: RVDS support for QNX  
I have found that it is crashing at memcpy and memset.

I have commented memset(this project does not have any memcpy) in the code and it did work !

I am sure that the size is not more than what is allocated.

How can I resolve this ? This is really important for me. I am using armlev7 variant with momentics 6.5.0
Re: RVDS support for QNX  
Have you tried rewriting memset (as a simple loop)? Once you get it
working you can try to figure out what exactly doesn't work in our
memset.

What CPU are you using?


On Fri, 2010-10-01 at 09:22 -0400, Girisha SG wrote:
> I have found that it is crashing at memcpy and memset.
> 
> I have commented memset(this project does not have any memcpy) in the code and it did work !
> 
> I am sure that the size is not more than what is allocated.
> 
> How can I resolve this ? This is really important for me. I am using armlev7 variant with momentics 6.5.0
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post69257
> 

Re: RVDS support for QNX  
I have implemented my own version of memcpy and memset and with this it is working !!!

I am using ARM Cortex A8 processor having ARMV7 architecture.
Re: RVDS support for QNX  
Oops, you just out of luck with tools. Try new version patch for 
librcheck 6.5.0 here:
http://community.qnx.com/sf/frs/do/viewRelease/projects.ide/frs.binary_patches_for_ide.6_5_0_patches

On 01/10/2010 1:39 AM, Girisha SG wrote:
> After copying the said .so file in /tmp folder now I am getting the following error during run time,
>
> unknown symbol: main
> ldd:FATAL: Could not resolve all symbols
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post69226
>
>    
Re: RVDS support for QNX  
This patch is for memory analysis and not the fix for memcpy/memset issue right ?

If yes, is there any patch for memcpy/memset functions or can you share the optimized memset&memcpy(i.e. one that is 
getting invoked when we call standard memcpy/memset) functions for ARMV7(with Neon) ?
Re: RVDS support for QNX  
One more thing is I want to profile the code or atleast I want the total time taken by a complete process. what fucntion
 call can I use for this(Please remember I am compiling using RVDS and linking it using ld and hence I may not be able 
to use clock, time etc functions) ?

when I use the clock function I am getting the following error

ldd:FATAL: Unresolved symbol "__aeabi_uldivmod" called from Executable
Re: RVDS support for QNX  
This function is defined in libgcc.a


On Mon, 2010-10-04 at 03:47 -0400, Girisha SG wrote:
> One more thing is I want to profile the code or atleast I want the total time taken by a complete process. what 
fucntion call can I use for this(Please remember I am compiling using RVDS and linking it using ld and hence I may not 
be able to use clock, time etc functions) ?
> 
> when I use the clock function I am getting the following error
> 
> ldd:FATAL: Unresolved symbol "__aeabi_uldivmod" called from Executable
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post69390
> 

Re: RVDS support for QNX  
1. I have linked the above said library but I am still observing the same error, what is the solution ?

2. Is there any patch for memcpy/memset functions or can you share the optimized memset&memcpy(i.e. one that is 
getting invoked when we call standard memcpy/memset) functions for ARMV7(with Neon) ?
Re: RVDS support for QNX  
1. Reason why standard memset & memcpy functions crash during run time with SIGSEGV error. The execuatble is created by 
compiling the source using RVCT and linked using ld ?

2. Can anybody share the memcpy & memset that is optimized for ARMV7 or Cortex A8 architecture ? (i.e. I have written 
one but it is not optimized for ARMV7)

3. Is memset and memcpy are part of compiler or part of glibc(or any other) library ?
Re: RVDS support for QNX  
On Wed, 2010-10-06 at 05:36 -0400, Girisha SG wrote:
> 1. Reason why standard memset & memcpy functions crash during run time with SIGSEGV error. The execuatble is created by compiling the source using RVCT and linked using ld ?

> 2. Can anybody share the memcpy & memset that is optimized for ARMV7 or Cortex A8 architecture ? (i.e. I have written one but it is not optimized for ARMV7)

See disassembly of libc memcpy & memset.

> 
> 3. Is memset and memcpy are part of compiler or part of glibc(or any other) library ?

They are a part of libc. You can disassemble them and I am very
interested to see at which exactly instruction is it crashing for you.
(I believe there are also gcc built-ins, but since you are not using
gcc, maybe your compiler has similar, or you could, maybe, create a
wrapper function and compile it with gcc then link with your code).

> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post69698
> 

Re: RVDS support for QNX  
What are the complete compilation options to RVDS(armcc) for using only NEON, only VPF and neon & VFP(ofcourse I am 
planning to use EABI technique) ?

I am using floating point operations and I want to use NEON and not VFP for doing these floating point operations(as we 
can utilize SIMD architecture).

What is the optimized set of compilation options that will give the best performance ?