#1
|
|||
|
|||
Bad allocation error
Hi
I have got this error: "Error firing vbld_StepDone event: Error in Step (VBScript) script code at Line 17, Column 1 (bad allocation)" where the code referred in vbld_StepDone event is: strLastStepOutput=Application.ExpandMacros("%LASTS TEP_OUTPUT%") I checked and Application.Options.MaxStepOutputLength = 0 I checked and the output of last step is quite big,can this be the cause? Any idea how to solve this issue? |
#2
|
|||
|
|||
Re: Bad allocation error
Quote:
Quote:
1) The info from Help | About | Install Info 2) A screen shot of System properties (Windows+Break) 3) A .bld file that we can build here which demonstrates the problem Thanks. |
#3
|
|||
|
|||
I have sent an email with everything you requested.
Output is 12051 lines long. Setting a limit to output length is not a good idea ,as I need to produce a report file containing differences between 2 files. I use fc.exe in order to compare them: fc.exe /LB1000 "C:\test\08.2.11.7\File.dis" "C:\test\08.2.11.12\File.dis" In vbld_StepDone I create the diff file based on last step output: Sub vbld_StepDone() Dim strLastStepOutput Wscript.Echo "******************************" strLastStepOutput=Application.ExpandMacros("%LASTS TEP_OUTPUT%") Wscript.Echo "******************************" Dim strCurrDiffFileFullPath strCurrDiffFileFullPath=Application.ExpandMacros(" %CURRENT_DIFF_FILE_FULLPATH%") Wscript.Echo "Current difference file is:"&strCurrDiffFileFullPath Const ForReading = 1 Const ForWriting = 2 Const ForAppend = 8 Set oFSO = CreateObject("Scripting.FileSystemObject") Set oFile = oFSO.OpenTextFile(strCurrDiffFileFullPath,forWriti ng,True) oFile.Write strLastStepOutput oFile.Close End Sub Is there any other way to create diff file without using %LASTSTEP_OUTPUT%? |
#4
|
|||
|
|||
Redirect the diff step's output to a file:
%DOSCMD% fc.exe /LB1000 "file1" "file2">%CURRENT_DIFF_FILE_FULLPATH% and read program output from that file if also needed in the build log. |
#5
|
|||
|
|||
ok,I changed this way,it works now,tks!
However pls let me know if you found a solution for the situation when using LASTSTEP_OUTPUT in order to avoid that bad allocation error appearing in case of big outputs I tried to limit the output to 100000 and there was no error so I guess the size of output caused the issues with bad allocation err. |
#6
|
|||
|
|||
Testing on a box with 2GB RAM, the build eventually completes without any errors. You may need more memory and/or a Windows Scripting update. But redirecting the program output directly to a file is much faster.
|
|
|