Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 248003 - app-shells/ksh: broken pipelines on darwin
Summary: app-shells/ksh: broken pipelines on darwin
Status: RESOLVED INVALID
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Mac OSX (show other bugs)
Hardware: All OS X
: High major (vote)
Assignee: Gentoo non-Linux Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-21 17:14 UTC by Elias Pipping
Modified: 2008-12-06 10:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Pipping 2008-11-21 17:14:02 UTC
upstream (david korn) doesn't get what i mean. putting it up here so it doesn't get lost.

quoting from the FAQ:

  [..]  ksh runs the last component of a pipeline
  in the current process.  Some shells run it as a subshell
  as if you had invoked it as  echo foo | (read bar).

Now, when I run

  $ for ((i=0; i<1000; i++)); do echo | cat >/dev/null; done

on darwin, I get

  cat: cat: cannot execute [Exec format error]
  cat: cat: cannot execute [Exec format error]
  cat: cat: cannot execute [Exec format error]
  cat: cat: cannot execute [Exec format error]

The higher the load i put on the system (move the mouse, play music, compile something),
the more errors i get (notably i don't get any errors with close-to-zero load)

The errors do not occur on solaris, gnu/linux or when run via `ksh -c`.

The problem is not limited to echo/cat. It's a matter of piping.
Comment 1 Elias Pipping 2008-11-21 17:16:58 UTC
To prove that the problem is related to that behavior I quoted from the FAQ:

  $ for ((i=0; i<1000; i++)); do echo | (cat) >/dev/null; done

does not produce any errors. Hence not-running-a-subshell after the pipe is where the problem is coming from.
Comment 2 Fabian Groffen gentoo-dev 2008-12-06 09:59:31 UTC
?
Comment 3 Elias Pipping 2008-12-06 10:01:05 UTC
I've just received a reply by David Korn that it's been fixed and there's going to be a release in a week or two. I never should've opened the bug with the tone (first line) and I'm a bit ashamed.