public inbox for
 help / color / mirror / Atom feed
From: Leo Liang <>
To: Florian Weimer <>
Cc: <>, <>,
	<>, <>
Subject: Re: Is it reasonable to expect errno to be 0 when entering main?
Date: Tue, 27 Sep 2022 07:15:12 +0000	[thread overview]
Message-ID: <YzKjAMjPIywq7tvI@ubuntu01> (raw)
In-Reply-To: <>

Hi Florian,

On Tue, Sep 27, 2022 at 08:05:20AM +0200, Florian Weimer wrote:
> * Leo Liang:
> > If the above program is statically-linked, and if the program is executed before "crng init done",
> > the errno will not be zero when entering main.
> >
> > There seems to be syscall (__getrandom) before main is entered,
> > and if the crng is not initialized, the syscall will fail causing the errno to be set.
> > (_dl_get_origin -> __libc_malloc -> ptmalloc_init -> tcache_key_initialize -> __getrandom)
> >
> > So we are wondering if we should set errno to zero before entering main.
> This is a bug.  It only affects static linking.  Would you please file
> it in Bugzilla?  Thanks.

Will do! Thanks for the timely response!

Besides, Do you have any suggestion as to how this could be fixed?
We could try send out a patch as well!

Best regards,

  reply	other threads:[~2022-09-27  7:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26 12:07 Leo Liang
2022-09-27  6:05 ` Florian Weimer
2022-09-27  7:15   ` Leo Liang [this message]
2022-09-27  7:31     ` Florian Weimer

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:

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

  git send-email \
    --in-reply-to=YzKjAMjPIywq7tvI@ubuntu01 \ \ \ \ \ \ \

* 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).