Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334938

Summary: gconf tool throws errors during file save
Product: [Technology] RTSC Reporter: Amit Mookerjee <amitm>
Component: CoreAssignee: Sasha Slijepcevic <sascha>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: d-russo, karl
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: target:3.20.08
Attachments:
Description Flags
config.Shell control flow none

Description Amit Mookerjee CLA 2011-01-20 14:35:09 EST
Steps to reproduce problem
--------------------------
1. Install ccs4.20 and XDCtools 3.20.05 release
2. Create a BIOS5 project 
3. Open up gconf by doubleclicking the "tcf" file
4. Make some changes to the config script and press the save button
5. Make some more changes and press save. The second time around gconf puts up the
following error message in a dialog - CScriptPane::XScriptPaneEventSink::Save failed. The file cannot be saved in gconf.

Note that this problem goes away when XDCtools 3.20.04.68 is used.

Take a look at http://e2e.ti.com/support/embedded/f/355/p/87640/309675.aspx#309675
for the forum post on this issue.
Comment 1 Sasha Slijepcevic CLA 2011-01-25 15:54:04 EST
Created attachment 187575 [details]
config.Shell control flow
Comment 2 Sasha Slijepcevic CLA 2011-01-25 17:20:50 EST
The bug is caused by an unclosed file handle in config.Shell. A handle opened in processLoad was not closed in evaluateLoad, as it should be following the pattern established in processFile and evaluateReader.
The attached image shows the Shell architecture. GConf calls into Shell through TCF. TCF is passing the line 'load(<scriptName>);' to processLine, which then gets evaluated in processLoad->evaluateLoad, where the bug gets exposed.

The same problem can be demonstrated in Tconf, if it's run interactively from the command line. When the Tconf from 3.20.06 release is used, the following command will capture a handle to hello.tcf, and the saving of changes to hello.tcf in a text editor will be disabled even after the command returns:
js> utils.load("hello.tcf");
js>

Only when the user exits Tconf, saving hello.tcf in an editor will work.

With a fix implemented, after utils.load is invoked, hello.tcf can be saved in an editor even before the user exits Tconf.
Comment 3 Sasha Slijepcevic CLA 2011-01-25 18:00:04 EST
- fixed in xdcutils-f05
Comment 4 Karl Wechsler CLA 2011-01-31 13:13:07 EST
verify pass.

I reproduced (again to be sure) with 3.20.07.xy release and see the problem.

I installed 3.20.08.87_eng and did multiple modify/save cycles and I no longer get this exception.

verify pass.
Comment 5 Dave Russo CLA 2011-06-20 14:35:29 EDT
Shipped in XDCtools 3.20.08