Bug 1302998

Summary: sudo -i takes 10 seconds
Product: [Fedora] Fedora Reporter: Marc <marc_vd_meer>
Component: sudoAssignee: Radovan Sroka <rsroka>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 23CC: chunnayya, dkopecek, kzak, rsroka
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-10 13:43:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
output of sudo strace -r -o trace2.log sudo -i
none
sudo -i strace on 4.2.8
none
output of "sudo strace -r -f sudo -i
none
output of "sudo strace -r -T -ff -o sudo.trace sudo -i"
none
output of "sudo strace -r -T -ff -o sudo428.trace sudo -i" none

Description Marc 2016-01-29 09:13:35 UTC
Description of problem:
Kernels 4.3.3-3xx "sudo -i" takes exactly 10 seconds to complete

Version-Release number of selected component (if applicable):
4.3.3-303.fc23.x86_64, sudo-1.8.15-1.fc23.x86_64
libsss_sudo-1.13.3-3.fc23.x86_64


How reproducible:
enter command "sudo -i" and enter account password.

Steps to Reproduce:
1.
2.
3.

Actual results:
takes 10 seconds to complete


Expected results:
should take less than a second to complete, as in all previous kernels


Additional info:
sudo followed by any privileged command picks up immediately (as always). Only duso -i takes 10 seconds to end up in root prompt.

Comment 1 Marc 2016-01-29 09:15:31 UTC
under version-release it should say kernel-4.3.3-303.fc23.x86_64

Comment 2 Radovan Sroka 2016-01-29 11:26:25 UTC
Hi,

can you give me some more information?

e.g. content of /etc/nsswitch.conf and sudoers or what name provider you are using and it's configuration and so on...


rsroka

Comment 3 Marc 2016-01-29 11:47:45 UTC
Hi, note that when I boot back in a kernel 4.2.x sudo -i completes in less than a second. I only see the 10 second wait with kernels 4.3.3
I run a standard desktop version of F23, Xfce DM. selinux disabled.

/etc/nsswitch.conf:
passwd:     files sss
shadow:     files sss
group:      files sss

hosts:      files mdns4_minimal [NOTFOUND=return] dns myhostname mymachines


bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files sss

netgroup:   files sss

publickey:  nisplus

automount:  files sss
aliases:    files nisplus

/etc/sudoers:
Defaults   !visiblepw

Defaults    env_reset
Defaults    env_keep =  "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS"
Defaults    env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults    env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults    env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults    env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin
root    ALL=(ALL)       ALL
%wheel  ALL=(ALL)       ALL
%desktop_admin_r        ALL=(ALL)       ALL

Comment 4 Radovan Sroka 2016-01-29 12:21:51 UTC
If you can make a strace just put it here.




rsroka

Comment 5 Marc 2016-01-29 12:38:14 UTC
Created attachment 1119421 [details]
output of sudo strace -r -o trace2.log sudo -i

strace attached

Comment 6 Marc 2016-01-30 11:17:24 UTC
having added exit to /root/.bashrc this is the difference between kernels 4.3.3 and 4.2.8 (and previous)

kernel 4.3.3-303.fc23.x86_64:
----------------------------
[marc@marchost ~]$ time sudo -i
[sudo] password for marc:

real    0m11.618s
user    0m0.039s
sys     0m0.755s

kernel 4.2.8-300.fc23.x86_64:
----------------------------
[marc@marchost ~]$ time sudo -i
[sudo] password for marc:

real    0m3.307s
user    0m0.066s
sys     0m0.747s

new attachment is output of sudo strace -r -o kernel428sudo.trace sudo -i on kernel 4.2.8. Big difference in timer value of "--- SIGCHLD"

Comment 7 Marc 2016-01-30 11:18:26 UTC
Created attachment 1119631 [details]
sudo -i strace on 4.2.8

Comment 8 Radovan Sroka 2016-02-02 14:07:50 UTC
Hi,

strace -f would be helpful because it trace child processes too.

Thanks.

rsroka

Comment 9 Marc 2016-02-02 14:15:57 UTC
Created attachment 1120447 [details]
output of "sudo strace -r -f sudo -i

here you go

Comment 10 Radovan Sroka 2016-02-02 15:30:59 UTC
Hi,

maybe for some more information would be extremely helpful if you use "strace -r -T -ff -o output sudo -i".

Thanks.

rsroka

Comment 11 Marc 2016-02-02 15:47:29 UTC
Created attachment 1120481 [details]
output of "sudo strace -r -T -ff -o sudo.trace sudo -i"

