UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer benh88
Observer
2,559 Views
Registered: ‎01-03-2013

Register R19 corruption in C++ application

Jump to solution

Hi There !

 
I'm seeing a very strange problem with my multi-threaded C++ application. After calling a certain function I can no longer access any local (stack) variables without getting a segmentation fault. A skeleton of the program is shown below. The "headache_function" creates several new threads and sets up a posix timer, which all appears to be working well.
 
1:main()
2:{
3:      int i;
4:      i++; //Works
5:      headache_function();
6:      i++ //SIGSEGV
7:}
 
After some research I discovered that r19 most significant byte got wiped out to zero after the function. Before the function the R19 value is 0xbf945db8 and after its 0x00945db8. Looks to me like r19 is used as a stack/frame pointer, which explains why I'm getting a segmentation fault when a "load word immediate" is called with r19 as a base pointer. 
 
Any ideas on what could be the problem ? Is there anywhere I can read about how these registers are used ?
 
Thanks a lot and have a great weekend 
 
/Ben
 
ARCH Microblaze Big Endian
Btw, I'm running -
Linux 3.6.0
GCC 4.6.4
Binutils  2.22.90
egLibc 2.14.90
0 Kudos
1 Solution

Accepted Solutions
Observer benh88
Observer
3,042 Views
Registered: ‎01-03-2013

Re: Register R19 corruption in C++ application

Jump to solution

Update: Operator error. Turns out there is a memcpy using the wrong size paramter. Application seems to run fine now

View solution in original post

0 Kudos
1 Reply
Observer benh88
Observer
3,043 Views
Registered: ‎01-03-2013

Re: Register R19 corruption in C++ application

Jump to solution

Update: Operator error. Turns out there is a memcpy using the wrong size paramter. Application seems to run fine now

View solution in original post

0 Kudos