Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Sep 2001 20:37:57 -0400 (EDT)
From:      Joe Clarke <marcus@marcuscom.com>
To:        Christoph Sold <so@i-clue.de>
Cc:        <stable@FreeBSD.ORG>
Subject:   Re: 4.4-RC4 report [succes]
Message-ID:  <20010910203352.F30426-300000@shumai.marcuscom.com>
In-Reply-To: <3B9C6B98.4020601@i-clue.de>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Good new, I was able to reproduce this with IPv6 turned on.  I think these
patches should fix the problem.  You will still get a realloc warning if
you don't have an atalkd.conf file.  This is because atalkd keeps an extra
NULL entry at the tail of its kernel-obtained list of interfaces.  This
warning can be ignored.

I think the problem had to do with an incomplete rtmptab structure on
certain interfaces.  Thsi was causing the seg fault because the
rt_firstnet member of the rtmptab struct didn't exist.  Please let me know
if these patches work for you.

Oh, and if you're going to run netatalk with multiple interfaces (i.e.
multiple ethernet interfaces), you should always configure an atalkd.conf
before hand.

Joe

On Mon, 10 Sep 2001, Christoph Sold wrote:

> Joe Clarke wrote:
>
> >Thanks, I'll let you know if I find something.
> >
> >Joe
> >
> >On Mon, 10 Sep 2001, Christoph Sold wrote:
> >
> >>Joe Clarke wrote:
> >>
> >>>Please let me know what problems you had with netatalk, and what version
> >>>of the port/package you're playing with.
> >>>
> >>>Joe
> >>>
> >>>On Mon, 10 Sep 2001, Christoph Sold wrote:
> >>>
> >>>>Hi Folks,
> >>>>
> >>>>build 4.4-RC4 from source (CVSup with date=2001-09-09-23.59.00).
> >>>>Everything went fine, all neccessary services (NFS, NIS, samba, ftp,
> >>>>ssh,  ...) are running smoothly.
> >>>>A problem running netatalk popped up, still investigating that.
> >>>>
> >>During boot, atalkd dies, dumping core:
> >>
> >># dmesg
> >>...
> >>da1: 34732MB (71132959 512 byte  sectors: 255H 63S/T 4427C)
> >>pid 277 (atalkd), uid 0: exited on signal 11 (core dumped)
> >>...
> >>
> >>subsequently,
> >>
> >>Sep  9 15:00:56 potzblix afpd[281]: main: atp_open: Can't assign
> >>requested address
> >>
> >>Anyhow, /usr/local/sbin/afpd is still running.
> >>
> >>The resulting core is mailed to you along with all the gory details
> >>separately.
> >>
> After deleting all the cruft and re-installing netatalk-1.5p7_1 from the
> ports, the problem persists:
>
> # /usr/local/etc/rc.d/netatalk start
>  netatalkdatalkd in realloc(): warning: chunk is already free.
> atalkd in free(): warning: chunk is already free.
> Segmentation fault - core dumped.
>
> HTH
> -Christoph Sold
>
>
>

[-- Attachment #2 --]
--- rtmp.c.orig	Mon Sep 10 20:32:10 2001
+++ rtmp.c	Mon Sep 10 20:32:44 2001
@@ -592,7 +592,7 @@
 	    /*
 	     * Is route on this gateway?
 	     */
-	    for ( rtmp = gate->g_rt; rtmp; rtmp = rtmp->rt_next ) {
+	    for ( rtmp = gate->g_rt; rtmp && sizeof(rtmp) == sizeof(struct rtmptab); rtmp = rtmp->rt_next ) {
 		if ( ntohs( rtmp->rt_firstnet ) <= ntohs( rt.rt_net ) &&
 			ntohs( rtmp->rt_lastnet ) >= ntohs( rt.rt_net )) {
 		    break;

[-- Attachment #3 --]
--- getiface.c.orig	Mon Sep 10 20:31:10 2001
+++ getiface.c	Mon Sep 10 20:31:35 2001
@@ -44,11 +44,16 @@
     /* if we've run out of room, allocate some more. just return
      * the present list if we can't. */
      if (*i >= *length) {
-      char **new = realloc(list, sizeof(char **)*(*length + IFACE_NUM));
+      char **new = realloc(list, sizeof(char **)*(*length + 1));
        
       if (!new) /* just break if we can't allocate anything */
 	return -1;
-      *length += IFACE_NUM;
+
+      /* copy the old list */
+      memcpy(new, list, *length);
+      list = new;
+      
+      *length += 1;
     }
      
     if ((list[*i] = strdup(name)) == NULL)
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010910203352.F30426-300000>