gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GnuCOBOL-users] IS INITIAL breaks numeric literals in called subpro


From: Simon Sobisch
Subject: Re: [GnuCOBOL-users] IS INITIAL breaks numeric literals in called subprogram on 2nd call?
Date: Tue, 21 Aug 2018 21:16:51 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hi Jay,

the first thing I did was
https://sourceforge.net/p/open-cobol/bugs/search/?q=initial

which leads to

Bug #431 - Decimal constants not initialized in INITIAL programs
https://sourceforge.net/p/open-cobol/bugs/431/

originally reported by Jay Moseley directly after the 2.2 release.

Is this the same case you have?
It sounds like applying the patch
https://sourceforge.net/p/open-cobol/code/2096/#diff-3

will give you a working version with 2.2 (patched).


The original plan was to create a 2.3 one with important fixes but the
team decided to spare the additional work and we start the 3.0 baseline,
with REPORT-WRITER module and SPARSE KEYS support.

While it is not final and there are more things to come for the upcoming
(and hopefully last) release candidate the 3.0 codebase is considered
more stable than 2.2.

I recommend to switch to GnuCOBOL 3.0rc-1, if possible.
https://alpha.gnu.org/gnu/gnucobol/

Note: In any case thank you for the bug report, which also has an impact
on current development - the old testcase for the bug was just extended
with your sample (and passes as all the other INITIAL tests do).

... I really suggest to use 3.0rc-1 over 2.2

Simon


Am 21.08.2018 um 20:19 schrieb Jay Summet:
> I'm using gnucobol2.2 and ran into a confusing circumstance that did not
> exist when the same code ran in version 1.1.
> 
> When calling a subprogram which used "IS INITIAL" like so:
> 
> PROGRAM-ID. ProgramName IS INITIAL.
> 
> Code inside the program such as:
>            MULTIPLY PRICE-LOW BY 1.10 GIVING WS-TEMP
> 
> Would fail with an "attempt to access unallocated memory" type error.
> (But only on the second call to the subprogram, the first worked as
> expected).
> 
> The issue was the literal 1.10, and not WS-TEMP or PRICE-LOW, which took
> a bit of debugging to figure out...
> 
> For example
> MOVE 1.10 TO WS-TEMP
> MULTIPLY PRICE-LOW BY WS-TEMP GIVING WS-TEMP
> 
> would work without issue on multiple calls. (Also, if I removed the "IS
> INITIAL" from the identification division either set of code worked fine.)
> 
> My question:
> Is this a known bug (or feature?)
> 
> I'm able to work around it using either the inital MOVE or removing the
> IS INITIAL, but I'd like to understand why it's happening. (And did NOT
> happen with Gnu Cobol 1.1)
> 
> Thanks for any insight. If needed I can attempt to provide a simplified
> sample program that demonstrates the error, but I was hoping somebody
> with more experience already knows the answer....
> 
> Jay
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]