From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AECF8385801A; Wed, 10 Aug 2022 03:00:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AECF8385801A From: "mingli.yu at windriver dot com" To: glibc-bugs@sourceware.org Subject: [Bug nscd/29402] nscd: No such file or directory Date: Wed, 10 Aug 2022 03:00:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nscd X-Bugzilla-Version: 2.35 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mingli.yu at windriver dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2022 03:00:09 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29402 --- Comment #2 from Mingli --- And add some debug info as below. # vi nss/nss_files/files-init.c [snip] static void register_file (void (*cb) (size_t, struct traced_file *),=20 int db, const char *path, int crinit) { size_t pathlen =3D strlen (path) + 1; struct traced_file *file =3D malloc (sizeof (struct traced_file) + pathle= n); /* Do not register anything on memory allocation failure. nscd will fail soon anyway. */ if (file !=3D NULL) {=20=20=20 init_traced_file (file, path, crinit); syslog (LOG_NOTICE, "in register_file before %s %p", file->fname, fil= e); cb (db, file); syslog (LOG_NOTICE, "in register_file after %s %p", file->fname, file= ); } } [snip] # vi nscd/connections.c [snip] void register_traced_file (size_t dbidx, struct traced_file *finfo) { /* If the database is disabled or file checking is disabled then ignore the registration. */ dbg_log("in register_traced_file %s %p", finfo->fname, file); [snip] Install the patched nscd and run "systemctl status nscd" # cat /var/log/syslog [snip] 2022-08-10T08:28:49.403612+00:00 intel-x86-64 nscd: in register_file before /etc/passwd 0x56610fe0 2022-08-10T08:28:49.411267+00:00 intel-x86-64 nscd: in register_traced_file /passwd 0x56610fe0 2022-08-10T08:28:49.403612+00:00 intel-x86-64 nscd: in register_file after /etc/passwd 0x56610fe0 [snip] It turns out the pointer address is the same as 0x56610fe0 for file both in function register_file and register_traced_file. But the contents of file->fname is different. Confusing about the different behavior and I thin= k it should be same for file->fname. Why it is different? Any hints? --=20 You are receiving this mail because: You are on the CC list for the bug.=