Archived issue #0028381

Draw Harness - DRAWEXE still hangs up immediatly when redirecting input stream on Windows

Open CASCADEOCCT:DRAWclosed11 public notes

Search issues

Description

The fix for issue #0028350 does not solve the problem on my machine (DRAW hangs up as before - see Attachment 1 (PNG) attached picture).

Steps to reproduce

Test case is not required.

Try in command window:

"draw.bat" - OK

"echo pload;exit | draw.bat" - HANGING

Public activity

11 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon Jan 23 11:05:16 2017 +0300

    0028381: Draw Harness - DRAWEXE hangs up immediatly when redirecting input stream on Windows
02Commenter 2
Dear Andrey,

Please review CR28381 branch. It fixes the problem on my machine.
03Commenter 3
+      else if (fgetws(console_command, THE_COMMAND_SIZE, stdin))
+      {// fgetws() works only for characters within active locale (see setlocale())
+        console_semaphore = HAS_CONSOLE_COMMAND;
+      }

Please instead try removing check "if (anErr == ERROR_INVALID_HANDLE)" so that "isConsoleInput = false;" is set for any error.

On my system it was ERROR_INVALID_HANDLE, while on yours it is ERROR_INVALID_FUNCTION - have no idea why error code is different.
04Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon Jan 23 12:17:26 2017 +0300

    Changes according to the last remarks.

05Commenter 5
Done.

Dear Kirill,

Please review the current state of CR28381 branch.
06Commenter 3
> Changes according to the last remarks.
This change should replace your original patch, not "include" it.
"else" statement will never occur because you are calling fgetws() before and GetLastError() has nothing to do with fgetws() return value.
07Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
08Commenter 8
Done.

Dear Kirill,

Please review the current state of CR28381 branch.
09Commenter 3
Please test the patch.
10Commenter 10
Dear BugMaster,

Branch CR28381 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 63
   Windows: 0
   MacOS: 1132

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 92983626 / 92067637 [+0.99%]
Total CPU difference: 21075.62000000011 / 21062.120000000155 [+0.06%]

Testing on Windows:
Total MEMORY difference: 58324735 / 58324216 [+0.00%]
Total CPU difference: 19385.43306479856 / 19152.585972198493 [+1.22%]
11Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]

Related records