public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/108557] New: Stuck compilation for empty file
@ 2023-01-26 10:20 marxin at gcc dot gnu.org
  2023-01-26 13:17 ` [Bug modula2/108557] " gaius at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-01-26 10:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108557

            Bug ID: 108557
           Summary: Stuck compilation for empty file
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

Noticed that during reduction of a test-case:

$ echo '' > x.mod
$ timeout 1 /dev/shm/objdir/./gcc/cc1gm2 x.mod
$ echo $?
124

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug modula2/108557] Stuck compilation for empty file
  2023-01-26 10:20 [Bug modula2/108557] New: Stuck compilation for empty file marxin at gcc dot gnu.org
@ 2023-01-26 13:17 ` gaius at gcc dot gnu.org
  2023-01-27 16:24 ` gaius at gcc dot gnu.org
  2023-01-27 22:24 ` gaius at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-26 13:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108557

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2023-01-26
     Ever confirmed|0                           |1

--- Comment #1 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Thanks, indeed replicated and confirmed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug modula2/108557] Stuck compilation for empty file
  2023-01-26 10:20 [Bug modula2/108557] New: Stuck compilation for empty file marxin at gcc dot gnu.org
  2023-01-26 13:17 ` [Bug modula2/108557] " gaius at gcc dot gnu.org
@ 2023-01-27 16:24 ` gaius at gcc dot gnu.org
  2023-01-27 22:24 ` gaius at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-27 16:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108557

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gaius at gcc dot gnu.org

--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54361
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54361&action=edit
Proposed fix

I believe this fixes the bug.

PR-108557 Stuck compilation for empty file

Trying to compile an empty file causes cc1gm2 to hang.
The bug was that M2LexBuf.mod called m2flex.GetToken after
an eof token was seen which resulted in m2flex attempting
to read from stdin.  The bug fix detects eof per file and
blocks a subsequent to m2flex.GetToken.

gcc/m2/ChangeLog:

        * gm2-compiler/M2Comp.mod:  Import MetaString0.
        (ExamineCompilationUnit): New variable Message.
        Create and format error string.
        * gm2-compiler/M2LexBuf.mod: New variable SeenEof.
        (GetNonEofToken): New procedure.
        (Init): Set SeenEof to FALSE.
        (GetToken): Use GetNonEofToken instead of calls to
        m2flex.GetToken and GetToken.
        (AddTok): Detect eoftok and set SeenEof.

gcc/testsuite/ChangeLog:

        * gm2/pim/fail/empty.mod: New test.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug modula2/108557] Stuck compilation for empty file
  2023-01-26 10:20 [Bug modula2/108557] New: Stuck compilation for empty file marxin at gcc dot gnu.org
  2023-01-26 13:17 ` [Bug modula2/108557] " gaius at gcc dot gnu.org
  2023-01-27 16:24 ` gaius at gcc dot gnu.org
@ 2023-01-27 22:24 ` gaius at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-27 22:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108557

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #3 from Gaius Mulley <gaius at gcc dot gnu.org> ---
[gcc r13-5463] PR-108557 Stuck compilation for empty file.

git pushed (and next time I'll get the PR syntax correct)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-27 22:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26 10:20 [Bug modula2/108557] New: Stuck compilation for empty file marxin at gcc dot gnu.org
2023-01-26 13:17 ` [Bug modula2/108557] " gaius at gcc dot gnu.org
2023-01-27 16:24 ` gaius at gcc dot gnu.org
2023-01-27 22:24 ` gaius at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).