public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nscd/28490] New: Possible race condition for nscd
@ 2021-10-23  5:21 ttwd80 at gmail dot com
  0 siblings, 0 replies; only message in thread
From: ttwd80 at gmail dot com @ 2021-10-23  5:21 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28490

            Bug ID: 28490
           Summary: Possible race condition for nscd
           Product: glibc
           Version: 2.31
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: nscd
          Assignee: unassigned at sourceware dot org
          Reporter: ttwd80 at gmail dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

I run nscd in a container, ubuntu:20.04.

I use selenium to control google chrome using google chrome driver.
Google Chrome: 95
Google Chrome driver: 95
Selenium: 4.0.0
Python: 3.9

I start nscd and request www.google.com from the browser using selenium.
This is the log when it does work:

https://github.com/ttwd80/whw/runs/3982474693?check_suite_focus=true

in step: verify_nscd_cache_hit

Request time: 2021-10-23 04:21:23

Request time: 2021-10-23 04:22:23

Request time: 2021-10-23 04:23:23

Sat Oct 23 04:21:23 2021 - 7039: provide access to FD 7, for passwd
Sat Oct 23 04:21:23 2021 - 7039: handle_request: request received (Version = 2)
from PID 7165
Sat Oct 23 04:21:23 2021 - 7039:        GETHOSTBYNAME (www.google.com)
Sat Oct 23 04:21:23 2021 - 7039: Haven't found "www.google.com" in hosts cache!
Sat Oct 23 04:21:23 2021 - 7039: add new entry "www.google.com" of type
GETHOSTBYNAME for hosts to cache (first)
Sat Oct 23 04:21:31 2021 - 7039: pruning passwd cache; time 1634962891

04:21:23.314290 IP 172.23.0.101.55321 > 208.67.222.123.53: 17529+ [1au] A?
accounts.google.com. (48)
04:21:23.468566 IP 172.23.0.101.50593 > 208.67.222.123.53: 20275+ [1au] A?
www.google.com. (43)
04:22:23.302644 IP 172.23.0.101.37247 > 208.67.222.123.53: 30809+ [1au] A?
update.googleapis.com. (50)
04:22:23.371129 IP 172.23.0.101.36864 > 208.67.222.123.53: 63041+ [1au] A?
edgedl.me.gvt1.com. (47)

Three requests made, exactly one minute apart. Only one goes out to OpenDNS.
The other 2 uses the cached result. In this run, it works as expected.

Here is another run, but this does not work as expected:

https://github.com/ttwd80/whw/runs/3982474716?check_suite_focus=true
in step: verify_nscd_cache_miss

