Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Cannot Exit TCC Tab with Build 73

Jun
1,092
48
I installed build 73, and a number of things are not working.

First, when I run the EXIT command, TCC hangs. It runs TCEXIT at least as far as the last line of code. I'm actually pretty sure that TCEXIT is running to the end, and then the session hangs.

Then I discovered that the tabbed toolbar does not work if the TCMD window is made narrow enough that the commands wrap. Well, actually, it seems that the toolbar does not wrap correctly or completely. Some commands have disappeared into the right gutter area, and then commands stop working when clicked.

I tried changing the size of the TCMD window to see if the display artifacts no longer appear, but they do. At certain widths, some vertical lines become twice as wide as they were. The letter 'N', for example, does not look good when one of the vertical lines is twice as thick as the other.

Here is the information about my configuration.

TCC 36.51.73 x64 Windows 11 [Version 10.0.26200.8655]
TCC Version: 36.51.73
TCMD Tab: Yes
ConPTY: Yes
Console Type: PseudoConsoleWindow
Elevated: No
 
I just tried removing TCEXIT.BTM, and a TCC tab hangs on the EXIT command.

And I tried it in a standalone TCC session. It hangs there, too.

Did something go wrong in my installation?
 
Whenever I install a new version, the option for including 'X' in the tab to close it reverts to "none". Now that I have reset it to "All tabs", I discovered that clicking the 'X' does close the tab. It does not, as far as I can tell, run TCEXIT, but the tab does close.
 
First, when I run the EXIT command, TCC hangs. It runs TCEXIT at least as far as the last line of code. I'm actually pretty sure that TCEXIT is running to the end, and then the session hangs.

Not reproducible here. What is in your TCEXIT? And are you running plugins?

Then I discovered that the tabbed toolbar does not work if the TCMD window is made narrow enough that the commands wrap. Well, actually, it seems that the toolbar does not wrap correctly or completely. Some commands have disappeared into the right gutter area, and then commands stop working when clicked.

Well, that's true - but that's not new in 36.51.
 
I tried changing the size of the TCMD window to see if the display artifacts no longer appear, but they do. At certain widths, some vertical lines become twice as wide as they were. The letter 'N', for example, does not look good when one of the vertical lines is twice as thick as the other.

Also not reproducible here. What is the DPI & scaling on your monitor?

What font & point size are you using?

Do you see the artifacts when dragging the window wider or when dragging it narrower? Or both?
 
Yes, if I start a session with no plugins, it closes correctly. Now I'll try to figure out which plugin is causing the problem.

Step 1: I loaded a session in the usual way and then tried to remove the plugins using plugin /u *. TCC hangs.

Step 2: Figure out which ones are causing the problem. That may take some time, so I'll report separately.
 
The monitor display is "3440 x 1440 (Recommended)", and the scale is "100% (Recommended).
 
When I run *plugin /L PluginDir\plugin.dll, specifying a specific plugin in the default folder, all the plugins there get loaded. Is that normal?

[I may have made a mistake when that happened. Please disregard for now.]

Yes, I was in a TCC session that had all the plugins loaded. Sorry.

However, I did just discover that the PLUGIN command does not understand directory aliases. I kept getting "not found" errors until I used Ctrl-W to expand the directory alias I was using. Do I need to add that to the suggestion list?
 
  1. CMath can be loaded and removed.
  2. FileUtils can be loaded and removed.
  3. FixNames-x64 can be loaded and removed.
  4. FunctionHelp can be loaded and removed.
  5. ProcTree.dll can be loaded and removed.
  6. sysutils64.dll can be loaded and removed.
  7. TextUtils-x64.dll can be loaded and removed.
  8. WindowInfo.dll can be loaded and removed.
Well, that's all of them! So each one by itself is OK. Ughh.
 
Well, I've narrowed it down a little. I cannot load the first four listed above and then remove them. TCC hangs on the removal.

The first two are OK together. Numbers 3 and 4 together hang.

Functionhelp with CMath hangs. I'm suspecting FunctionHelp. Yep, that's it. The other seven can be loaded and unload. And one can exit from TCC after they have been loaded.
 
However, I did just discover that the PLUGIN command does not understand directory aliases. I kept getting "not found" errors until I used Ctrl-W to expand the directory alias I was using. Do I need to add that to the suggestion list?

You can add it to the suggestion list, but PLUGIN is IMO not something that would benefit from directory aliases.
 
