Menu

#933 Compiler Segmentation Fault on bad expressions

GC 3.x
pending
5 - default
2024-09-29
2023-12-28
No

Hi Simon
When i compile the following program , it produces a segmentation fault.

       IDENTIFICATION DIVISION.
       PROGRAM-ID. toto.
      *
       DATA DIVISION.
      *
       WORKING-STORAGE SECTION.
      *-----------------------*
      *
      *
       PROCEDURE DIVISION.
      *------------------*
      *
       A00-MAINLINE.
      *------------*
      *>
           IF +
           THEN
                   display 'ok' .
      *>
           GOBACK.
      *>
~                                                                                                                       

I think that the problem is on* expr_token_no_is* bison rule . It occurs for other sub rules :
+ , ) , ) ...
I think most of the sub rules are not useful except AND and NOT
Denis


Related

Bugs: #938
Bugs: #966

Discussion

  • Simon Sobisch

    Simon Sobisch - 2024-05-04
    • labels: Bad condition parsing --> cobc, SIGSEGV, expressions
    • summary: Compiler Segmentation Fault --> Compiler Segmentation Fault on bad expressions
    • status: open --> pending
    • assigned_to: Simon Sobisch
    • Group: unclassified --> GC 3.x
     
  • Simon Sobisch

    Simon Sobisch - 2024-05-04

    This error is finally fixed with [r5247]. Please check again if you think we should adjust the rules (may<be give that a test and see what the test cases say).

    After your feedback and a possible adjustment to the rules, we can then close this issue.

     

    Related

    Commit: [r5247]

  • Denis HUGONNARD-ROCHE

    Hi Simon
    Yes . This case is solved.
    But while testing i found another case that produce a core dumped.
    Here it is :

           IDENTIFICATION DIVISION.
           PROGRAM-ID. test.
          *
           DATA DIVISION.
          *
           WORKING-STORAGE SECTION.
          *-----------------------*
          *
          *
           PROCEDURE DIVISION.
          *------------------*
          *
           A00-MAINLINE.
          *------------*
          *>
               IF NOT (+)
               THEN
                       display 'ok' .
          *>
               GOBACK.
          *>
    

    i'll try to find other cases and give you an update
    PS : did you have time to have a look at the last version of 'cob_decimalèpow' and the cordic ln program test ?
    Denis

     
  • Denis HUGONNARD-ROCHE

    Hi Simon
    Found another case

               IF NOT (NOT () )
               THEN
    

    Denis

     

Log in to post a comment.