Re: how to debug, not understanding safe_primitive

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Hi Anne,

The first real testers!  Welcome.  Expect some issues :-(

On 02/07/2014 03:28 AM, Anne Ogborn wrote:
> ok, found the issue,  need to call taco in the right module, but this
> still leaves questions
>
> p(X),pengine_server:taco(X).

The failure is a bug.  Should have said that pengine_sandbox:taco/1 is
undefined.  I'll look into that.

Debugging is indeed an issue.  Now, code that you submit from the client
is supposed to be fairly short query code that selects and massages the data
in the right form for the application.  debug/1 is not considered safe.
One issue is that it calls format/3 and this allows for ~@, which allows
for calling arbitrary goals.  Partial safety could be ensured by analyzing
the format specification.  But, even if it works the output will be written
to the server console.

What probably needs to be done is to have a pengine_debug/2 that calls
pengine_output/1 and a default handler in the pengines.js to display that
information in a sensible place in the browser (console?).  Torbjörn?

	Cheers --- Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.