Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Stephen Zedalis <tintype@exis.net>
Subject: Netstat Unaligned Trap Errors on Alpha
Date: Thu, 25 Sep 1997 11:35:28 -0400 (EDT)	[thread overview]
Message-ID: <3202dfb595cd0be6e6cd539e34de0bc3.axp-list@archive.invalid> (raw)

Problem summary:  There have been several reports of unaligned trap errors
on DEC Alpha machines on various user programs.  One program that is
susceptible is netstat provided in Redhat 4.2 for Alpha.  The specific
net-tools version is 1.32-alpha, rpm installed is based on
net-tools-1.3.2.alpha-2.src.rpm.  I am running kernel 2.0.31-pre9 on a DEC
PC164 (Durango) 500 Mhz 21164 machine with 256 MB of RAM.

I was perturbed to find out that a high profile diagnostic and
administration tool like "netstat" was giving these unaligned trap errors,
and surprised to find out it got through RedHat's normally superb 
QA.  On examination of one of the patches in Redhat's source rpm, I found
that some of the necessary fixes were made but not all of them.  The fix
involves replacing pointer type casts such as (unsigned long*)&xxxxx with
a copy of the address to the variable involved.

The patches provided with Redhat fixed 2 of 3 occurrences of this bug.
(fixing the udp and UNIX domain socket output) Unfortunately this still
resulted in unaligned trap errors printed to the screen and in the syslog
just before the tcp socket output messages.  I have taken the liberty of
patching the offending code and now I get zero unaligned trap errors when
using netstat.  I have provided the patch required below...  Hopefully,
this will be provided to alpha users who may still be experiencing this
problem.

Stephen Zedalis
System Administrator - Exis Net, Inc.  

Here is my net-tools-1.32-alpha-axp2.patch:

*** net-tools-1.32-alpha.orig/netstat.c	Thu Sep 25 09:07:15 1997
--- net-tools-1.32-alpha/netstat.c	Thu Sep 25 09:13:43 1997
***************
*** 308,322 ****
  	}
    }
    (void) fclose(procinfo);
    lnr--; lnr--;
    while (lnr >= 0) {
  	num = sscanf(line[lnr--],
  		"%d: %lX:%X %lX:%X %X %lX:%lX %X:%lX %lX %d\n",
! 		&d, (unsigned long*)&localaddr.sin_addr.s_addr, &local_port,
! 		(unsigned long*)&remaddr.sin_addr.s_addr, &rem_port, &state,
  		&txq, &rxq, &timer_run, &time_len, &retr, &uid);
  	if (flag_deb) fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_args,
  						  "%s -> %d args"), line[lnr+1], num);
  	if (num < 11) continue;		/* 13 ? */
  	localaddr.sin_family = AF_INET;
  	remaddr.sin_family = AF_INET;
--- 308,325 ----
  	}
    }
    (void) fclose(procinfo);
    lnr--; lnr--;
    while (lnr >= 0) {
+ 	unsigned long laddr, raddr;
  	num = sscanf(line[lnr--],
  		"%d: %lX:%X %lX:%X %X %lX:%lX %X:%lX %lX %d\n",
! 		&d, &laddr, &local_port,
! 		&raddr, &rem_port, &state,
  		&txq, &rxq, &timer_run, &time_len, &retr, &uid);
+ 		localaddr.sin_addr.s_addr = laddr;
+ 		remaddr.sin_addr.s_addr = raddr;
  	if (flag_deb) fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_args,
  						  "%s -> %d args"), line[lnr+1], num);
  	if (num < 11) continue;		/* 13 ? */
  	localaddr.sin_family = AF_INET;
  	remaddr.sin_family = AF_INET;

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1997-09-25 15:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-25 15:35 Stephen Zedalis [this message]
     [not found] <E0xEKjL-0007P3-00@paddington.london.uk.eu.org>
1997-09-25 20:44 ` Netstat Unaligned Trap Errors on Alpha Steve Wills
1997-09-25 21:26 ` Stephen Zedalis
  -- strict thread matches above, loose matches on Subject: below --
1997-09-25 21:41 Philip Blundell
1997-09-26 20:00 Philip Blundell
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox