[GRASS5] d.legend and d.out.png

Glynn Clements glynn.clements at virgin.net
Mon Aug 23 13:35:04 EDT 2004

Michael Barton wrote:

> >> Except, d.what.vect is partly broken--on Mac's at least.
> > 
> > Bus error directly after first mouse click, correct?
> > (Needs to be compiled with debugging info and run though a debugger..)
> It gives a "broken pipe" error. Here is the very consistent scenario (with
> one exception detailed below).
> Run d.what.vect first time. Works great in all ways.
> Quit d.what.vect (i.e., right mouse click).
> Run d.what.vect second time (and all subsequent times). Works fine in
> terminal mode. In default mode (i.e., displaying tcl window), nothing
> happens on the first mouse click. On the 2nd mouse click (and all subsequent
> clicks), it gives a broken pipe error.

This sounds like an OSX Tcl/Tk issue. Does the GUI dialog use the OSX
wish or a Unix/X11 wish?

If stdout isn't a tty (and, when run via gui.tcl, it isn't),
d.what.vect sends the output to both stdout and stderr. gui.tcl runs
the command using "open {| <command> 2>@ stdout} r", so its stdout
will be a pipe (with wish on the other end) and stderr will be the
original stdout (i.e. the terminal).

If the read end of stdout is closed, the next time that d.what.vect
tries to write to it, d.what.vect will receive SIGPIPE, the default
action for which is to print "Broken pipe" and terminate the

My open(n) manpage says:

              Opening  a  command pipeline is not supported under |
              Macintosh, since applications do  not  support  the |
              concept of standard input or output.                |

I presume that this refers to pre-OSX versions. However, the
experience of OpenOSX' attempts to use the OSX Tcl/Tk for tcltkgrass
suggest that the OSX Tcl/Tk may still have some issues regarding
spawning commands and standard descriptors.

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-dev mailing list