Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

memcpy causes an RTM abort?

Alam__Shariful
New Contributor I
1,838 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
1,806 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
RahulV_intel
Moderator
1,789 Views

Hi,


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



Thanks,

Rahul


0 Kudos
Subarnarek_G_Intel
1,748 Views

Hi Shariful,

What version of compiler are you using?


Regards,

Subarna


0 Kudos
Alam__Shariful
New Contributor I
1,681 Views

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

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,668 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
Subarnarek_G_Intel
1,577 Views

Hi Shariful,

We are waiting for the results from you.


Regards,

Subarna


0 Kudos
Subarnarek_G_Intel
1,560 Views

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


0 Kudos
Subarnarek_G_Intel
1,560 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.


0 Kudos
Reply