View Issue Details

IDProjectCategoryView StatusLast Update
0031711CommunityOCCT:Data Exchangepublic2020-12-02 17:13
Reporterly155331445 Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2013 
Product Version7.4.0 
Target Version7.5.0Fixed in Version7.5.0 
Summary0031711: Data Exchange - STEPCAFControl_Reader hangs on attached file in an infinite loop
DescriptionIn "STEPCAFControl\STEPCAFControl_Reader.cxx" file ,the function "Transfer(STEPControl_Reader ,Standard_)Integer,........)",maybe call "ReadExternFile(Standard_CString,Standard_Cstring.....)" function when "ExtRefs.NbExternRefs() is not 0 " .But the "ReadExternFile(Standard_CString,Standard_Cstring.....)" function in the same file maybe call "Transfer(STEPControl_Reader ,Standard_)Integer,........)" function.
So it will be call each other forever.
Steps To ReproduceReadStep D c:/UPPER.stp

Additional information
and documentation updates
When excute "m_fileReader.Transfer(m_doc)", it will compute true path to the extern file in "for(i = i; i<=ExtRefs.NbExternRefs();i++)" in Transfer(STEPControl_Reader ,Standard_)Integer,........) .And then ,call "ReadExternFile(filename,filename.ToCString(),doc)" .But in ReadExternFile(),When EF->GetLoadStatus() = IFSelect_RetDone, it will call Transfer(.......)again.
This is a recursion.But in Transfer(.....) it will excute same code and call ReadExternFile() again,so for attached file it will call each other forever.I wait for 30min ,never end.
TagsNo tags attached.
Test case numberbugs/step/bug31711

Attached Files

  • UPPER.zip (6,295,428 bytes)

Activities

ly155331445

2020-08-13 06:56

reporter  

UPPER.zip (6,295,428 bytes)

git

2020-09-01 10:46

administrator   ~0093795

Branch CR31711 has been created by dpasukhi.

SHA-1: cf126ddbb30118a494d92fde57ee34afb141373e


Detailed log of new commits:

Author: dpasukhi
Date: Tue Sep 1 10:47:20 2020 +0300

    0031711: Data Exchange - STEPCAFControl_Reader hangs on attached file in an infinite loop
    
    Add check if .step external file is the same main file

kgv

2020-09-01 11:13

developer   ~0093796

+#ifdef OCCT_DEBUG
+      std::cout << "Warning: STEPCAFControl_Reader::Transfer: Extern reference file is the same main file " << std::endl;
+#endif

I think this message shouldn't be a Debug one.

git

2020-09-01 12:42

administrator   ~0093807

Branch CR31711 has been updated forcibly by dpasukhi.

SHA-1: 56b118552e4f098c33ffdcd6b7f8afb6404f917d

ly155331445

2020-09-01 13:30

reporter   ~0093813

Hello ,I update the code by "CR31711" and check the attached file in my PC.It is also "in an infinite loop".And I debug the code ,it maybe forget to deal with the "\" with "filename".So please check the "attached file".

git

2020-09-02 12:16

administrator   ~0093850

Branch CR31711 has been updated forcibly by dpasukhi.

SHA-1: 82c40a1f9420ce7e495d584ac9bfa470b7cf661e

dpasukhi

2020-09-02 12:25

administrator   ~0093852

Dear ly155331445,
can You update the branch and test on your PC? If this fix doesn't help, can you tell me your operating system?

ly155331445

2020-09-03 06:49

reporter   ~0093954

Dear dpasukhi,
  I merger the code and test on my PC.My operating system is Simplified Chinese Windows 7 Ultimate.The reason is different between "\" and "/" in "filepath".
So I change the code following:
     TCollection_AsciiString fullname = OSD_Path::AbsolutePath(dpath, filename);
     if (fullname.Length() <= 0) fullname = filename;

+ // compute true path to the main file
- const Standard_CString aMainName = reader.WS()->LoadedFile();
- TCollection_AsciiString aFullMainName = OSD_Path::AbsolutePath(aMainName, aMainName);
- if (aFullMainName.Length() <= 0) aFullMainName = aMainName;


+OSD_PATH aMainName(reader.WS()->LoadedFile());
+aMainName.SetName("");
+aMainName.SetExtension("");
+TCollection_AsciiString dapath;
+aMainName.SystemName(dapath);
+ TCollection_AsciiString aFullMainName = OSD_Path::AbsolutePath(dapath, filename);

+ // check for not the same file
+ if(fullname == aFullMainName) {
.....}
   
   As this fix is usefull on my PC. Please check it.

kgv

2020-09-03 07:37

developer   ~0093955

Last edited: 2020-09-03 07:40

