Bug 1302998 - sudo -i takes 10 seconds
sudo -i takes 10 seconds
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: sudo (Show other bugs)
23
x86_64 Linux
unspecified Severity low
: ---
: ---
Assigned To: Radovan Sroka
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-29 04:13 EST by Marc
Modified: 2016-02-10 09:01 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-10 08:43:12 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
output of sudo strace -r -o trace2.log sudo -i (137.95 KB, text/plain)
2016-01-29 07:38 EST, Marc
no flags Details
sudo -i strace on 4.2.8 (137.80 KB, text/plain)
2016-01-30 06:18 EST, Marc
no flags Details
output of "sudo strace -r -f sudo -i (1.12 MB, text/plain)
2016-02-02 09:15 EST, Marc
no flags Details
output of "sudo strace -r -T -ff -o sudo.trace sudo -i" (98.57 KB, application/x-gzip)
2016-02-02 10:47 EST, Marc
no flags Details
output of "sudo strace -r -T -ff -o sudo428.trace sudo -i" (103.49 KB, application/zip)
2016-02-07 03:31 EST, Marc
no flags Details

  None (edit)
Description Marc 2016-01-29 04:13:35 EST
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 04:15:31 EST
under version-release it should say kernel-4.3.3-303.fc23.x86_64
Comment 2 Radovan Sroka 2016-01-29 06:26:25 EST
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 06:47:45 EST
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 07:21:51 EST
If you can make a strace just put it here.




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

strace attached
Comment 6 Marc 2016-01-30 06:17:24 EST
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 06:18 EST
Created attachment 1119631 [details]
sudo -i strace on 4.2.8
Comment 8 Radovan Sroka 2016-02-02 09:07:50 EST
Hi,

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

Thanks.

rsroka
Comment 9 Marc 2016-02-02 09:15 EST
Created attachment 1120447 [details]
output of "sudo strace -r -f sudo -i

here you go
Comment 10 Radovan Sroka 2016-02-02 10:30:59 EST
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 10:47 EST
Created attachment 1120481 [details]
output of "sudo strace -r -T -ff -o sudo.trace sudo -i"
Comment 12 Marc 2016-02-07 03:13:36 EST
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 03:31 EST
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 08:08:21 EST
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 08:23:54 EST
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 08:43:41 EST
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 08:49:00 EST
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 02:08:39 EST
(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 02:12:51 EST
I meant why lspci is issued from sudo -i, sorry
Comment 20 Radovan Sroka 2016-02-10 08:43:12 EST
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 09:01:17 EST
Hi Radovan, 

Got it. thanks. Opened a bug on pciutils.

Note You need to log in before you can comment on or make changes to this bug.