Highlighted
Absent Member.
Absent Member.
35500 views

memory violation : Exception ACCESS_VIOLATION received.

Jump to solution

I am getting an memory ACCESS_VIOLATION exception; LoadRunner Version 11.52; execution aborts after this line and goes to vuser_end.c; Logging is full but no other message is displayed; size of array varis from 6 to 50. 

 

The code looks like 

 

extern char *strcatchar *to, const char *from );

...

...

lr_save_string(strcat(" or CategorizationID eq "lr_paramarr_idx("CatalogItemFieldValuesNames", n - 1)), "ifCategorization");

 

 

Exception:

Action.c(211): Error: C interpreter run time error: Action.c (211):  Error -- memory violation : Exception ACCESS_VIOLATION received.

 

--
Regards
Anubhav Bansal

You've got to jump off cliffs all the time and build your wings on the way down - Ray Bradbury
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: memory violation : Exception ACCESS_VIOLATION received.

Jump to solution

Hi,

 

The memory violation error is thrown by the "to" pareamer you used in strcat function. 

Please review the example in the function reference. If you use the approach suggested there the i.e declare a

char value [10]; , assign it a value and use it as the "to" parameter of the strcpy function the script will replay fine.

Action()
{
    extern char *strcat( char *to, const char *from );    

    char value [10];  
    
    strcpy(value, "A");    
     lr_save_string("", "ifCategorization");    
     lr_save_string(strcat(value, "9"), "ifCategorization");

 

     return 0; 
 }

 

Kind regards,

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.

View solution in original post

7 Replies
Highlighted
Absent Member.
Absent Member.

Re: memory violation : Exception ACCESS_VIOLATION received.

Jump to solution

Hi Anubhav Bansal,

 


Hoping you are doing well, I am a LoadRunner/Performance Center support engineer and I am going to help.

 

What is the prococol you are using?

 

It also depends if you have custome code into the script. Please check that, also the memory allocation should be well given for the. Also the number of iterations play an important role during the execution of the Script in Vugen.

 

It is also recommended to check the memory distribution for every created variables onto the script. Another casue may be that the vairables you declare or all the variables at the start of the action. The value(s) are corrupt during the execution and this causes to the script to run in a endless loop that leads to a 'memory violation' C interpreter run time error which LoadRunner display. May be the problem occurs because there is not enough memory allocated for such variables.

 

To troubleshot this corruption increase the size of the strin or any type of variable you defined and it will be able to handle , larger number of values.

 

 

I want to check this link refering to 'LoadRunner Support Strings Functions': http://support.openview.hp.com/selfsolve/document/KM207217

 


Kind regards,

 

 Alexis B

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: memory violation : Exception ACCESS_VIOLATION received.

Jump to solution

Hi Alexis

 

Thanks for the detailed response about the posible causes of the error. Below are the responses to few of the points you have mentioed.

 

- Protocol Web (HTML/HTTP)

- Explicit memory declaratons are for 2 int and a char array of 10 which is not expected to hold more than 2 chars; I can decrease this if you want

- Number of itrations is only 1 as i am running from Vugen

 

I have pulled the problamatic piece in to a separate script and the error is still there. pls see the Action.c below; vuser_init.c and vuser_end.c are empty. Attachment is not working

 

Action()
{
	extern char *strcat( char *to, const char *from );
	int n;
	n = 0;
	lr_save_string("", "ifCategorization");
	for(n = 10; n>=1; n--)
	{
		if (0 == 0)
		{			
			lr_save_string(strcat("A", "9"), "ifCategorization");
			break;
		}
	}
	return 0;
}

 

Also, I am not able to access the link you have shared.

--
Regards
Anubhav Bansal

You've got to jump off cliffs all the time and build your wings on the way down - Ray Bradbury
0 Likes
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: memory violation : Exception ACCESS_VIOLATION received.

Jump to solution

Hi Anubhav,

 

You need User ID and password of HP Passport account to view the document.

I have attached the content of document. Please refer.

 

Regards,

Chau Nguyen

Regards,

Chau Nguyen | SW Technical Support Consultant.
LoadRunner and Performance Center


If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: memory violation : Exception ACCESS_VIOLATION received.

Jump to solution

Hi,

 

The memory violation error is thrown by the "to" pareamer you used in strcat function. 

Please review the example in the function reference. If you use the approach suggested there the i.e declare a

char value [10]; , assign it a value and use it as the "to" parameter of the strcpy function the script will replay fine.

Action()
{
    extern char *strcat( char *to, const char *from );    

    char value [10];  
    
    strcpy(value, "A");    
     lr_save_string("", "ifCategorization");    
     lr_save_string(strcat(value, "9"), "ifCategorization");

 

     return 0; 
 }

 

Kind regards,

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.

View solution in original post

Highlighted
Absent Member.
Absent Member.

Re: memory violation : Exception ACCESS_VIOLATION received.

Jump to solution
0 Likes
Highlighted
Regular Contributor.
Regular Contributor.

Re: memory violation : Exception ACCESS_VIOLATION received.

Jump to solution

Hi dear,

I am just recording some random scripts on vugen and using them in APM and BPM. but getting error memory violation : Exception ACCESS_VIOLATION received in BPM and text not found in Vugen. I am not writing any code . Kindly help

0 Likes
Highlighted
Regular Contributor.
Regular Contributor.

Re: memory violation : Exception ACCESS_VIOLATION received.

Jump to solution

Hi Dear,

I am having the same issue memory violation : Exception ACCESS_VIOLATION received in BPM bpm_mdrv.log file.

kindly help.

Best Regards

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.