[GRASS5] Driver Update

Glynn Clements glynn.clements at virgin.net
Wed Apr 25 13:02:11 EDT 2001


Justin Hickey wrote:

> > > > Do you have strace() or similar?
> > >
> > > Hmmpf. It figures that strace on SGI is different from Linux. The 
> > > best I can do here is provide you with a system call trace, but I
> > > don't know if that will be useful to you. Please let me know if you
> > > want it anyway.
> > 
> > Yes; for the XDRIVER process (I'm fairly sure that the client side is 
> > OK).
> 
> Hmmm. To get a trace I need to pass a command line to the trace program.
> I think
> 
> par d.mon start=x0
> 
> will trace the client. How do I trace the XDRIVER?

Awkward; Linux' strace can attach to a running process with "-p".

If yours doesn't have this ability, I'm not sure that it can be done;
the driver requires the monitor name to be passed in argv[0], which
seems to exclude running it other via another program.

> > Uh Oh. Something caused the command loop to terminate; the latest
> > version of lib/main.c prints an error message if an abnormal
> > termination occurs. It would be useful to know which of the three
> > possible cases occurred. The choices are:
> > 
> >             if (setjmp(save))
> > 
> > Indicates that SIGPIPE was caught (write to broken pipe).
> > 
> >             if (get_command(&c) != 0)
> > 
> > Driver got EOF while expecting command; this the "normal" case.
> > 
> >             if (process_command(c))
> > 
> > Driver got EOF while expecting command parameters/data.
> 
> I'm using your new code with the fprintf()'s so since nothing was
> printed it must be the get_command() function. ... wait ... Just checked
> to be sure and yep it's the get_command() function.

Odd. That one doesn't generate an error because that's how the loop
normally terminates. However, the input functions which get_command()
uses might be mistaken in their detection of EOF.

This certainly narrows it down a bit, though.

> I also noted that the "while(1)" loop has no way of exiting if that
> means anything ie. the main function never returns. I'm not sure if that
> means anything.

No; mon.stop calls R_kill_driver() which sends GRAPH_CLOSE which the
monitor handles by calling exit().

-- 
Glynn Clements <glynn.clements at virgin.net>

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list