[Info-vax] Home-grown application process dumps
Stephen Hoffman
seaohveh at hoffmanlabs.invalid
Tue Jan 6 10:17:34 EST 2015
On 2015-01-06 06:09:28 +0000, David Froble said:
> Stephen Hoffman wrote:
>
>> If that's not it, I'd start looking for a memory heap corruption, as
>> those can blow out all over the place, and with all sorts of odd
>> errors. With BASIC, that's usually some system service call or similar
>> that exceeds the size of the string that's been presented to the system
>> service call — system services generally don't re-size or extend
>> dynamic string descriptors, the calls just keep writing however much
>> they've been asked to write. Ten pounds of bytes into a five-pound
>> string buffer makes for a corrupt heap, after all.
>
> I agree with what you wrote, until this paragraph. Maybe I don't
> understand what you wrote, but, my impression is that when working with
> a descriptor, VMS will not write past the defined length of the data.
If the called API is also using descriptors, yes, you'll either get the
data, whether exact-fit, truncated or padded. If the storage
allocated to the descriptors is being used as a buffer however,
overruns are possible. System services that use descriptors assume
all descriptors are static, and don't try to re-size them. System
services that expect buffers and that get passed the address of a
buffer based on the buffer allocated for a dynamic string can clobber
the heap.
Descriptors are a clunky and somewhat limited version of an object, in
a newer language. Descriptors were a good idea when they were created,
but they're kind of annoying to deal with compared with how objects
have been integrated with other languages and programming environments.
Folks have used and have greatly improved on the idea of descriptors.
--
Pure Personal Opinion | HoffmanLabs LLC
More information about the Info-vax
mailing list