Opened 7 years ago

Closed 7 years ago

#2815 closed bug (worksforme)

On windows, hGetLine stdin leaks like an inside trader

Reported by: sclv Owned by: simonmar
Priority: high Milestone: 6.10.2
Component: Runtime System Version: 6.10.1
Keywords: Cc:
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

1) Compile the following code, in GHC 6.10.1 or 6.8.3 on Windows XP.

2) Don't type anything, just bring up the task manager and wait.

3) Watch as the memory usage climbs, slowly, and then with increasing vigor.

4) If you start typing things, the memory usage will cease climbing.

main = do
 forever $ do
         x <- hGetLine stdin
         putStrLn x

Change History (6)

comment:1 Changed 7 years ago by nominolo

I cannot reproduce this on Vista. Could you compile your program with 6.10.1 and run it with +RTS -hT. Let it run for a while then kill it. It should then have produced a <programname>.hp file (for "Heap Profile"). You should have a tool hp2ps coming with 6.10.1 which converts this file to a postscript file. Could you then attach the .hp or .ps file to this ticket.

comment:2 Changed 7 years ago by nominolo

On second thought, if this is a runtime system bug this might not be very helpful.

comment:3 Changed 7 years ago by simonmar

  • difficulty set to Unknown
  • Milestone set to 6.10.2
  • Owner set to simonmar
  • Priority changed from normal to high

I managed to reproduce it, but only with -threaded. This is a serious bug, thanks for spotting it.

comment:4 Changed 7 years ago by felixmar

FWIW i cannot reproduce this either on Windows XP. I have tested with 6.10.1 and 6.8.3, threaded RTS or not and with various optimization settings.

comment:5 Changed 7 years ago by simonmar

I can't reproduce it today. I'm wondering if I really saw it before or just thought I did.

comment:6 Changed 7 years ago by simonmar

  • Resolution set to worksforme
  • Status changed from new to closed

I still can't reproduce it, trying 6.10.1 and HEAD, with or without -threaded, cmd.exe or Cygwin bash.

I'll have to close the ticket. If anyone can find a way to reproduce it, please re-open.

Note: See TracTickets for help on using tickets.