Chaining crashes the debugger

Apr 13, 2010
315
7
61
The Hague
Using latest version, calling one batch from another without the use of the "call" command while debugging causes the debugger to crash.

Actually does that for many versions of TCC.

Regards,

DJ
 
Aug 3, 2016
376
9
Netherlands
That seems somehow "logical": you are debugging a batchfile that is no longer running /active.
I created a batchfile to reproduce this behaviour:

Code:
echo Goedenmiddag!
EXIT

Same behaviour ...

But I might miss out on something (or two), because this is literally the first time I started IDE.exe
 
Aug 3, 2016
376
9
Netherlands
WAD, and not a crash -- EXIT tells TCC you want to shut down the session. And it does.

IDE did hang after the exit ("waiting-cursor" forever).
Can't reproduce it anymore. Now it just exits, like you said. Strange ....

Minor "issue": if you start IDE.exe from a CMD prompt, afterwards the window title is set to "ide" and the prompt is not shown. [Enter] fixes that last one.
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
Minor "issue": if you start IDE.exe from a CMD prompt, afterwards the window title is set to "ide" and the prompt is not shown. [Enter] fixes that last one.

Assuming you're in a console session (not a TCMD tab window), the title change is being done by CMD, not IDE.

The prompt issue is unreproducible here (and cannot possibly be related to IDE, which is a GUI app running in a separate session). When you start IDE.EXE from a CMD prompt, CMD displays a new prompt immediately, because it's not waiting on the GUI app for anything.
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
Source is linked to this message.

I created a "TCApp.BTM" that just echos something and waits for a key before quitting. I tried starting AppDispatch.BTM with an "auto" argument and ran the batch debugger both from a TCC console window and a TCMD tab window. It worked perfectly chaining directly in both cases (and also when using CALL).

You say that chaining is "crashing the debugger" - are you actually getting a crash dialog from Windows? If so, please send the contents of that dialog. (And if you are, it's almost certainly coming either from Windows or from third-party injected code, as IDE does its own exception handling.)

If IDE is crashing in its internal code, it will create a log file named "IDE.exception.log". If you have that file, please post it here. (If you don't have it, the crash isn't in IDE.EXE.)

IDE will load yout TCMD.INI and your plugins and run TCSTART before launching the batch file, so try starting IDE with the /I option to disable TCMD.INI, plugins, and TCSTART.
 
Aug 3, 2016
376
9
Netherlands
Assuming you're in a console session (not a TCMD tab window), the title change is being done by CMD, not IDE.

You are right, the title change *is* done by CMD. When you strart "ise.exe", everything OK; starting "ise" (without the .exe) gives the new ise title right away. To make sure I copied ide.exe to abc.exe and started "abc" : title = abc.

Regarding the prompt: 100% reproducable here :-) . But I don't concider this as something worth looking further into. It might even be some quirk in my system.
 
Apr 13, 2010
315
7
61
The Hague
Sorry. It took a while to get back at you.

Enclosed two screenshots. "Crash" should be understood as an unhandled exception in IDE.exe, followed by an Access violation, followed by a restart of the IDE/debugger.

If you want I could install a screen recorder and mail you the video. However, sending more source files would probably add to the confusion.

Please let me know if you plan to look into this any further and what info would be helpful. Note that I have a workaround for my problem.

I do think there is a vulnerability here, somewhere. If I may suggest something - what might be a rare condition and perhaps therefor untested - is:

process A (deferring something) - chaining to B - chaining to C

When is the deferred action executed? Before B or after C? Just a thought.

Regards,
DJ.
 

Attachments

  • Visual Studio info.PNG
    Visual Studio info.PNG
    11.6 KB · Views: 91
  • Visual Studio info2.PNG
    Visual Studio info2.PNG
    6.3 KB · Views: 89
Apr 13, 2010
315
7
61
The Hague
I can reproduce the error with these simplified source files

Regards, DJ
 

Attachments

  • AppDispatch.BTM
    1.1 KB · Views: 85
  • MyApp.BTM
    79 bytes · Views: 86
  • TCApp.BTM
    436 bytes · Views: 90

