MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030377Open CASCADE[OCCT] OCCT:DRAWpublic2018-11-16 07:302018-11-20 11:37
Reporterabv 
Assigned Toabv 
PrioritynormalSeverityminor 
StatusnewResolutionopen 
PlatformOSWindowsOS Version
Product Version 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0030377: DRAW, Windows - command executed via option -c fails on puts
DescriptionIf some command or script executed using DRAW command line option -c contains puts command, it fails on Windows with a message

> can not find channel named "stdout"

In particular, this happens with command testgrid since it uses puts.

The reason is that Tcl creates separate instances of channels for standard streams (stdin, stdout, stderr) for each execution thread. Draw_Interpretor is initialized (during call to ReadInitFile()) for work in separate thread (created by Run_Appli() in Draw_Window.cxx) and contains channels that are created for that thread. When command given with -c option is evaluated from the main thread, Tcl does not find stdout instanced for that thread among the channels registered in the interpretor, so it fails.

To correct this, the command given by -c option should be executed in the appropriate thread (one of tkLoop).
Steps To ReproduceModify draw.bat to add "-c puts AAA" or "-c testgrid demo draw" as arguments to DRAWEXE, when run it
TagsNo tags attached.
Test case number
Attached Files

- Relationships
related to 0029996assignedabv Porting to VC 2017 : Regressions in visualisation 

-  Notes
(0081166)
abv (manager)
2018-11-19 14:37
edited on: 2018-11-19 14:49

It is discovered that when OCCT is built with ActiveState build of Tcl (configuration used in Jenkins tests), option -c works well on master.

Note that ActiveTcl behavior seems to be different from that of plain Tcl also for memory, see 0029996:0078253

(0081171)
bugmaster (administrator)
2018-11-20 11:26

Built tcl
draw.bat
@echo off

rem Setup environment and launch DRAWEXE
call "%~dp0env.bat" %1 %2 %3

echo Hint: use "pload ALL" command to load standard commands
DRAWEXE.exe -c env.tcl

Launch DRAWEXE with option -c caused error:

C:\OpenCASCADE-7.3.0-vc10-64\opencascade-7.3.0>draw.bat
Hint: use "pload ALL" command to load standard commands
Draw[1]> can not find channel named "stdout"

- Issue History
Date Modified Username Field Change
2018-11-16 07:30 abv New Issue
2018-11-16 07:30 abv Assigned To => apn
2018-11-19 14:37 abv Note Added: 0081166
2018-11-19 14:49 abv Note Edited: 0081166 View Revisions
2018-11-19 14:50 abv Relationship added related to 0029996
2018-11-20 11:26 bugmaster Note Added: 0081171
2018-11-20 11:37 bugmaster Assigned To apn => abv


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker