Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1084 Strange behaviour in command pipeline

MSYS
open
Cesar Strauss
None
none
Aged_issue
2013-01-29
2007-09-12
Keith Marshall
No

I've only ever noticed this in the particular circumstances described here: https://sourceforge.net/tracker/?func=detail&atid=379173&aid=1792340&group_id=23617

It seems to be explicit to the GnuWin32 pnmtopng.exe reading data from a pipe, invoked from MSYS. All appears hunky-dory, when run natively in cmd.exe, so they may dismiss it as an MSYS bug. In MSYS, what is the difference between

pnmtopng < foo.pnm > foo.png

which works, and

cat foo.pnm | pnmtopng > foo.png

which doesn't?

Discussion

  • Earnie Boyd
    Earnie Boyd
    2012-10-24

    • milestone: --> Aged_issue
    • status: open --> pending
     
  • Keith Marshall
    Keith Marshall
    2012-10-24

    Aged, it may be, but the issue still exists; I'd like to keep this open, for reference if nothing else.

    I need the netpbm tools to build a fully functional groff for use on MS-Windows, and this issue persists; indeed, as both MSYS and GnuWin32, (and indeed Windows itself), have evolved, the issue has become *more* evident.

    Having found it to have become more troublesome over time, I've concluded that it may originate neither MSYS nor in GnuWin32, but in netpbm itself; having become so desperate that I've even attempted to build my own port from upstream sources -- and it's a truly ghastly pig of a code base to build from -- I believe I've tracked the problem down to an attempted seek on stdin, (which surely can't be legitimate, when reading from a pipe on *any* platform, so it's amazing that this stuff works anywhere, at any time).

    I ran out of time to investigate further, and never got back to it. One day, I may explore it again.

     
  • Keith Marshall
    Keith Marshall
    2012-10-24

    • status: pending --> open
     
  • Earnie Boyd
    Earnie Boyd
    2013-01-18

    • status: open --> closed-out-of-date
    • category: --> Aged_issue
    • milestone: Aged_issue --> MSYS
     
  • Earnie Boyd
    Earnie Boyd
    2013-01-29

    • labels: MSYS -->
    • status: closed-out-of-date --> open
    • resolution: --> none
     
  • Earnie Boyd
    Earnie Boyd
    2013-01-29

    I'm reopening as a problem. I'm not sure what can be done. Interoperation between MSYS runtime and MSVCRT on the pipe handles need some work. Just yesterday I had a problem with some native program giving output I wanted to redirect to /dev/clipboard and had to dance around the problem.

    native.exe > /dev/clipboard ;# does not work.
    native.exe | cat > /dev/cliboard ;# works as expected.