According to https://github.com/openj/core/blob/master/xh.c#L102 the
routine which is failing is probably waitpid().

According to
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/waitpid.2.htmlthe
wait system call can fail after a delay because of

     [EFAULT]          The status or rusage argument points to an illegal
address (may not be detected before the exit of a child process).

     [EINVAL]           Invalid or undefined flags are passed in the
options argument.

But it looks like the apple employee responsible for posting this didn't
proofread very well, because the wait system call does not take an options
argument. (Also, neither of these suggestions are mentioned for waitpid,
but given the poor proofreading I'm inclined to ignore that technicality --
at least until I find something more plausible as an explanation).

But there's a better way of figuring out the error than reading poorly
proofread manual pages. Basically, I'd recommend inspecting a J instance
experiencing the error, using dtruss.  Here's the dtruss man page:
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dtruss.1m.html-
it's probably mostly accurate.

Start J, find its process id (using ps, for example), then start dtruss as
root in a console window and have it monitor the system calls made by J.
You should be able to see what error is occurring. You might want to play
with some of the dtruss options to see what else you can discover.

Thanks,

-- 
Raul



On Sun, Apr 20, 2014 at 2:17 AM, Piet de Jong <[email protected]> wrote:

> I get this: (after a short dela)
>
>
>
>  2!:3{.([smoutput)2!:2 'sleep 3'
>
> 69205 140735294190544 0
>
> |interface error
>
> | 2!:3{.([smoutput)2!:2'sleep 3'
>
>
> What could be the problem with my system?
>
> Thanks for all the help.
>
>
>
>
>
> On Sun, Apr 20, 2014 at 12:01 PM, Raul Miller <[email protected]>
> wrote:
>
> > Oops, you are correct. I apologize, I was working from memory and I
> > misremembered the meanings of these foreigns.
> >
> > Here's something to try:
> >    2!:3{.([smoutput)2!:2 'sleep 3'
> >
> > Here's what I get when I try that:
> >
> > 24283 144488800 144489160
> > 0
> >
> > (And there's a delay between the two lines.)
> >
> > If you do not get similar behavior, I imagine that that indicates some
> > problem with your system.
> >
> > Thanks,
> >
> > --
> > Raul
> >
> > On Sat, Apr 19, 2014 at 8:18 PM, Piet de Jong <[email protected]>
> wrote:
> > >   2!:3 '/Library/Frameworks/...    NB.  .... stands for all the rest
> > >
> > >
> > > |domain error
> > >
> > >
> > >
> > >
> > > On Sun, Apr 20, 2014 at 9:55 AM, Raul Miller <[email protected]>
> > wrote:
> > >
> > >> Try:
> > >>
> > >> 2!:3 '/Library/Frameworks/R.framework/Resources/bin/R
> > >>
> > >>
> >
> CMD/Library/Frameworks/R.framework/Versions/2.12/Resources/library/Rserve/libs/i386/Rserve-bin.so
> > >> --no-save'
> > >>
> > >> Thanks,
> > >>
> > >> --
> > >> Raul
> > >>
> > >>
> > >> On Sat, Apr 19, 2014 at 7:46 PM, Piet de Jong <[email protected]>
> > wrote:
> > >> > But isn't pid defined in my first statement?  ie.
> > >> >
> > >> > pid=.{. 2!:2 '/Library/....
> > >> >
> > >> > Maybe I am misunderstanding.
> > >> >
> > >> >
> > >> > On Sun, Apr 20, 2014 at 9:39 AM, Raul Miller <[email protected]
> >
> > >> wrote:
> > >> >
> > >> >> pid is a result from 2!:2 and I think you want its argument?
> > >> >>
> > >> >> Thanks,
> > >> >>
> > >> >> --
> > >> >> Raul
> > >> >>
> > >> >>
> > >> >> On Sat, Apr 19, 2014 at 7:31 PM, Piet de Jong <
> [email protected]
> > >
> > >> >> wrote:
> > >> >> > I call R  from J  and use the following setup to initiate the R
> > >> interface
> > >> >> >
> > >> >> >  load 'stats/r/rserve'
> > >> >> >
> > >> >> > pid=.{. 2!:2 '/Library/Frameworks/R.framework/Resources/bin/R
> > >> >> >
> > >> >>
> > >>
> >
> CMD/Library/Frameworks/R.framework/Versions/2.12/Resources/library/Rserve/libs/i386/Rserve-bin.so
> > >> >> > --no-save'
> > >> >> >
> > >> >> >
> > >> >> > Everything works fine.
> > >> >> >
> > >> >> >
> > >> >> > However I want to "wait" for process with pid to finish and
> > according
> > >> to
> > >> >> > the documentation I can  use
> > >> >> >
> > >> >> >
> > >> >> > 2!:3 pid
> > >> >> >
> > >> >> >
> > >> >> > However this results in an interface error.
> > >> >> >
> > >> >> >
> > >> >> > What am I doing wrong?
> > >> >> >
> > ----------------------------------------------------------------------
> > >> >> > For information about J forums see
> > >> http://www.jsoftware.com/forums.htm
> > >> >>
> > ----------------------------------------------------------------------
> > >> >> For information about J forums see
> > http://www.jsoftware.com/forums.htm
> > >> >>
> > >> >
> ----------------------------------------------------------------------
> > >> > For information about J forums see
> > http://www.jsoftware.com/forums.htm
> > >> ----------------------------------------------------------------------
> > >> For information about J forums see
> http://www.jsoftware.com/forums.htm
> > >>
> > > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to