Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

memcpy causes an RTM abort?

Alam__Shariful
New Contributor I
594 Views

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
8 Replies
Sebastian_M_Intel
Moderator
562 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  

 

RahulV_intel
Moderator
545 Views

Hi,


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



Thanks,

Rahul


Subarnarek_G_Intel
504 Views

Hi Shariful,

What version of compiler are you using?


Regards,

Subarna


Alam__Shariful
New Contributor I
437 Views

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

jimdempseyatthecove
Black Belt
424 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

Subarnarek_G_Intel
333 Views

Hi Shariful,

We are waiting for the results from you.


Regards,

Subarna


Subarnarek_G_Intel
316 Views

Closing this thread as there is no response from the customer.


Subarnarek_G_Intel
316 Views

This issue has been resolved and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.


Reply