[Asterisk-Dev] Re: is this a bug?

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed Jan 26 00:03:40 MST 2005


On Tuesday 25 January 2005 23:59, Tom Ivar Helbekkmo wrote:
> Tilghman Lesher <tilghman at mail.jeffandtilghman.com> writes:
> > While the invalid pointer part *IS* a bug, shutting down because
> > he pressed Ctrl-C is not a bug.  Do you disagree?
>
> No, I don't disagree.
>
> The invalid pointer, and the subsequent segmentation fault, are
> symptoms of a bug.  The OP claims repeatability, so let's hope he
> can supply a good traceback.
>
> The fact that the '-c' flag will provide a full blown CLI with
> cooked keyboard input and terminal editing using control keys, and
> still shuts down on interrupt, is no bug, just bad design.  It
> breaks the principle of least astonishment.

1.  If asterisk is a daemon, and running with -c corresponds to
running the daemon in the foreground, and you normally expect daemons
which are set to run in the foreground to be stopped with Ctrl-C, how
does Asterisk break the principle of least astonishment?  I personally
run Asterisk with a startup script and connect to it with '-Rc', for
which Ctrl-C does NOT interrupt the main process.

2.  There are far more serious violations of the principle of least
astonishment in Asterisk.  One particular example is the new default
in -HEAD of setting autofallthrough=yes, which is completely different
behavior than is what is in STABLE.  Mark does not seem to be
particularly concerned with violating this principle; if you disagree,
you should take it up with him.  Like it or not, Mark is the project
leader, and unless or until Asterisk is forked, that is the way it is
going to be.

> I've used such "stay 
> in the foreground" flags with more software than you can shake a
> stick at (and usually stopped them with ^C, too), but that's
> daemons that you make sit in the foreground for testing, for the
> simple reason that you want debug messages on the console instead
> of in a log file.
>
> Daemons with classic foreground modes I expect to stop on ^C, and
> maybe to have an interrupt handler that lets them stop gracefully.
> Applications that offer a CLI on the console, I expect to trap
> interrupts differently, needing an explicit command, or ^D, to
> exit. If the CLI has fancy command line editing, using something
> like libreadline, I don't expect ^D to exit either.

But Asterisk is a combination of both these types of apps:  it is both
a) a daemon, and b) has a console.  So while it's clear which behavior
you're advocating, your reasoning for choosing it is not.

-- 
Tilghman



More information about the asterisk-dev mailing list