Comment 12 Marc 2016-02-07 08:13:36 UTC
I did some more time commands in kernel 4.3.4 - no difference:

[marc@marchost ~]$ time sudo -i

real    0m8.840s
user    0m0.075s
sys    0m0.769s
[marc@marchost ~]$ time sudo -i

real    0m8.769s
user    0m0.057s
sys    0m0.764s

and redid the same in kernel 4.2.8 to make sure I'm not imagening stuff:

[marc@marchost ~]$ time sudo -i

real	0m0.081s
user	0m0.055s
sys	0m0.029s
[marc@marchost ~]$ time sudo -i

real	0m0.084s
user	0m0.056s
sys	0m0.032s
[marc@marchost ~]$ time sudo -i

real	0m0.055s
user	0m0.032s
sys	0m0.025s

A rather huge difference.

Comment 13 Marc 2016-02-07 08:31:01 UTC
Created attachment 1121862 [details]
output of "sudo strace -r -T -ff -o sudo428.trace sudo -i"

strace of sudo -i in kernel 4.2.8 for comparison.

Comment 14 Radovan Sroka 2016-02-08 13:08:21 UTC
Hi,

is there any lspci command in your /root/.bashrc?

Try "time lspci".

It looks like your root shell is executing .bashrc and somewhere in .bashrc is lspci that last too long.

rsroka

Comment 15 Marc 2016-02-08 13:23:54 UTC
Interesting, no there is no lspci in /root/.bashrc:

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

set -o vi

alias l='ls -la'
alias h='ls -lah'
alias ltr='ls -ltra'
alias htr='ls -ltrah'

Indeed lspci takes a lot of time. I will compare this on a pre-kernel 4.3 when I have the time to reboot.

[marc@marchost ~]$ time lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:16.2 IDE interface: Intel Corporation 8 Series/C220 Series Chipset Family IDE-r Controller (rev 04)
00:16.3 Serial controller: Intel Corporation 8 Series/C220 Series Chipset Family KT Controller (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-LM (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d4)
00:1c.1 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #2 (rev d4)
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d4)
00:1c.4 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #5 (rev d4)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation QM87 Express LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107GLM [Quadro K1100M] (rev a1)
02:00.0 SD Host controller: O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01)
03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 83)

real	0m8.741s
user	0m0.005s
sys	0m0.737s

Comment 16 Radovan Sroka 2016-02-08 13:43:41 UTC
Hi,

8.731063 open("/sys/bus/pci/devices/0000:01:00.0/label", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000067>

I think that it's your nvidia which makes a trouble so check the drivers and other related things...

But this is definitely not a Sudo bug.

rsroka

Comment 17 Marc 2016-02-08 13:49:00 UTC
lspci timed on kernel 4.2.8

[marc@marchost ~]$ uname -r
4.2.8-300.fc23.x86_64
[marc@marchost ~]$ time lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:16.3 Serial controller: Intel Corporation 8 Series/C220 Series Chipset Family KT Controller (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-LM (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d4)
00:1c.1 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #2 (rev d4)
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d4)
00:1c.4 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #5 (rev d4)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation QM87 Express LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107GLM [Quadro K1100M] (rev a1)
02:00.0 SD Host controller: O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01)
03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 83)

real	0m0.740s
user	0m0.005s
sys	0m0.734s

Strangely enough lspci on 4.3.x reports an IDE interface, where lspci on 4.2.8 does not?
I don't know why lspci is invoked in the first place when doing "sudo -i", it is not in /root/.bashrc, nor is it in /etc/bashrc

Comment 18 Marc 2016-02-09 07:08:39 UTC
(In reply to Radovan Sroka from comment #16)
> Hi,
> 
> 8.731063 open("/sys/bus/pci/devices/0000:01:00.0/label", O_RDONLY) = -1
> ENOENT (No such file or directory) <0.000067>
> 
> I think that it's your nvidia which makes a trouble so check the drivers and
> other related things...
> 
> But this is definitely not a Sudo bug.
> 
> rsroka

Agreed, however it is a mystery why strace is issued when doing sudo -i, and why lspci started misbehaving in kernel 4.3

Comment 19 Marc 2016-02-09 07:12:51 UTC
I meant why lspci is issued from sudo -i, sorry

Comment 20 Radovan Sroka 2016-02-10 13:43:12 UTC
Hi Marc,

/etc/bashrc executes every script from /etc/profile.d and qt-graphicssystem.sh runs lspci and that lasts too long. 

rsroka

Comment 21 Marc 2016-02-10 14:01:17 UTC
Hi Radovan, 

Got it. thanks. Opened a bug on pciutils.