Ticket #2778 (closed merge: fixed)

Opened 5 years ago

Last modified 5 years ago

Standard output from subprocess has chunks missing

Reported by: greenrd Owned by: igloo
Priority: high Milestone: 6.10.2
Component: libraries/process Version: 6.10.1
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Running

system "hexdump /dev/urandom"

in ghci results in output in which chunks of text are missing. For example:

0002770 b1d8 7abf 562d aff8 3b26 a27b 6e0b ec5e                            
0002780 9046 7d66 bbb3 42a0 1e32 8fe6 ae7b 1247                            
0002790 00c2 1d8c befa 7b2f c9a1 3639 0692 c4b4                            
00027a0 dcfd 7699 2382 1c93 3a06 bfef 4de5 1cb2                            
00027b0 f432 1992 d077 92a4 4f27 4188 0525 87cf                            
00027c0 856d 5610 b5c5 1642 9f5b d1e5 a388 1428                            
00027d0 9ba4 17e3 9852 b716 a438 5e67 c4f3 9a43                            
00027e0 c718 f425 20db 89ca bdd3 960a 62ae 0ba4                            
00027f0 535d f015 2f50 3406 305f e6ea b7c1 ce90                            
0002800 b1e5 7c61 ab0c b60d 0002d10 1652 0720 7e2c f08b 21c6 6c43 a6b5 6f28
0002d20 91c2 a9d6 829c 24bd aead ef71 e063 3ada                            
0002d30 414f 2c5f 0bc1 364f f852 116c 571d ff50                            
0002d40 0eb0 8a18 61a6 ab32 d90f c710 7fe6 d9fa                            
0002d50 fe5f 7585 78a5 f8f2 1641 e915 7996 db7b                            
0002d60 ab5e d0d6 556c 2e4a 07bd ef60 bf4f 8bf4                            
0002d70 960b dc59 73df 5227 c284 e7c2 1346 2763                            
0002d80 a142 fc51 3730 98f5 7939 d851 88c4 86c1                            

Note the extra long line - and then look at the hexadecimal input offsets at the start of each line. What seems to have happened is that the end of the 0002800 line has been cut off, and then all the lines from there onwards until 0002d00 (including its '\n') are missing.

This bug repeats every so often in the output, and on my machine is easy enough to spot by eye. This problem does not occur if I run the command "hexdump /dev/urandom" directly from the shell.

Change History

Changed 5 years ago by greenrd

This bug does not occur when ghc -e is used instead of ghci.

Changed 5 years ago by simonmar

  • priority changed from normal to high
  • difficulty set to Unknown
  • milestone set to 6.10.2

Wow. Am investigating, thanks.

Changed 5 years ago by simonmar

  • owner set to igloo
  • type changed from bug to merge

Fixed:

Fri Nov 14 13:05:46 GMT 2008  Simon Marlow <marlowsd@gmail.com>
  * Don't put stdin into non-blocking mode (#2778, #2777)
  This used to be necessary when our I/O library needed all FDs in
  O_NONBLOCK mode, and readline used to put stdin back into blocking
  mode.  Nowadays the I/O library can cope with FDs in blocking mode,
  and #2778/#2777 show why this is important.

Changed 5 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Merged

Note: See TracTickets for help on using tickets.