Re: [GHC] #724: tee complains if used in a process started by ghc
#724: tee complains if used in a process started by ghc ---+ Reporter: guest |Owner: Type: bug | Status: closed Priority: high|Milestone: 6.6.2 Component: libraries/base | Version: 6.4.1 Severity: normal | Resolution: fixed Keywords: | Difficulty: Moderate (1 day) Os: Unknown | Testcase: concio001 Architecture: Unknown | ---+ Changes (by simonmar): * resolution: = fixed * testcase: = concio001 * status: new = closed Comment: Fixed, more or less. {{{ Mon May 7 05:35:37 PDT 2007 Simon Marlow [EMAIL PROTECTED] * FIX: #724 (tee complains if used in a process started by ghc) Now, we only set O_NONBLOCK on file descriptors that we create ourselves. File descriptors that we inherit (stdin, stdout, stderr) are kept in blocking mode. The way we deal with this differs between the threaded and non-threaded runtimes: - with -threaded, we just make a safe foreign call to read(), which may block, but this is ok. - without -threaded, we test the descriptor with select() before attempting any I/O. This isn't completely safe - someone else might read the data between the select() and the read() - but it's a reasonable compromise and doesn't seem to measurably affect performance. }}} test cases to follow. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/724 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #724: tee complains if used in a process started by ghc
#724: tee complains if used in a process started by ghc +--- Reporter: guest | Owner: Type: bug | Status: new Priority: high| Milestone: 6.6.2 Component: libraries/base |Version: 6.4.1 Severity: normal | Resolution: Keywords: | Difficulty: Moderate (1 day) Testcase: | Architecture: Unknown Os: Unknown | +--- Changes (by simonmar): * milestone: 6.8 = 6.6.2 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/724 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #724: tee complains if used in a process started by ghc
#724: tee complains if used in a process started by ghc +--- Reporter: guest | Owner: Type: bug | Status: new Priority: high| Milestone: 6.8 Component: libraries/base |Version: 6.4.1 Severity: normal | Resolution: Keywords: | Difficulty: Moderate (1 day) Testcase: | Architecture: Unknown Os: Unknown | +--- Changes (by simonmar): * testcase: = Comment: Patch to package/base that attempts to address this attached. It's not a perfect solution, so I'm going to let it simmer for a while. If you're interested in this bug, please try the patch if you can. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/724 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #724: tee complains if used in a process started by ghc
#724: tee complains if used in a process started by ghc ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: normal| Milestone: 6.8 Component: libraries/base|Version: 6.4.1 Severity: normal| Resolution: Keywords:| Os: Unknown Difficulty: Moderate (1 day) | Architecture: Unknown ---+ Comment (by guest): I'd also like to ping this bug. It also affects arbitrary Gentoo users. Gentoo's portage can be configured to produce build logs for all the packages. This is a global switch. When enabled, all building is filtered through tee. If any of the ghc compiler calls produces lots of output, there is a risk that compilation fails. In the past, I fixed this by making ghc produce less output (by removing warning flags, for instance), but in general, the only solution that works is to tell people to disable logging, which is annoying. For reference: [http://bugs.gentoo.org/show_bug.cgi?id=83] Andres Loeh -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/724 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #724: tee complains if used in a process started by ghc
#724: tee complains if used in a process started by ghc ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: high | Milestone: 6.8 Component: libraries/base|Version: 6.4.1 Severity: normal| Resolution: Keywords:| Os: Unknown Difficulty: Moderate (1 day) | Architecture: Unknown ---+ Changes (by igloo): * priority: normal = high -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/724 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #724: tee complains if used in a process started by ghc
GHC wrote: #724: tee complains if used in a process started by ghc ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: normal| Milestone: 6.8 Component: libraries/base|Version: 6.4.1 Severity: normal| Resolution: Keywords:| Os: Unknown Difficulty: Moderate (1 day) | Architecture: Unknown ---+ Changes (by igloo): * milestone: 6.6 = 6.8 we might be able to get this into 6.6.1, it doesn't involve any API changes (well, perhaps strictly speaking there would be a change in that the std file descriptors wouldn't be set to O_NONBLOCK, but I doubt that would affect anyone adversely). Cheers, Simon ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #724: tee complains if used in a process started by ghc
#724: tee complains if used in a process started by ghc ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: normal| Milestone: 6.8 Component: libraries/base|Version: 6.4.1 Severity: normal| Resolution: Keywords:| Os: Unknown Difficulty: Moderate (1 day) | Architecture: Unknown ---+ Changes (by igloo): * milestone: 6.6 = 6.8 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/724 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #724: tee complains if used in a process started by ghc
#724: tee complains if used in a process started by ghc ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: normal| Milestone: 6.6 Component: libraries/base|Version: 6.4.1 Severity: normal| Resolution: Keywords:| Os: Unknown Difficulty: Moderate (1 day) | Architecture: Unknown ---+ Comment (by guest): This bug is quite a showstopper for Andres application. Any run with much text output and it's almost guarantied that it will fail. I belive that this issue is related to another issue as well: Locking/unlocking screen output in a terminal with Ctrl+S / Ctrl+Q doesn't work. Once a terminal output is locked it can't be unlocked and the result is that the application fails with ''tee: write error''. Lennart Kolmodin -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/724 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #724: tee complains if used in a process started by ghc
#724: tee complains if used in a process started by ghc ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: normal| Milestone: 6.6 Component: libraries/base|Version: 6.4.1 Severity: normal| Resolution: Keywords:| Os: Unknown Difficulty: Moderate (1 day) | Architecture: Unknown ---+ Changes (by simonmar): * difficulty: Unknown = Moderate (1 day) * component: Compiler = libraries/base * milestone: = 6.6 Comment: We know why this is: it's because GHC puts stdin/stdout into non-blocking mode, and tee doesn't like it. There's a fix for the threaded RTS. We could avoid putting the standard file descriptors into non-blocking mode, and instead make blocking FFI calls to access them. This can't be used in the non-threaded RTS. (GHC is now linked with the threaded RTS, so this would fix the case in this bug report). It's not a simple fix, so I'll probably punt until 6.6. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/724 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
[GHC] #724: tee complains if used in a process started by ghc
#724: tee complains if used in a process started by ghc -+-- Reporter: guest |Owner: Type: bug | Status: new Priority: normal|Milestone: Component: Compiler | Version: 6.4.1 Severity: normal| Keywords: Os: Unknown | Difficulty: Unknown Architecture: Unknown | -+-- I have the following program: {{{ import System main = getArgs = system . head }}} i.e., a simple wrapper around the system command. I compile this using {{{ ghc -o Sys --make Sys.hs }}} into a binary `Sys`. If I then call {{{ ./Sys yes | head -n 2000 | tee /dev/null }}} the program quits with the message `tee: write error`. I tried on some machines, and on some I have to increase the argument to `head`, but at some point it always fails. Calling the shell command directly gives no error. However, calling {{{ ./Sys yes | head -n 2000 | tee /dev/null }}} (note the difference!) also fails. This bug is a showstopper for my current project. In my program, I call other programs which internally employ tee for logging. Whenever there is a lot of screen output, there seems to be a good chance that my program fails. I have no idea if this is a problem with `tee` or with `ghc`, but I couldn't yet reproduce it in any non-ghc context. Andres Loeh -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/724 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs