Menu

Now PDC430 & 431 are crashing - 3.9 works fine.

GnuCOBOL
David Wall
2021-12-15
2021-12-15
  • David Wall

    David Wall - 2021-12-15

    I started using a slightly different area of my major test program - which doesn't do anything unusual.
    It crashed with the following error:
    Assertion failed: str, file ../pdcurses/addstr.c, line 74

    This was using the absolute latest 3.2 together with the latest pdc431 built this morning.
    I tried again with same result.

    I rebuilt pdc 430 & the latest 3.2 and got the same error.

    I then went back to an older compiler version 3.1 built back in early 2020 which used pdc 3.9 and of course this worked perfectly.

    I have attached screen copies of my program (about to crash) running under 3.2 with pdc430 and 3.2 with pdc431 and finally running perfectly well under 3.1 with pdc 3,9.
    You will notice the screens are different - I'm not dummying this up.

    The error message does seem to point to pdc - however the particular file it complains about is identical in 430 & 431.

     
  • David Wall

    David Wall - 2021-12-15

    I also downloaded Arnold T's 3.1 with vbisam & pdc420 & it worked fine. ???

     
  • David Wall

    David Wall - 2021-12-15

    I just can't see where anything I'm doing is causing this - same source code - same compile batch file - all I do is point my batch to the relevant compiler & press enter - the program runs perfectly well 90% of the time but when I select this particular option it crashes part way thru.
    I'll see if I can narrow it down to a particular place.

     
  • David Wall

    David Wall - 2021-12-15

    I think I've got it - the field I'm displaying when it crashes is sometimes nul ie: hex 00 hex 00 and whilst 3.1 & pdc 3.9 & 420 seem to accept it - 3.2 & pdc430 & 431 obviously do not.

     
    • Simon Sobisch

      Simon Sobisch - 2021-12-15

      The analysis about the version is correct. The change was implemented in https://github.com/Bill-Gray/PDCursesMod/commit/96f4984f9fb76a0546b71e3018e441224fe747ed#diff-e0a7461708027686ffaf0bc372f77e2d73dd0e2f96a51d31f7610b4fad98e30a

      Are you sure you display a field with the content low-value? That should work completely fine.
      Or do you display a field or LINKAGE item which is for example BASED and does not have any data assigned?

      Is the "offending" program compiled with --debug? If not: Does the behaviour change if it is?

       
      • David Wall

        David Wall - 2021-12-15

        Yes - it's a 'based' field.

         
  • David Wall

    David Wall - 2021-12-15

    It's code i've inherited & don't quite understand the ramifications of it - basically there is a x(100) field which is 'based' (whatever that means). - I can't change that - it caused further complaints.
    This field is then partially displayed ie: field(1:5) which appears to be causing the problem when it is null. This didn't happen in 3.1 only in 3.2 or 4.x. I've sorta coded round it (again).
    Probably this can be bit bucketed as can most of my problems. :)

     
    • Simon Sobisch

      Simon Sobisch - 2021-12-15

      Please see the programmer's guide about BASED.
      Instead of asserting in PDCurses it should raise a nice abort when compiled with --debug - please recheck. If that isn't the case then there would be a bug in cobc. If it is the case you can fix the program (or at least not have it asserting without --debug, not abending with it [in that place]) by applying the following change:

      -        DISPLAY var
      +        IF ADDRESS OF var NOT = NULL
      +           DISPLAY var
      +        END-IF
      
       
  • David Wall

    David Wall - 2021-12-15

    I've recompiled with --debug & get the error - see attached - many thanks.

     
    • Simon Sobisch

      Simon Sobisch - 2021-12-15

      OK so everything is fine on the GnuCOBOL side and also on the PDCurses side.
      You may want to keep that option to let GnuCOBOL check for this program error and may want to apply change(s) like the one above in the program.

       

Log in to post a comment.