Menu

#960 Complex ODO gets Windows GPF when running

unclassified
not-our-bug
nobody
5 - default
2024-04-04
2024-03-30
No

Hello,
I was going thru my programs and found one using a Complex ODO. It failed the
syntax check, so I changed the default.conf file (for me it is located in
C:\oc\config) to use Allow complex OCCURS DEPENDING ON = yes and noticed
the next flag, Adjust position of items following OCCURS DEPENDING, so I
set it to yes as well. My program then passed the syntax check but abended
at runtime. I looked again and found the flag for Perform type OSVS. I set
it to yes but I still get a Windows GPF; attempt to reference invalid memory address (signal).
Is there something else I need to set? IBM has an example that seems more complex
than mine; https://www.ibm.com/docs/en/cobol-zos/6.3?topic=depending-example-complex-odo
I am attaching a zip file with my source, exe file, jpgs and default.conf file.
Thanks, Vince

1 Attachments

Discussion

  • Arnold Trembley

    Arnold Trembley - 2024-03-30

    Data definition: Vt1to50 Pic X(30) Occurs 1 to 50

    Should it not be PIC X(50) OCCURS 1 TO 50 TIMES ?

     
  • Vince Esparza

    Vince Esparza - 2024-03-31

    Hello, That is a good question. If you look at the supplied SyntaxCheckOC.jpg you will see I originally had OCCURS 10, not N to 10 and GnuCOBOL flagged it as missing a TO. But Micro Focus took it. Also, IBM shows TIMES under the line for syntax formats so that means it is optional. And Micro Focus shows it with out an underline, so that too means it is optional. I do not have a copy of the ISO 2022 COBOL Standards, so I am not sure what they say. And the supplied RunOC.jpg shows a clean syntax check. I added the TIMES for both tables but still got the GPF. See new attachments,

     
  • Vince Esparza

    Vince Esparza - 2024-03-31

    Sorry, I did not provide a screen capture of the same GPF. And I checked, the ANSI COBOL Standard in the US is $198. Thanks, Vince

     
    • Vincent (Bryan) Coen

      If you go to :

      http://www.applewood.linkpc.net/files/GnuCobol/

      You will find a document starting with ISO-IEC_JTC_1-S and this is dated at least on my system as June 2023.

      Help yourself and there are other Cobol docs and tools and other stuff within the ../files folder.
      Same applies to any one else.

      Vince

       

      Last edit: Simon Sobisch 2024-04-04
  • Vince Esparza

    Vince Esparza - 2024-04-01

    Thank You! That is a good reference. I see you also have IBM Enterprise Cobol. The Micro Focus documentation (for PC and mainframe coding) can be found at https://www.microfocus.com/documentation/enterprise-developer/ They do not have one PDF file. It is all web based and one has to search to find things.
    I looked at the ISO document. At 13.15.2 it too shows that TIMES is optional. So I believe my coding is correct without TIMES. Vince

     
    • Simon Sobisch

      Simon Sobisch - 2024-04-01

      TIMES was always an optional word, but DEPENDING always required an n TO m (with a leading optional FROM).
      This is also useful because it defines if the minimum is one or zero. Nonetheless you can compile it fine with just passing a matching std, which I guess in your case would be -std=mf (or ibm?). I'd highly suggest doing that instead of adjusting the default configuration.

      That said, what about the original SIGSEGV?
      What is the result at runtime if you compile with --debug?
      Any hints that -Wall gives?

       
  • Vince Esparza

    Vince Esparza - 2024-04-04

    Hello (All) and particularly Simon,
    The world may never know and I do not care. The program runs fine using -std=mf. I presume the other options I used; --debug -Wall, made no difference. So my command line was:
    cobc -x -std=mf --debug -Wall opt6872.cbl
    And when I run the EXE file it runs as expected. I will reset my default.conf (yes, I kept a backup) and try other programs of mine. But this is looking very good. I think I will go back and retry my nested example previously sent too.
    Please mark this as a non-bug.
    THANKS! Vince

     
  • Simon Sobisch

    Simon Sobisch - 2024-04-04
    • labels: --> dialect, configuration
    • status: open --> not-our-bug
     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.
Try Free →