[ ghc-Bugs-1078231 ] GHCi stdin buffering strange

SourceForge.net noreply at sourceforge.net
Fri Nov 4 04:55:52 EST 2005


Bugs item #1078231, was opened at 2004-12-03 10:46
Message generated for change (Comment added) made by simonmar
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1078231&group_id=8032

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Compiler
Group: None
>Status: Closed
>Resolution: Duplicate
Priority: 2
Submitted By: Simon Peyton Jones (simonpj)
Assigned to: Nobody/Anonymous (nobody)
Summary: GHCi stdin buffering strange

Initial Comment:
Ben Rudiak-Gould reports

This is a bizarre problem that's been randomly biting me 
for ages, but I 
just recently figured out how to reliably reproduce it.

Steps to reproduce:

    1. Install GHC 6.2.2 for Win32 from the MSI file at 
haskell.org. 
(Older versions also exhibit the bug.)
    2. Start GHCi from the command line with no options. 
While it's 
loading (before the Prelude> prompt appears), press the 
letter 'p' on 
the keyboard.
    3. After the prompt appears, press the 'i' and Enter 
keys.
    4. Instead of "3.141592653589793", GHCi 
reports "Variable not in 
scope: `gi'".

The character that gets munged is always the first 
character of the 
input line, and it always gets replaced with the letter g, 
regardless of 
what it was initially. It's not visibly munged: that is, the 
interaction 
looks like

    Prelude> pi

    <interactive>:1: Variable not in scope: `gi'

The same problem appears if I press both 'p' and 'i' 
before the prompt 
appears, and Enter after. But it does not appear if I 
press all three 
keys before the prompt appears, or all three after. (I 
told you it was 
weird.)

I seem to remember that using :r or :l also triggers the 
bug on the next 
input, but I haven't tested that recently.

I've encountered this problem on at least two different 
machines, at 
least two versions of NT (Win2K and WinXP), and many 
versions of GHC.


----------------------------------------------------------------------

>Comment By: Simon Marlow (simonmar)
Date: 2005-11-04 09:55

Message:
Logged In: YES 
user_id=48280

dup of #1329672

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-11-03 16:28

Message:
Logged In: NO 

I submitted a not-so-good report on the same bug

http://sourceforge.net/tracker/?group_id=8032&atid=108032&func=detail&aid=1329672

the reply blames a bug in windows and says it's as fixed as
it can be in 6.4.1

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-02-09 06:13

Message:
Logged In: NO 

Hmm, doesn't affect Mac OS-X  10.2.2, ghci v6.0.1:

xxxx at xxxx ~$ghci
pi      
   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.0.1,
for Haskell 98.
/ /_\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... done.
Prelude> pi
3.141592653589793
Prelude> 


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1078231&group_id=8032



More information about the Glasgow-haskell-bugs mailing list