DiscussionsIssue archiveData Exchange and Application Framework

Archived discussion

Parsing error when reading STEP file

Data Exchange and Application FrameworkSat, 04/02/2022 - 23:514 replies

Browse this forum
QuestionAuthor

Hi,

I am having trouble reading a specific STEP file using the C++ API. The function STEPCAFControl_Reader::ReadFile() is failing and returning IFSelect_RetFail. When I activate the DEBUG mode from OCCT I have the following error message when the ReadFile function is running:

"input buffer overflow, can't enlarge buffer because scanner uses REJECT"

I found that an exception occurs inside the STEP parser when the scanner is reading the following entity in the STEP file:

#896683=DESCRIPTIVE_REPRESENTATION_ITEM('', 'FINAL_PART=13791,26341,26353,26365,26377,26389,26401,26413,26425,2643 7,26449,26461,26473,26485,26497,26509,26521,26533,26545,26557,26569,26 581,26593,26605,26617,26629,26641,26653,26665,26677,26689,26701,26713, ... ... ... 6280,20270,11805,15576,1240');

This entity definition is very large, above I removed most of the lines, but in total it has 48675 characters!

I know very little about parsers, but it looks like some buffer is overflowing when reading this entity. I really need to read this file, is there any way to get around this problem?

Discussion

4 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hi,

Can you share the example file or full entity definition in the .txt file.
The STEP parser has an expandable buffer.

Best regards,
Dmitry.

02Author

Unfortunately I cant upload the STEP file, but I attached a txt containing only the entity that is causing problems.

03Author

Anyone?

04Commenter-1

Hello,

Unfortunately, the represented entity is incorrect.
According the ISO 10303-21: The maximum length of a string as stored in an exchange structure is 32769 octets, including the beginning and ending apostrophes.

To read this entity we need to improve step parser. It takes a time. If you need to read the file as soon as possible, you can clean long string value from the entity.

Best regards,
Dmitry.