Dmitry,

you may check reversed slashes locally in Draw by putting them in quotes or braces like that:
-ReadStep D_First [locate_data_file bug31711.stp]
+ReadStep D_First {c:\myFolder\bug31711.stp}


I think that `locate_data_file` command normalizes file path (Tcl shell normally works with forward slashes even on Windows).
If there is a different behavior in this case for STEP reader (and we want to detect issues in both cases), it might be useful extending test case and trying to read file also with backslashes - e.g. by replacing forward slashes returned by locate_data_file via regexp.

git

2020-09-03 11:11

administrator   ~0093967

Branch CR31711 has been updated forcibly by dpasukhi.

SHA-1: a4c8ea8d08e5d43f227ccac37a6f5b6cc75e9b1f

git

2020-09-03 16:07

administrator   ~0093993

Branch CR31711 has been updated forcibly by dpasukhi.

SHA-1: 7f9c82acbac60c571d66e7f051901c055829bd8d

git

2020-09-07 11:54

administrator   ~0094191

Branch CR31711 has been updated forcibly by dpasukhi.

SHA-1: 04f07ad73d45f380fc544ee8c4ac60513fc39211

dpasukhi

2020-09-07 16:49

administrator   ~0094201

All test are OK:
http://occt-tests/CR31711-master-dpasukhi-OCCT/Debian80-64/diff_summary.html
http://occt-tests/CR31711-master-dpasukhi-Products/Debian80-64/diff_summary.html
http://occt-tests/CR31711-master-dpasukhi-OCCT/Windows-64-VC14/diff_summary.html
http://vm-jenkins-test-12.nnov.opencascade.com:8080/job/CR31711-master-dpasukhi-Products-Windows-64-VC14-opt-test-compare/6/

dpasukhi

2020-09-07 16:49

administrator   ~0094202

Last edited: 2020-09-07 16:51

Dear ika,
please review CR31711.
The attached file has recursion in EXTERNAL_SOURCE. I have added a check for the same of main file name and external file name.

ika

2020-09-09 16:20

developer   ~0094309

Dear Dmitry,

I have two remarks:

1. I think full names should be low cased before comparing, if, for example, I rename the initial file to "upper.stp" the reader will make an extra loop.

2. "Extern reference file is the same main file" - is no OK please do not use such reduction in warning messages (should be External reference).

git

2020-09-10 12:15

administrator   ~0094364

Branch CR31711 has been updated forcibly by dpasukhi.

SHA-1: ea365e60188999be09caeafbdc207dbaa2b9bed7

dpasukhi

2020-09-10 12:19

administrator   ~0094365

Dear Irina,
Thanks for the remarks.
All have been done.
Please review CR31711.

ly155331445

2020-09-10 13:07

reporter   ~0094370

Dear Dmitry,
  Do you test "\\" in "aMainFullName"?
  For example( Use Draw.exe tool )
     ReadStep D C:\\XXX.stp(It can work in my PC)
  When I use upper.stp .It is not work.

git

2020-09-13 20:20

administrator   ~0094687

Branch CR31711 has been updated forcibly by dpasukhi.

SHA-1: 669b0d37354ab50d59ea80ac46d67fdc3cbac114

dpasukhi

2020-09-14 14:45

administrator   ~0094735

Dear ly155331445,
I fixed all cases, such as: {\\,\,/} ( works correctly on the Windows platform )
Thanks for the remarks.

dpasukhi

2020-09-14 15:52

administrator   ~0094743

Dear Irina,
All have been done.
All tests are OK. No regressions.
Please review CR31711.

ika

2020-09-14 20:23

developer   ~0094775

No more remarks.

Dear bugmaster,
please integrate:

OCCT - CR31711
Products - NOT

bugmaster

2020-09-19 17:19

administrator   ~0095066

