WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Error Codes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Internal Dynalloc Tag Overwrite Error

Keywords:  internal dynalock tag overwrite error  fileitemize

Internal Dynalloc Error with FileItemize

This error happens sometimes, because FileItemize does two passes when itemizing a list. The first pass is to see how much space it needs, and the second pass is grabbing the information and filling the alloted space. If a program updates a file in between the two passes, and therefore the space needed changes, this error occurs. This bug was fixed in WinBatch 5.X.

Internal Dynalloc Error with DllCall

Question:

When I attempt this line:
RHCode = DllCall(HUnRAR,long:"RARReadHeader",long:hArcData,lpbinary:HeaderData)
the first time it works fine, I get the proper data, the second time I call it, I immediately get a window that pops up saying:
        INTERNAL DYNALLOC ERROR

        Tag Overwrite 1
With an OK button, WinBatch basically hangs, as pressing OK just brings back the window.

Answer:

When you get the tag overwrite, you've obviously returned from the Dllcall, so you've gotten that far. The TAG overwrite errors indicate that our internal string space buffer has managed to get toasted. Usually the DllCall is mis-structured. But the good news is that you've accomplished a lot to finally arrive at this error... this is one of the last steps in getting your DllCall to work.

The DLL call you have in the code you supplied is correct. I suspect a pointer in your structure is either bad or the structure size is too small, and data is being written semi-randomly in the WinBatch data space.

Oftentimes I do a:

        BinaryWrite(dabuffer,"C:\DEBUG.TXT")
And then look at a hex dump of the resulting file (perhaps with Browser...) to ensure the buffer is properly set up.

The reason is, sometimes people pass a string, like lpstr, and they try to modify that string variable. You can't do that, because it doesn't work right with Winbatch. In a string space variable, when you do any operation with WinBatch that has a string, we have a chunk of memory that we store that string in. For example, if you have a 30 byte string, we allocate maybe 38 bytes to allow for tags on either side of the string. If the tag is destroyed by messing with the string, Winbatch thinks that something has come through and corrupted the data space memory (our internal string space buffer).

If you are having problems with the DllCall, you can always e-mail us the DLL specs and your DllCall statement, and we can take a look at how you have it set up.


Internal Dynalloc with Memory Error

Question :

I have a WinBatch program that collects file information. On some machines, I get the following errors:

-A dialog comes up that has the title "INTERNAL DYNALLOC ERROR" and the text "Tag Overwrite 1"

- Then a dialog comes up that has the title "3096:Memory Allocation Error. Out of memory for strings", and the line the error occored on which is a StrCat.

This happens in a loop that has already gone through many times. The number of times doesn't seem to matter because it will get 400+ files on one machine, and only 150 or so on another.

The same variables are redefined over and over in the loop. Do they re-allocate each time? Do I need to drop them each pass through the loop?

Answer:

The "Tag Overwrite" errors are *really* hard to get.

In general the only way you could possibly cause them are:

  1. An incorrectly coded DLLCall.

  2. Doing OLE or DDE with some application that is not completely correctly coded.
Tag overwrite errors are reported when WinBatch string space is overwritten. In the front and at the end of every string stored in the WinBatch string space is a "tag". Whenever the string is freed, the tags are checked to verify they are still intact.

The error is reported when the tags are missing.


Internal Dynalloc Tag Overwrite Error with FileVerInfo

Question:

I'm using the Searcher extender and on each file handle, I'm using FileVerInfo to get some information back on some HP Driver files, e.g. HPRCFG07.EXE in the Windows\System subdirectory. Any idea what's wrong?

Answer:

The FileVerInfo function is sick. The error is caused by seemingly invalid data returned by some HP printer files to the FileVerInfo function. It will be fixed in the next release (99H).

Another Internal Dynalloc Error with Tag Overwrite

Question:

I get an INTERNAL DYNALLOC ERROR message, with either a tag overwrite 2 or 1 or seometimes both in succession. I am not performing any DLL calls or file itemisations. I do have a couple of lists of strings that I parse and sort. the script is a loop that downloads a text file (with a list of other files) from a web server and then pulls down the other files if it doesn't already have them.

I have tried setting debugtrace on to see if I could see where it was failing.

Here are two sections of log just before a dynalloc error and the section of code (sorry, a bit long):

Any suggestions of what may be causing the errors?

I have quite a few if/endif statements.

Answer:

Whoa. This is a good one. Not too many people get to see Internal Dynalloc errors.

Those errors generally indicate that the WinBatch string storage area's are getting trashed.

Re-read the section on if-else-Endif statements. You seem to be combining two incompatible forms, and this may be triggering the problem.

Actually, nothing is clear at this point, but it looks like a good suspect.

You can have:

If (expression) then (statement)
Else (statement)
or you can have:
if (expression)
(statements)
else
(statements)
endif
However:
If (expression) then (statement)
else
(statements)
endif
may not be doing what you think it should be, and it is comprises of two incompatible if type expressions. You have to go for either single line mode or structured mode. Mixing them tends to run, but not with what most people might consider obvious results.
Article ID:   W12978
Filename:   Internal Dynalloc Tag Overwrite Error.txt
File Created: 2001:07:26:16:49:28
Last Updated: 2001:07:26:16:49:28