[comp.mail.misc] Pathalias creating recursive paths for site island and moon!!

dean@coplex.uucp (Dean Brooks) (05/22/91)

   Ack!  I just recently looked in our pathalias database after receiving
a few bounced messages, and found something very wrong...

   We are running the latest version of pathalias (ver. 9 distrubted with
smail 3.1.19), and are directly connected to "uunet" via uucp.

   Here are a few of the sample entries:

This is the the path it shows to uunet, to which we are directly connected!!

uunet!dis!moon!island!uunet!moon!island!uunet!moon!island!uunet!moon!island!
               uunet!moon!island!uunet!moon!island!uunet!moon!island!uunet!
               moon!island!uunet

This is the output when I do a path to site "moon":

uunet!unhd!uunet!moon!island!uunet!moon!island!uunet!moon!island!uunet!moon!
               island!uunet!moon!island!uunet!moon!island!uunet!moon!
               island!uunet!moon

If I remove the sites "island" and "moon" from the maps, everything
comes out ok in the database.  Probably an easy problem to find.
 
Anyone else seen this?  Is this a problem with pathalias, or is it a
problem with a vertain map entry?

--
dean@coplex.uucp (Dean Brooks)
Copper Electronics, Inc.
Louisville, Kentucky

bad@flatlin.ka.sub.org (Christoph Badura) (05/23/91)

In <1991May21.204119.652@coplex.uucp> dean@coplex.uucp (Dean Brooks) writes:
>   Here are a few of the sample entries:

>This is the output when I do a path to site "moon":

>uunet!unhd!uunet!moon!island!uunet!moon!island!uunet!moon!island!uunet!moon!
>               island!uunet!moon!island!uunet!moon!island!uunet!moon!
>               island!uunet!moon

>Anyone else seen this?  Is this a problem with pathalias, or is it a
>problem with a vertain map entry?

Yes. I ran into this about four weeks ago. It is a nontrivial bug in
the handling of terminal links. It is, however, sensitive to changes in
the input.

Here is a minimal map I came up with. Note the different behaviour
when you swap the two lines for agsc.

pathalias -c -l agsc <<!END!
agsc	metropo
agsc	influx

influx	<climax>
climax	<metropo>
metropo	<influx>
!END!

Apparently all versions of pathalias have this problem. The Smail3
version produces negative costs in this case. The version on
citi.umich.edu just eats up all memory producing no output. And the
version on uunet produces recursive paths too, I am told.

>   We are running the latest version of pathalias (ver. 9 distrubted with
>smail 3.1.19), and are directly connected to "uunet" via uucp.

The smail3 version should not only produce recursive paths for the above
input, it should get the wrong host before the last bang. :-(

If you need a preliminary fix, mail me.

	chris
-- 
Christoph Badura					Karlsruhe, Deutschland
bad@flatlin.ka.sub.org					+49 721 606137

sean@firefly.rain.com (Sean Sheedy) (05/23/91)

In article <1991May21.204119.652@coplex.uucp> dean@coplex.uucp (Dean Brooks) writes:
>   Here are a few of the sample entries:
>
>This is the the path it shows to uunet, to which we are directly connected!!
>
>uunet!dis!moon!island!uunet!moon!island!uunet!moon!island!uunet!moon!island!
>               uunet!moon!island!uunet!moon!island!uunet!moon!island!uunet!
>               moon!island!uunet
>
>[...]
> 
>Anyone else seen this?  Is this a problem with pathalias, or is it a
>problem with a vertain map entry?

Yes, I've seen it and (partially) tracked down the problem.  The following
lines are in mapit.c:

        if (DEADLINK(l))
                cost += INF;                             /* dead link */
        if (DEADHOST(prev))
                cost += INF;                             /* dead parent */
        if (GATEWAYED(next) && !(l->l_flag & LGATEWAY))
                cost += INF;                             /* not gateway */
        if (!ISANET(prev)) {
                if ((NETDIR(l) == LLEFT && (prev->n_flag & HASRIGHT))
                 || (NETDIR(l) == LRIGHT && (prev->n_flag & HASLEFT)))
                        cost += INF;                     /* mixed syntax */
        }

where INF is 100 million.  Something about the most recent set of maps causes
this code to be executed a lot for some paths, causing cost to wrap around
to a negative number.  Strange results then occur.  Changing "+=" to "="
seems to fix the problem and give reasonable paths.

Sean

-- 
Sean Sheedy					sean@firefly.rain.com

Every decent man is ashamed of the government he lives under.	-- H.L. Mencken

kim@mcrware.UUCP (Kim Kempf) (05/23/91)

In article <1991May21.204119.652@coplex.uucp> dean@coplex.uucp (Dean Brooks) writes:
>uunet!dis!moon!island!uunet!moon!island!uunet!moon!island!uunet!moon!island!
>               uunet!moon!island!uunet!moon!island!uunet!moon!island!uunet!
>               moon!island!uunet

Yes!  This is a problem.  Has anyone figured a fix for this (either in
pathalias or the map entries)?  Thanks in advance.

----------------
Kim Kempf, Microware Systems Corporation         {sun,uunet}!mcrware!kim
"Opinions!  We doan need no stinkink opinions!"  kim@microware.com

-- 
----------------
Kim Kempf, Microware Systems Corporation         {sun,uunet}!mcrware!kim
"Opinions!  We doan need no stinkink opinions!"  kim@microware.com

bad@flatlin.ka.sub.org (Christoph Badura) (05/25/91)

In <1991May22.203115.17990@firefly.rain.com> sean@firefly.rain.com (Sean Sheedy) writes:
>[He proposes to change the assignment to cost in mapit.c$costof()
> from    cost += INF;   to    cost = INF; ]

Sorry, this is the wrong fix. This is the same code as in the
pathalias on citi.umich.edu and it doesn't work for the 5-liner I
posted. I've verified that with the Smail3 version and some source
that was sent to me as version 10.

	chris
-- 
Christoph Badura					Karlsruhe, Deutschland
bad@flatlin.ka.sub.org					+49 721 606137

bad@flatlin.ka.sub.org (Christoph Badura) (05/26/91)

In <1991May22.191401.7947@flatlin.ka.sub.org> I wrote:

>The smail3 version should not only produce recursive paths for the above
>input, it should get the wrong host before the last bang. :-(

Forget this. I was dead sure I've seen this while testing but I can't
reproduce it with my test cases.

Thanks to Ronald Karr for the correction.

	chris
-- 
Christoph Badura					Karlsruhe, Deutschland
bad@flatlin.ka.sub.org					+49 721 606137