gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Nit


From: Stephen J. Turnbull
Subject: Re: [Gnu-arch-users] Nit
Date: Wed, 22 Oct 2003 17:16:22 +0900
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.5 (celeriac, linux)

>>>>> "Dustin" == Dustin Sallings <address@hidden> writes:

    Dustin> On Tuesday, Oct 21, 2003, at 22:06 US/Pacific, Stephen
    Dustin> J. Turnbull
    Dustin> wrote:

    >> I wish you'd stop with the leading tabs.

    Dustin>     Sorry, this is how they taught me to begin paragraphs.

Sure, but what about the 40 non-paragraph-starting lines?

    Dustin>     When I run ghostscript to write to a filesystem that
    Dustin> is out of space, I get the following output:

    Dustin> dustinti:/Volumes/Test 607% gs -sDEVICE=pdfwrite
    Dustin> -sOutputFile=tmp.pdf -q -dNOPAUSE -dBATCH
    Dustin> ~/Desktop/dl/CLU-syntax.ps

    Dustin> Error: /ioerror in --.outputpage--
    Dustin> Operand stack:

If Ghostscript was able to print that backtrace, it continued
non-panic-mode processing after the error.  It thought about calling
you for orders, but you wouldn't answer (that's what -dBATCH means),
so it printed the backtrace and shut down in an orderly fashion.

Just printing a backtrace is evidence of substantial presence of mind.
I bet that armed with a core dump and a debugger it would take you a
day to produce that same backtrace (tricking Ghostscript into doing it
for you doesn't count; I mean threading through the data structures
the way that Ghostscript itself did after the error).

    Dustin> The request was aborted, but the process didn't die.  This
    Dustin> is pretty much the equivalent of throwing an exception
    Dustin> that's caught in the main loop and turned into an error
    Dustin> message.

It is not.  In the case of Ghostscript, the Postscript state
(dictionaries and stack) is preserved, the execution stack is unwound,
and the controlling entity (user or program) can continue.  The fact
that the non-core library that writes PDFs was not written robustly
doesn't mean that Ghostscript doesn't support more robust strategies,
and that support was written in C.  Ghostscript itself (ie, at the C
level) does _not_ follow the "throw to the main loop" strategy; it
preserves as much state as possible and cleans out any trash, allowing
the user or a program to recover.

In the case of any editor that does autosaves (Emacs, for one), in
fact the autosave gets requeued and tried again later.

In each case, as Tom has been saying, the error gets caught at a low
level, cleaned up, and only then is control returned to the main loop.

The fact is that all of the applications I mentioned treat ENOSPC as a
temporary condition.  In some cases, they make an explicit decision to
exit conditional on the interactive flag.  If they don't exit, they
continue what they were doing, interactive loops or queued background
tasks.

-- 
Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]