Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 97828

Summary: Sudo returns segmentation fault
Product: [Retired] Red Hat Linux Reporter: Owen Marshall <owen>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 9CC: admin, drepper, fweimer, josh, twoerner, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: 2.3.2-31 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-08-05 17:07:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Owen Marshall 2003-06-22 19:47:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Description of problem:
Any command given to sudo will cause a crash (segmentation fault)

Version-Release number of selected component (if applicable):
sudo-1.6.7p5-2

How reproducible:
Always

Steps to Reproduce:
1. sudo /any command/

Actual Results:  [owen@www owen]$ sudo ls
Segmentation fault

Expected Results:  ... =-) Sudo should have listed the current directories 
contents.


ALSO tested on: sudo-1.6.6-3

Configuration is not an issue -- config file from working machine was used 
without problems.

Comment 1 Thomas Woerner 2003-06-23 09:14:38 UTC
sudo-1.6.6-3 is working for me on Red Hat 9 without any problems.

Which kernel and glibc versions are you using?


Comment 2 Owen Marshall 2003-06-23 13:43:51 UTC
[owen@www owen]$ rpm -q kernel
kernel-2.4.20-8
[owen@www owen]$ rpm -q glibc
glibc-2.3.2-27.9

Comment 3 Thomas Woerner 2003-06-23 14:11:35 UTC
Do you have set additional environment variables like LD_LIBRARY_PATH or
LD_PRELOAD that point to another glibc (for root or owen)?

If not, please install the latest updates for 9.


Comment 4 Josh Matthews 2003-07-21 21:10:18 UTC
I'm experiencing this as well, on my quad Xeon mail server.  Redhat 9 with sudo-
1.6.7p5-2 (upgraded from stock 1.6.6 in a failed effort to resolve) kernel-
2.4.20-8 & glibc-2.3.2-27.9.  

The last part of an 'strace /usr/bin/sudo' shows:

getpid()                                = 16715
time(NULL)                              = 1058821355
sendto(4, "\24\0\0\0\22\0\1\3\353T\34?\0\0\0\0\0a\5@", 20, 0, 
{sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0h\301\17B"}, 12) = 20
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0
\0\0\0"}, msg_iov(1)=[{"\264\0\0\0\20\0\2\0\353T\34?KA\0\0\0\377\4\3\1\0\0
\0I\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 368
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0
\0\0\0"}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\353T\34?KA\0\0\0\0\0\0\1\0\0\0I\0\0
\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
sendto(4, "\24\0\0\0\26\0\1\3\354T\34?\0\0\0\0\0a\5@", 20, 0, 
{sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0h\301\17B"}, 12) = 20
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\0\0\0\0\0\0\0\0\0\0\0
\0\0\0"}, msg_iov(1)=[{"D\0\0\0\24\0\0\0\354T\34?KA\0\0\2\10\200\376\1\0\0\0
\10"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 3944
brk(0)                                  = 0x8060000
brk(0x8061000)                          = 0x8061000
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\"\324\0\0\0\0\0\0\0\0
\0\0\0\0"}, msg_iov(1)=[{"D\0\0\0\24\0\0\0\354T\34?KA\0\0\2\10\201\0\2\0\0\0\10
\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 2244
brk(0)                                  = 0x8061000
brk(0x8062000)                          = 0x8062000
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, sa_data="\"\324\0\0\0\0\0\0\0\0
\0\0\0\0"}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\354T\34?KA\0\0\0\0\0\0\2\0\0\0\10\0
\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
brk(0)                                  = 0x8062000
brk(0x8065000)                          = 0x8065000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

Using gdb /usr/bin/sudo I get:

Starting program: /usr/bin/sudo
(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x420fb07b in getifaddrs () from /lib/tls/libc.so.6

I have RPM verified all my packages, and verified that /lib/tls/libc.so.6 is 
owned by my glibc package.  A /sbin/service network stop allows sudo to operate 
properly, but restarting networking again causes the segmentation fault.  I 
should probably also mention that I have eth0 listening on one class C, and 
about 50 IPs each from two other class C's assigned as eth0 aliases. 

Comment 5 Thomas Woerner 2003-07-22 14:45:36 UTC
There is a bug in glibc when using getifaddrs with more than 40 aliases to a
network device (tested with glibc-2.3.2-27.9). Please use the following code:

# cat > getifadd.c << EOF
#include <ifaddrs.h>

int main() {
  struct ifaddrs *ifaddrs;

  if (getifaddrs(&ifaddrs))
    printf("not ok\n");
  else
    printf("ok\n");

  return 1;
}
EOF

# gcc -o getifaddr getifaddr.c
# for i in `seq 1 40`; do ifconfig eth0:${i} 172.31.0.${i} up; done
# ./getifaddr
ok

# for i in `seq 1 41`; do ifconfig eth0:${i} 172.31.0.${i} up; done
# ./getifaddr
Segmentation fault

# gcc -g -O -o getifaddr-debug getifaddr.c /usr/lib/debug/libc.a
# gdb ./getifaddr-debug
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) r
Starting program: /tmp/getifaddr 

Program received signal SIGSEGV, Segmentation fault.
0x0805436d in getifaddrs (ifap=0xbffff6b4)
    at ../sysdeps/unix/sysv/linux/ifaddrs.c:427
427     ../sysdeps/unix/sysv/linux/ifaddrs.c: No such file or directory.
        in ../sysdeps/unix/sysv/linux/ifaddrs.c
(gdb) where
#0  0x0805436d in getifaddrs (ifap=0xbffff6b4)
    at ../sysdeps/unix/sysv/linux/ifaddrs.c:427
#1  0x0804c0c5 in main () at getifaddr.c:6
#2  0x0804c2d7 in __libc_start_main (main=0x804c0b0 <main>, argc=1, 
    ubp_av=0xbffff8f4, init=0x804c458 <__libc_csu_init>, 
    fini=0x804c4ac <__libc_csu_fini>, rtld_fini=0x4000cc10 <_dl_fini>, 
    stack_end=0xffffffff) at ../sysdeps/generic/libc-start.c:193


This program is working with glibc-2.3.2-63 without any problems.


Comment 6 Josh Matthews 2003-07-22 16:46:22 UTC
[root@mail sudo_problem]# gdb ./getifaddr-debug
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) r
Starting program: /root/sudo_problem/getifaddr-debug

Program received signal SIGSEGV, Segmentation fault.
0x0805436d in getifaddrs ()
(gdb) where
#0  0x0805436d in getifaddrs ()
#1  0x0804c0c5 in main () at getifaddrs.c:6
#2  0x0804c2d7 in __libc_start_main ()
(gdb)


Comment 7 devin 2003-07-24 22:34:05 UTC
so, have you guys found any kind of work around?  I guess I'll try to find a newer version of glibc...

Comment 8 Josh Matthews 2003-07-24 22:41:55 UTC
My workaround consisted of limiting my IP aliases down under 40.  This played 
hell with moving some mail domain, but by creating aliases I was able to work 
around this.  I surely hope that a stable glibc rpm is in the works, and due 
out very soon.

Comment 9 devin 2003-08-05 19:12:09 UTC
What?  This bug is closed?  What is the solution?  I tried an up2date and nothing new showed up 
for glibc.  anyone?

Comment 10 Ulrich Drepper 2003-11-04 21:40:32 UTC
Try the test release of the RHL9 errata at

  ftp://people.redhat.com/jakub/glibc/errata/2.3.2-27.9.4/           
                                                                    

And if you still have problems change the state of the bug, otherwise
I won't see it.