From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3202dfb595cd0be6e6cd539e34de0bc3.axp-list@archive.invalid> X-Archive-Original-Message-ID: <3.0.3.32.19970925032915.0092e100@pop4.ibm.net> Date: Thu, 25 Sep 1997 11:35:28 -0400 (EDT) From: Stephen Zedalis Subject: Netstat Unaligned Trap Errors on Alpha 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