Recently, I was doing the performance test of file download. I used LoadRunner tool to report “error: C interpreter run time error: action. C (1613): error – memory violation: exception access” after running for several times_ VIOLATION received.”。 After careful review of the script and scenario analysis, it is found that: in the fopen method of the script, the file operation mode is “W +”, and Encyclopedia:
W + reads and writes in plain text mode, while WB + reads and writes in binary mode.
W + open the read-write file. If the file exists, the length of the file will be zero, that is, the content of the file will disappear. If the file does not exist, the file is created.
Open or create a new binary file in WB write only mode, and only write data is allowed.
WB + read/write mode opens or creates a binary file that allows reading and writing.
The image file I downloaded belongs to binary file,
all the files that must be read and written with WB +, namely fopen (file, “WB +”);
test again, and the error will no longer appear.
Note: if you are using plain text files, you can use w +, if you are downloading binary files, you must use WB mode.
- fopen,fopen_ S, wfopen_ S and_ fsopen, _ The distinction of WFS open
- python reads csv file is an error _csv.Error: iterator should return strings, not bytes (did you open the file in text)
- Parsing the difference between “R” and “RB” patterns of text files (Python)
- Error: ENOENT: no such file or directory, open ‘E:\Program Files\nodejs\tmp\upload_38b32f25bc984333c
- Principle and usage of feof ()
- Errno in Linux Programming
- The MySQL load data command parses and handles error 29 (errCode: 13) errors (in the Ubuntu environment)
- Failed to open stream: http request failed!
- Ida batch processes virus share samples to obtain ASM files and bytes files
- Explain stdin, stdout, stderr in C language
- Apple computer download file automatically with suffix problem solving
- NS_ERROR_DOM_BAD_URI: Access to restricted URI denied
- Oracle error collection solution
- Memory error unhandled exception: 0xc0000005: read location: 0x00000
- Method of modifying file and folder permission by Chmod command in Linux
- SCRIPT1002: syntax error File: 0. chunk.js ,SCRIPT5009: ‘Map‘ is undefined File: 0. chunk.js -Solutions
- Tomcat web compression configuration
- FTP use get command 550 failed to open file, but use the put command to solve the problem
- How to wrap a long string in MATLAB