Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
197 Views

memcpy causes an RTM abort?

Hi,
I'm new in using intel tsx so, please correct me on any terminological/conceptional mistake.
I'm trying to use RTM on a project. I have multiple code segments causing a transaction failure and I'm trying to address those issues one by one. I have the following code segment,

int result=-1;

unsigned status;
while(result!=1){
   if ((status = _xbegin()) == _XBEGIN_STARTED) {
      memcpy(private_plaintext,private_decrypt,986);
      result=1;
      _xend();
   }else{ 
      printf("Block 1: Transaction failed\n");
     printf("status is %ld\n", status);
  }
  printf("Block 1: Result is %d\n", result);

}

that memcpy is causing transaction failure. I'm getting the following output,

.
.
.
Block 1: Transaction failed
status is 0
Block 1: Result is -1
.
.


Any help, why this is happening and how can I solve it?

Thank you.

Labels (1)
0 Kudos
5 Replies
Highlighted
165 Views

Hello Alam__Shariful, 

 

Thank you for posting on the Intel® communities.   

 

We are checking this thread and based on the details described we noticed that this seems to be related to the development of a software. 

 

Based on that, we will move this thread to Software Products > Software Development Tools > Intel® C++ Compiler. However, there are several topics that you can choose based on your inquiry. 

Sebastian_M_Intel_0-1600191457639.png

 

 

Regards, 

 

Sebastian M  

Intel Customer Support Technician  

 

0 Kudos
Highlighted
Moderator
148 Views

Hi,


Forwarding this thread to TSX subject matter experts(SMEs). They will get back to you soon.



Thanks,

Rahul


0 Kudos
Highlighted
107 Views

Hi Shariful,

What version of compiler are you using?


Regards,

Subarna


0 Kudos
Highlighted
40 Views

My compiler is:  gcc version 7.1.0 (Ubuntu 7.1.0-10ubuntu1~16.04.york0)

0 Kudos
Highlighted
27 Views

What happens on your system when you change the copy length from 986 to 8?

If this succeeds, then I would suspect that you are exceeding an upper limit to the number of read/writes in the transaction. You could then increase the count until failure to figure out the capacity for your CPU.

If this fails, then experiment with commenting out the memcpy (IOW only set result=1).

If this fails, then I suspect RTM isn't enabled (and I do not know why you do not get illegal/unsupported instruction).

If this succeeds, then try replacing the memcpy with a for loop.

Please report your results.

Jim Dempsey

0 Kudos