home *** CD-ROM | disk | FTP | other *** search
- Nntp-Posting-Host: maud.ifi.uio.no
- Newsgroups: comp.os.linux
- Path: sparky!uunet!munnari.oz.au!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!aun.uninett.no!nuug!ifi.uio.no!janl
- From: janl@ifi.uio.no (Jan Nicolai Langfeldt)
- Subject: 4.2 libs, i/o bug?
- Message-ID: <1993Jan27.154154.4669@ifi.uio.no>
- Summary: seems like a legit bug.
- Sender: janl@ifi.uio.no (Nicolai Langfeldt)
- Organization: Folkeaksjonen for gjeninsettelse av Revolvermagasinet
- Date: Wed, 27 Jan 1993 15:41:54 GMT
- Lines: 130
- Originator: janl@maud.ifi.uio.no
-
-
- I have been working on getting cim (simula->C translator) compiled on
- linux, this fall it was almost done except for some problems with fp
- in the ends of the representation spectre. This was with 4.1 libs and
- gcc2.2.2d7. When I wanted to look at it again during xmas break all
- the old binary produced was parsing errors for a legit program. Now
- using 4.2 libs, gcc 2.3.3, the kernel has also been updated.
-
- The problem seems to come from the interaction between getc(3) and
- ungetc(3). EOF is not reached, and the file is reread from start. See
- debug output below. I would welcome any suggestions on how to proceed,
- if maybe this is a known bug?
-
- Inserting printf("INPUT %d %c",c,c) in the input procedure and
- printf("UNPUT %d %c",c,c) in the unput proc. of the tokenizer and
- running it on this program:
-
- -----
- begin
- outtext("Hello world!");
- outimage;
- end;
- % llllllllllllllllllllllllll
- % lllllllllllllllllll
- -----
-
- Gives this trace:
- -------
- Compiling helloworld.sim:
- "helloworld.sim", line 2: Parse error.
- INPUT: 98 b # BEGIN
- UNPUT: 66 B
- INPUT: 66 B
- INPUT: 98 b
- INPUT: 101 e
- INPUT: 103 g
- INPUT: 105 i
- INPUT: 110 n
- INPUT: 10
-
- UNPUT: 10
-
- line: 1 yylex:BBEGIN
- INPUT: 10
-
- INPUT: 32
- UNPUT: 32
- INPUT: 32
- INPUT: 32
- INPUT: 111 o # Outtext...
- INPUT: 117 u
- INPUT: 116 t
- INPUT: 116 t
- INPUT: 101 e
- INPUT: 120 x
- INPUT: 116 t
- INPUT: 40 (
- UNPUT: 40 (
- line: 2 yylex:OUTTEXT
- lval : 408296 val : 408296
- INPUT: 40 (
- line: 2 yylex:(
- INPUT: 34 "
- INPUT: 72 H
- INPUT: 101 e
- INPUT: 108 l
- INPUT: 108 l
- INPUT: 111 o
- INPUT: 32
- INPUT: 119 w
- INPUT: 111 o
- INPUT: 114 r
- INPUT: 108 l
- INPUT: 100 d
- INPUT: 33 !
- INPUT: 34 "
- INPUT: 41 )
- UNPUT: 41 )
- line: 2 yylex:"Hello world!"
- INPUT: 41 )
- line: 2 yylex:)
- INPUT: 59 ;
- line: 2 yylex:;
- INPUT: 10
-
- INPUT: 32
- UNPUT: 32
- INPUT: 32
- INPUT: 32
- INPUT: 111 o # Outimage
- INPUT: 117 u
- INPUT: 116 t
- INPUT: 105 i
- INPUT: 109 m
- INPUT: 97 a
- INPUT: 103 g
- INPUT: 101 e
- INPUT: 59 ;
- UNPUT: 59 ;
- line: 3 yylex:"helloworld.sim", line 5: Parse error.
- OUTIMAGE
- INPUT: 59 ;
- line: 3 yylex:;
- lval : 369160 val : 369160
- INPUT: 10
-
- INPUT: 101 e # The fun starts here it seems, the 'e' of
- UNPUT: 69 E # 'end' is read, then the file is restarted.
- INPUT: 69 E
- INPUT: 98 b
- INPUT: 101 e
- INPUT: 103 g
- INPUT: 105 i
- INPUT: 110 n
- INPUT: 10
-
- UNPUT: 10
-
- line: 4 yylex:EBEGIN
- INPUT: 10
-
- INPUT: 32
- UNPUT: 32
- INPUT: 32
- ....
-
-
- --
- Nicolai Langfeldt, "Bugs made while you wait"
- Internet: janl@ifi.uio.no
-