Sat Oct 23 04:21:40 2021 - 7044: provide access to FD 11, for hosts
Sat Oct 23 04:21:40 2021 - 7044: handle_request: request received (Version = 2)
from PID 7172
Sat Oct 23 04:21:40 2021 - 7044:        GETHOSTBYNAME (www.google.com)
Sat Oct 23 04:21:40 2021 - 7044: Haven't found "www.google.com" in hosts cache!
Sat Oct 23 04:21:49 2021 - 7044: pruning passwd cache; time 1634962909
Sat Oct 23 04:21:49 2021 - 7044: considering GETPWBYUID entry "0", timeout
1634963499
Sat Oct 23 04:21:49 2021 - 7044: considering GETPWBYUID entry "1000", timeout
1634963499
Sat Oct 23 04:21:49 2021 - 7044: considering GETPWBYNAME entry "ubuntu",
timeout 1634963499
Sat Oct 23 04:21:49 2021 - 7044: considering GETPWBYNAME entry "root", timeout
1634963499
Sat Oct 23 04:21:49 2021 - 7044: considering GETPWBYUID entry "105", timeout
1634963499
Sat Oct 23 04:21:49 2021 - 7044: considering GETPWBYNAME entry "tcpdump",
timeout 1634963499
Sat Oct 23 04:21:50 2021 - 7044: pruning group cache; time 1634962910
Sat Oct 23 04:21:50 2021 - 7044: considering GETGRBYGID entry "1000", timeout
1634966499
Sat Oct 23 04:21:50 2021 - 7044: considering GETGRBYNAME entry "ubuntu",
timeout 1634966499
Sat Oct 23 04:21:50 2021 - 7044: considering INITGROUPS entry "ubuntu", timeout
1634962959
Sat Oct 23 04:21:50 2021 - 7044: considering INITGROUPS entry "root", timeout
1634962959
Sat Oct 23 04:21:50 2021 - 7044: considering INITGROUPS entry "tcpdump",
timeout 1634962959
Sat Oct 23 04:21:51 2021 - 7044: pruning hosts cache; time 1634962911
Sat Oct 23 04:21:51 2021 - 7044: considering GETAI entry "localhost", timeout
1634966499
Sat Oct 23 04:21:51 2021 - 7044: considering GETHOSTBYNAME entry
"accounts.google.com", timeout 1634963200
Sat Oct 23 04:21:52 2021 - 7044: pruning services cache; time 1634962912
Sat Oct 23 04:22:39 2021 - 7044: pruning group cache; time 1634962959
Sat Oct 23 04:22:39 2021 - 7044: considering GETGRBYGID entry "1000", timeout
1634966499
Sat Oct 23 04:22:39 2021 - 7044: considering GETGRBYNAME entry "ubuntu",
timeout 1634966499
Sat Oct 23 04:22:39 2021 - 7044: considering INITGROUPS entry "ubuntu", timeout
1634962959
Sat Oct 23 04:22:39 2021 - 7044: considering INITGROUPS entry "root", timeout
1634962959
Sat Oct 23 04:22:39 2021 - 7044: considering INITGROUPS entry "tcpdump",
timeout 1634962959
Sat Oct 23 04:22:40 2021 - 7044: handle_request: request received (Version = 2)
from PID 7172
Sat Oct 23 04:22:40 2021 - 7044:        GETHOSTBYNAME (update.googleapis.com)
Sat Oct 23 04:22:40 2021 - 7044: Haven't found "update.googleapis.com" in hosts
cache!
Sat Oct 23 04:22:40 2021 - 7044: add new entry "update.googleapis.com" of type
GETHOSTBYNAME for hosts to cache (first)
Sat Oct 23 04:22:40 2021 - 7044: handle_request: request received (Version = 2)
from PID 7172
Sat Oct 23 04:22:40 2021 - 7044:        GETHOSTBYNAME (edgedl.me.gvt1.com)
Sat Oct 23 04:22:40 2021 - 7044: Haven't found "edgedl.me.gvt1.com" in hosts
cache!
Sat Oct 23 04:22:40 2021 - 7044: add new entry "edgedl.me.gvt1.com" of type
GETHOSTBYNAME for hosts to cache (first)
Sat Oct 23 04:22:41 2021 - 7044: handle_request: request received (Version = 2)
from PID 7172
Sat Oct 23 04:22:41 2021 - 7044:        GETHOSTBYNAME (www.google.com)
Sat Oct 23 04:22:41 2021 - 7044: Haven't found "www.google.com" in hosts cache!
Sat Oct 23 04:22:54 2021 - 7044: pruning group cache; time 1634962974
Sat Oct 23 04:22:54 2021 - 7044: considering GETGRBYGID entry "1000", timeout
1634966499
Sat Oct 23 04:22:54 2021 - 7044: considering GETGRBYNAME entry "ubuntu",
timeout 1634966499
Sat Oct 23 04:22:54 2021 - 7044: considering INITGROUPS entry "ubuntu", timeout
1634962959
Sat Oct 23 04:22:54 2021 - 7044: considering INITGROUPS entry "root", timeout
1634962959
Sat Oct 23 04:22:54 2021 - 7044: considering INITGROUPS entry "tcpdump",
timeout 1634962959
Sat Oct 23 04:22:54 2021 - 7044: remove INITGROUPS entry "ubuntu"
Sat Oct 23 04:22:54 2021 - 7044: remove INITGROUPS entry "root"
Sat Oct 23 04:22:54 2021 - 7044: remove INITGROUPS entry "tcpdump"
Sat Oct 23 04:22:54 2021 - 7044: freed 240 bytes in group cache
Sat Oct 23 04:23:41 2021 - 7044: handle_request: request received (Version = 2)
from PID 7172
Sat Oct 23 04:23:41 2021 - 7044:        GETHOSTBYNAME (www.google.com)
Sat Oct 23 04:23:41 2021 - 7044: Haven't found "www.google.com" in hosts cache!
Sat Oct 23 04:23:41 2021 - 7044: handle_request: request received (Version = 2)
from PID 7557
Sat Oct 23 04:23:41 2021 - 7044:        GETFDPW
Sat Oct 23 04:23:41 2021 - 7044: provide access to FD 7, for passwd
Sat Oct 23 04:23:41 2021 - 7044: handle_request: request received (Version = 2)
from PID 7557
Sat Oct 23 04:23:41 2021 - 7044:        GETFDGR
Sat Oct 23 04:23:41 2021 - 7044: provide access to FD 9, for group
Sat Oct 23 04:23:41 2021 - 7044: handle_request: request received (Version = 2)
from PID 7557
Sat Oct 23 04:23:41 2021 - 7044:        INITGROUPS (root)
Sat Oct 23 04:23:41 2021 - 7044: Haven't found "root" in group cache!
Sat Oct 23 04:23:41 2021 - 7044: add new entry "root" of type INITGROUPS for
group to cache (first)

multiple requests to www.google.com but none of them gets "add new entry
"www.google.com" of type GETHOSTBYNAME for hosts to cache (first)"

Other entries are added to the cache, "add new entry "edgedl.me.gvt1.com" of
type GETHOSTBYNAME for hosts to cache (first)"

Not sure if this is a bug or just a misconfiguration on my side.

Actual: "add new entry "www.google.com" of type GETHOSTBYNAME for hosts to
cache (first)" sometimes happen after "Haven't found "www.google.com" in hosts
cache!"
Expected: "add new entry "www.google.com" of type GETHOSTBYNAME for hosts to
cache (first)" to happen every single time after "Haven't found
"www.google.com" in hosts cache!"

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-23  5:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-23  5:21 [Bug nscd/28490] New: Possible race condition for nscd ttwd80 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).