TCC crashes on gosub after long command line

Jul 31, 2010
12
0
I spent about a day tracking down and finally reproducing a strange crash in TCC. The crash occurs on a gosub with arguments to a label in a named script.

Later .. I found an easier way to reproduce.
Create two batch files:

BUG1.btm
setlocal

set BUG1=%[_batchname]
call Bug2.btm
quit 0

:LogError [Text1 File1 Find1]
@echo BUG1 : LogError called OK
@echo Text1 = %[Text1]
return

BUG2.btm
grep.exe This statement has a command line length of more than 400 or so characters This statement has a command line length of more than 400 or so characters This statement has a command line length of more than 400 or so characters This statement has a command line length of more than 400 or so characters This statement has a command line length of more than 400 or so characters This statement has a command line length of more than 400 or so characters
rem grep.exe This statement has a short command line
pause gosub is next
gosub "%[BUG1]" LogError "This"
quit 0

Run BUG1.btm
Crashes on Vista with tcc 11.00.51
rem out the first grep.exe, un-rem the second and it works fine.

Old comment, only of historical interest ;-) ...
A zip file is attached that reproduces the crash (on this Windows Vista system). Running CrashTcc.btm:
- Unsets all environment variables.
- Restores the original environment variable from CrashTcc.env.txt
- Sets TMP to this directory.
- Calls clean\clean-lib.mvs2010.win.debuga.bandc6.gen.btm, which:
- Runs an exe with a long (400+ characters) command line
- Calls bin/mm.btm by:
gosub "%[MM]" LogError error-text
and dies

There are a few explanatory
pause
statements just before the crash point

TCC does NOT crash:
- if the environment variables are not restored
- if the executed command has a shorter command line.

The command is currently a GNU grep.exe; I tried various ones One utility I have here subsequently gave the error:
TCC: H:\v\hai\trunk\hai\bin\mm.btm [1756] Label not found "????????????????????????"
(The ?'s appeared as square box characters on the console).

If you edit to use a shorter command then it WORKS OK
It seems the GOSUB only crashes after running an exe with a LONG COMMAND LINE!


Additional info:
CrashTcc.pdf The crash popup
CrashTcc.ver.txt ver /r details (I had the problem with 11.00.48 and upgraded to 51, without avail)
TccInstalDir A copy of the tcc install directory
 
Similar threads
Thread starter Title Forum Replies Date
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
M TCC Crashes... Support 3
MickeyF TCC v16 crashes when I hit F1 to view help Support 9
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
H Ruby - Running External Ruby script crashes TCC Support 11
krischik ERASE crashes TCC Support 10
krischik SYNC crashes TCC Support 6
nikbackm Piping to new TCC instance crashes it Support 1
C for /r %s crashes TCC Support 3
MickeyF TCC crashing when copying multiple files (now resolved) Support 6
C COMSPEC constantly reset to TCC.EXE Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT v28 Released Support 0
C How to? starting TCC/TCMD v25 Support 2
CWBillow TCC and TCMD in Powershell Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.24 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.23 uploaded Support 0
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT v27.01 Build 22 Uploaded Support 0
L FTYPE in TCC, less quirky than in cmd.exe Support 3
V Set path permanently from within TCC? Support 3
DrusTheAxe Runaway TCC.exception.log filling drive Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.21 uploaded Support 0
Joe Caverly tcc.exception.log Support 3
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.20 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.19 Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
vefatica SCRIPT ... TCC disappears Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT v27.0.18 Support 0
Jesse Heines Access Denied errors in TCC 27 Support 9
fpefpe How to? tcc inifile (%_ininame) Support 3
M How to? Black TCC Prompt Support 2
D Differences between TCC and CMD with COPY /b Support 4
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
Jay Sage Extra TCC Tasks Support 6
vefatica Can I turn off the minimize to tray mechanism in TCC? Support 5
N Command execution slows down in TCC Prompt after a while Support 6
R Upgrade TCMD 19 to TCC 26 Support 1
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
samintz How to? Is this doable in TCC? Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 26.02.41 Uploaded Support 0
D TCC tab detaching & restarting Support 3
Ó Recent git output not shown on TCC Support 1
P Kill all other instances of tcc from a btm batch file Support 2
L Using TCC.exe through an SSH connection Support 3
M TCC color issue in ConEmu Support 4

Similar threads