I have some STDF files that REC_LEN of a record greater than the total length of fields in this record. This would lead to error when parse the first field of next record. After debugging, I found the cause, then I change the function parse_records in IO module like below:

I read the whole bytes stream in this record, then process the parse work just with it, and restore at the end. By applying this, I can walk-around this kind of error.