HP3000-L Archives

April 2002, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Joan Entwistle <[log in to unmask]>
Reply To:
[log in to unmask][log in to unmask], 3 Apr 2002 17:02:25 -0600546_iso-8859-1 Well, if you mean that the LIST array presented to IMAGE is smller than the
string needed to contain the entire list the most obvious would be a -52
status returned by DBGET, since the list would probably contain what IMAGE
would consider to be an invalid data item name.

If you mean that the length of all the items in the LIST presented to DBGET
is longer than the BUFFER allocated to hold them, you'd have a classic case
of buffer overrun, and anything up to and including a program abort is
probable. [...]39_3Apr200217:02:[log in to unmask]
Date:
Thu, 4 Apr 2002 11:11:39 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (87 lines)
Would using $CONTROL BOUNDS on the COBOL compile catch this?



                    "David T
                    Darnell"              To:     [log in to unmask]
                    <David.T.Darne        cc:
                    [log in to unmask]>            Subject:     Re: [HP3000-L] IMAGE
                    Sent by:
                    "HP-3000
                    Systems
                    Discussion"
                    <HP3000-L@RAVE
                    N.UTC.EDU>


                    04/04/2002
                    10:46 AM
                    Please respond
                    to
                    David.T.Darnel
                    l





Joe,

Plenty of people have already indicated that what you get is extremely
unpredictable program behavior, due to overwriting of whatever data space
happens to be "to the right" of your buffer area. I've seen people get bit
on this when the dataset record length increases and the buffer definition
does not get changed accordingly. This can 'lurk' for a long time as that
occasional bug that can't be reproduced in captivity, or it could just
plain cause something obvious like an abort.

There are coding methods to help prevent this problem, such as defining the
dataset structure once and only once in an $include or copylib. In FORTRAN,
you can also code a test for this by combining the proper Image calls
(dbinfo, etc.) with the LEN function ("LEN(IMAGEBUFFER)"). That is, code to
determine the number of bytes to be returned and compare it to the actual
buffer length.

FORTRAN has a number of functions or intrinsics that will yield information
about variables (metadata ?) - and it can be worth the extra resources
required to have a program test it's own assumptions.

-dtd








Joe Amuquandoh <[log in to unmask]>@RAVEN.UTC.EDU> on
04/03/2002 03:45:04 PM

Please respond to Joe Amuquandoh <[log in to unmask]>

Sent by:  HP-3000 Systems Discussion <[log in to unmask]>


To:   [log in to unmask]
cc:
Subject:  [HP3000-L] IMAGE


Hello all,

In IMAGE DBGET, what happens if the LIST of ITEMS is longer than the BUFFER
being put into.
Besides the obvious truncation, is there any impact?

Thanks.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2