Well, I've narrowed it down a little. I cannot load the first four listed above and then remove them. TCC hangs on the removal.

The first two are OK together. Numbers 3 and 4 together hang.

Functionhelp with CMath hangs. I'm suspecting FunctionHelp. Yep, that's it. The other seven can be loaded and unload. And one can exit from TCC after they have been loaded.

TCC doesn't have any control over how the plugins unload - TCC just calls their shutdown API and waits for the return to continue. If the plugin doesn't return TCC will hang.

And since I don't have the source for those plugins I can't trace it here. Those plugins aren't in the Plugins Manager directory, so I can't even try them here.
 
Your help file says the following about directory aliases:

You can then reference the files in c:\program files\jpsoft by entering pf:\jpsoft. Directory aliases work in places that accept filenames and directory names (internal command arguments or the first argument in a command line), including filename completion. You cannot use them in arguments to external applications, as TCC has no way of knowing what is a valid argument for external applications.​

The help does not warn that they work in only some internal commands (and who knows which ones until a problem occurs, as just happened to me). Until you do make them work with all internal commands, I guess I'll have to make an alias for the command that expands them manually.
 
Obviously something changed between build 71 and build 73. I'll try to figure out whose plugin that is (or, quite likely, they will see this discussion) and let them know that there is a problem.
 
Obviously something changed between build 71 and build 73. I'll try to figure out whose plugin that is (or, quite likely, they will see this discussion) and let them know that there is a problem.

Nothing changed in the plugin loading & unloading code. The only things that changed in TCC were some additions to START and a minor change to XHISTORY.

Since I don't know what the plugin is doing when TCC calls the shutdown API I can't guess why it's hanging.
 
It's mine and yeah, something bad is happening during ShutdownPlugin() if called by the shell unloading. Nothing in that plugin has changed in ages, and it works as expected in v35. Something must have changed in v36.5x.

All it's doing is freeing malloced memory blocks. There are a metric buttload of those, but the process only takes a fraction of a second.
 
Also, shutdown works as expected in v36.51.73 when the plugin is unloaded with PLUGIN /U. I can't imagine TCC's shutdown is timing out waiting on mine — it's very fast. Feels more like memory is getting corrupted somehow.

Rex, is it possible that TCC is doing its own cleanup? Freeing my memory before I free it, or simultaneously?
 
Also, shutdown works as expected in v36.51.73 when the plugin is unloaded with PLUGIN /U. I can't imagine TCC's shutdown is timing out waiting on mine — it's very fast. Feels more like memory is getting corrupted somehow.

Rex, is it possible that TCC is doing its own cleanup? Freeing my memory before I free it, or simultaneously?

No.

TCC is waiting on a synchronous call to the shutdown API in the plugin. TCC doesn't time out; it'll wait forever for the plugin to finish & return.

TCC has no idea what memory the plugin may have allocated. TCC certainly is not doing any free's of any memory but its own.

It's possible that there's a memory corruption happening somewhere (in TCC, in another plugin, in Windows, in a third-party injection). That should be fairly straightforward to locate by running the VS debugger.

Nothing changed in the relevant TCC code in the last few builds. TCC is using an updated MSVC++ version; it's possible there's a compiler or RTL issue, or that it just exposed a latent issue by moving everything to a new address.
 
Unless you're passing your allocated memory pointers back to TCC somehow, TCC would never know you allocated and freed memory.

If you were free'ing a bad pointer or had a corrupted block, your DLL would crash and TCC would exit. But that's apparently not what's happening -- you're looping or stuck somewhere.
 
Type exit I get this continuous run of lines. Have to close using the x
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:40 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:40 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:40 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:40 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:41 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:41 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:41 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:41 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:41 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:41 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:41 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:41 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:41 Philip Thornton [DESKTOP-5DI193L]
c:\program files\jpsoft\tcmd36>Thu 16-07-26 2:09:41 Philip Thornton [DESKTOP-5DI193L]
 
Strange that memory should get corrupted when the shell exits, but not otherwise.

Anyway, if I know that the shell is exiting, then I don't actually have to clean up my heap. Windows will clean up after me. I've posted a new build with this tweak: FunctionHelp Plugin Jay, Thornton, if you wouldn't mind testing it?

But I do feel that I'm working around an issue that should probably be addressed. Something is different in v36.51 shutdown.
 
I just installed the new version. EXIT now closes TCC without hanging. Thanks for the fix.
 
Back
Top