rconn

Administrator
Staff member
May 14, 2008
12,404
152
I do think there is a vulnerability here, somewhere. If I may suggest something - what might be a rare condition and perhaps therefor untested - is:

process A (deferring something) - chaining to B - chaining to C

When is the deferred action executed? Before B or after C? Just a thought.

The deferred action is executed when the current batch file exits. That means if you chain to another batch file without a CALL, the DEFER will be done before executing the second batch file.
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
Sorry. It took a while to get back at you.

Enclosed two screenshots. "Crash" should be understood as an unhandled exception in IDE.exe, followed by an Access violation, followed by a restart of the IDE/debugger.

The crash is actually in Microsoft code (as was shown by the exception address). I was able to reproduce it and track it that far.

I can't fix their crash, but I added a workaround in build 21 to prevent it from calling the bad code.
 
Similar threads
Thread starter Title Forum Replies Date
vefatica Chaining and piping? Support 2
thedave Problem chaining piped FIND commands in BTM Support 7
C Chaining INI for TCMD 8, 9, and 10 Support 1
Jay Sage TCMD Crashes with "tctoolbar /c /r file" Support 5
S Take Command crashes for aliases with length > 1015 Support 1
C Fixed V25 crashes when adding and then removing in the tabbed toolbar Support 3
S tcc crashes Support 3
L FTYPE crashes TCC v23.00.30-34 Support 17
A Fixed [23.0.22]: TCMD crashes shortly after start, TCC keeps running in background Support 6
vefatica TPIPE.EXE crashes on Ctrl-C Support 9
Mike Applebee SHRALIAS crashes on startup Support 2
vefatica TPIPE crashes on Ctrl-C Support 1
M TCC Crashes... Support 3
vefatica IDE crashes every time Support 6
MickeyF TCC v16 crashes when I hit F1 to view help Support 9
cgunhouse Version 19.00.23 Crashes Support 16
G Linux curses (full screen) crashes TC Support 1
MickeyF BDebugger crashes Support 2
T Closing multi-tab TCMD crashes Support 4
M tcmd crashes in this recursive "for /f" loop Support 4
S Fixed TC crashes with a certain batch file Support 6
vefatica DATEMONITOR + Ctrl-C crashes TCCv15 Support 5
A WAD Dir daterange + multiple path wildcards crashes tcc Support 2
vefatica TCSH crashes only when in a TCC console Support 2
M WAD tcmd.exe crashes and leaves an orphaned tcc.exe process Support 6
Peter Murschall TCC 13.03 Build 30 crashes on VER /R Support 15
D ftp crashes tcmd v12.11 and 13.01 Support 10
H Ruby - Running External Ruby script crashes TCC Support 11
gschizas Take Command crashes with TELNET Support 9
T eval[] crashes with negative binary output Support 1
S Crashes when using SFTP Support 7
krischik ERASE crashes TCC Support 10
krischik SYNC crashes TCC Support 6
nikbackm Piping to new TCC instance crashes it Support 1
rfaquino TCMD 12 always crashes when exiting Support 7
cgunhouse IDE Crashes on Exit Support 6
I TCC crashes on gosub after long command line Support 0
D Strange crashes in @CRC32 and @MD5 Support 9
gschizas pdir crashes horribly in one specific folder Support 5
Ville BUG: 'dig' of bind 9.6.0 P1 crashes when used with TC10 Support 6
Phileosophos TCMD 10.00.57 crashes for want of python26.dll Support 5
C for /r %s crashes TCC Support 3
old coot Problem with INS key flag in the debugger status bar Support 3
S Debugger keeps breaking with no break point set. Support 1
D Layout debugger windows Support 2
R Batch Debugger Command Expansion Window Support 3
S Debugger menu absent Support 10
MikeBaas Using the debugger Support 2
R Take Command Debugger v22 ENDCOMMENT not bolded Support 6
K Batch debugger not stepping correctly Support 4

Similar threads