Combination -
OCCT branch : IR-2020-09-18
master SHA - b0b766826118f74b9857a932b8cec8c52a25c492
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-09-18 SHA - a6486d839da1ba1383ef6cc1a1a446a172f494c7
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17528.97000000011 / 17378.390000000145 [+0.87%]
Products
Total CPU difference: 12127.32000000009 / 12079.540000000095 [+0.40%]
Windows-64-VC14:
OCCT
Total CPU difference: 18862.703125 / 18898.921875 [-0.19%]
Products
Total CPU difference: 13314.828125 / 13329.21875 [-0.11%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2020-09-20 11:14

administrator   ~0095132

Branch CR31711 has been deleted by inv.

SHA-1: 669b0d37354ab50d59ea80ac46d67fdc3cbac114

Related Changesets

occt: master 2547d979

2020-09-01 07:47:20

dpasukhi


Committer: bugmaster Details Diff
0031711: Data Exchange - STEPCAFControl_Reader hangs on attached file in an infinite loop

Add check if .step external file is the same main file.
Affected Issues
0031711
mod - src/STEPCAFControl/STEPCAFControl_Reader.cxx Diff File
mod - src/STEPConstruct/STEPConstruct_ExternRefs.cxx Diff File
mod - src/STEPConstruct/STEPConstruct_ExternRefs.hxx Diff File
add - tests/bugs/step/bug31711 Diff File

Issue History

Date Modified Username Field Change
2020-08-13 06:56 ly155331445 New Issue
2020-08-13 06:56 ly155331445 Assigned To => kgv
2020-08-13 06:56 ly155331445 File Added: UPPER.zip
2020-08-13 16:46 kgv Assigned To kgv => gka
2020-08-13 16:46 kgv Category OCCT:Coding => OCCT:Data Exchange
2020-08-13 16:46 kgv Product Version => 7.4.0
2020-08-13 16:46 kgv Target Version => 7.5.0
2020-08-13 16:46 kgv Summary About code in STEPCAFControl\STEPCAFControl_Reader.cxx => Data Exchange - STEPCAFControl_Reader hangs on attached file in an infinite loop
2020-08-26 12:09 gka Assigned To gka => dpasukhi
2020-09-01 10:46 git Note Added: 0093795
2020-09-01 11:13 kgv Note Added: 0093796
2020-09-01 12:42 git Note Added: 0093807
2020-09-01 13:30 ly155331445 Note Added: 0093813
2020-09-02 12:16 git Note Added: 0093850
2020-09-02 12:25 dpasukhi Note Added: 0093852
2020-09-03 06:49 ly155331445 Note Added: 0093954
2020-09-03 07:37 kgv Note Added: 0093955
2020-09-03 07:39 kgv Note Edited: 0093955
2020-09-03 07:39 kgv Note Edited: 0093955
2020-09-03 07:40 kgv Note Edited: 0093955
2020-09-03 11:11 git Note Added: 0093967
2020-09-03 16:07 git Note Added: 0093993
2020-09-07 11:54 git Note Added: 0094191
2020-09-07 16:49 dpasukhi Note Added: 0094201
2020-09-07 16:49 dpasukhi Note Added: 0094202
2020-09-07 16:49 dpasukhi Assigned To dpasukhi => ika
2020-09-07 16:49 dpasukhi Status new => resolved
2020-09-07 16:51 dpasukhi Note Edited: 0094202
2020-09-09 16:20 ika Note Added: 0094309
2020-09-09 16:20 ika Assigned To ika => dpasukhi
2020-09-09 16:20 ika Status resolved => assigned
2020-09-10 12:15 git Note Added: 0094364
2020-09-10 12:19 dpasukhi Note Added: 0094365
2020-09-10 12:19 dpasukhi Assigned To dpasukhi => ika
2020-09-10 12:19 dpasukhi Status assigned => feedback
2020-09-10 13:07 ly155331445 Note Added: 0094370
2020-09-10 14:12 dpasukhi Assigned To ika => dpasukhi
2020-09-10 14:12 dpasukhi Status feedback => assigned
2020-09-13 20:20 git Note Added: 0094687
2020-09-14 14:45 dpasukhi Note Added: 0094735
2020-09-14 15:52 dpasukhi Note Added: 0094743
2020-09-14 15:52 dpasukhi Assigned To dpasukhi => gka
2020-09-14 15:52 dpasukhi Status assigned => resolved
2020-09-14 15:52 dpasukhi Assigned To gka => dpasukhi
2020-09-14 15:53 dpasukhi Status resolved => assigned
2020-09-14 15:54 dpasukhi Assigned To dpasukhi => ika
2020-09-14 15:54 dpasukhi Status assigned => resolved
2020-09-14 15:54 dpasukhi Steps to Reproduce Updated
2020-09-14 20:23 ika Note Added: 0094775
2020-09-14 20:23 ika Assigned To ika => bugmaster
2020-09-14 20:23 ika Status resolved => reviewed
2020-09-19 15:41 bugmaster Test case number => bugs/step/bug31711
2020-09-19 17:19 bugmaster Note Added: 0095066
2020-09-19 17:19 bugmaster Status reviewed => tested
2020-09-20 10:55 bugmaster Changeset attached => occt master 2547d979
2020-09-20 10:55 bugmaster Status tested => verified
2020-09-20 10:55 bugmaster Resolution open => fixed
2020-09-20 11:14 git Note Added: 0095132
2020-12-02 16:43 emo Fixed in Version => 7.5.0
2020-12-02 17:13 emo Status verified => closed