public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Tarun Tej K <tarun4690@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-help@sourceware.org
Subject: Re: getaddrinfo() fails to use latest DNS address - v2.27
Date: Tue, 07 Jan 2020 09:45:00 -0000	[thread overview]
Message-ID: <CAMvyGd8JqcOMHhYmaMWn32-phXyv20cUSjEq6O2Z4=XbytHZpA@mail.gmail.com> (raw)
In-Reply-To: <87lfqjwsvh.fsf@oldenburg2.str.redhat.com>

Thanks for your reply, Florian

> How do you replace /etc/resolv.conf?  If the file is overwritten
> in-place and the file system does not have nanosecond resolution for its
> timestamps, then glibc might read an empty (or partial) /etc/resolv.conf
> file, but might not realize that the file changed again later because
> the subsequent writes do modify the file timestamps (due to the
> timestamp resolution).  The fix is to write the new version of
> /etc/resolv.conf to a temporary file (in the same directory) and rename
> it into place, atomically.
So, there are two daemons which are writing into /etc/resolv.conf.
1- ConnMan - for Ethernet and Wifi interfaces - creates symbolic link
to /var/run/resolv.conf
2- pppd - for PPP interfaces  - creates regular file (only when
internet is not reachable via ethernet and wifi)
(I know it is not recommended to have two different network daemons in
same system - work is in progress to merge pppd also into the ConnMan)

The filesystem is UBIFS on Raw NAND. I think you're right about the
not having nanosecond resolution.
As per the strace, when problem occurs even stat64 call is not taking
place. (That means __resolv_conf_get_current is not being called?)
In any case, shouldn't stat64() happen everytime the getaddrinfo() is called?
Can you please suggest any way to investigate why even stat64 was not
happening and getaddrinfo is returning with EAGAIN forever until the
process is restarted?
Also could you suggest any other tool other than strace to see the
call trace of libc runtime?

Thanks
Tarun

  reply	other threads:[~2020-01-07  9:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07  6:01 Tarun Tej K
2020-01-07  8:52 ` Florian Weimer
2020-01-07  9:45   ` Tarun Tej K [this message]
2020-01-07 12:27     ` Florian Weimer
2020-01-08  7:25       ` Tarun Tej K
2020-01-08  7:41         ` Florian Weimer
2020-01-20 14:50           ` Filip Ochnik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMvyGd8JqcOMHhYmaMWn32-phXyv20cUSjEq6O2Z4=XbytHZpA@mail.gmail.com' \
    --to=tarun4690@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).