Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/1] app: os.setenv() affects os.environ()
Date: Thu, 20 Feb 2020 00:42:45 +0300	[thread overview]
Message-ID: <20200219214245.GD40100@tarantool.org> (raw)
In-Reply-To: <a0a0d2888ae267a02b1801c861b87c0f3223f705.1581029147.git.v.shpilevoy@tarantool.org>

On 06 Feb 23:47, Vladislav Shpilevoy wrote:
> os.setenv() and os.environ() are Lua API for
> 
>     extern char **environ;
>     int setenv();
> 
> The Open Group standardized access points for environment
> variables. But there is no a word about that environ never
> changes. Programs can't relay on that. For example, addition of
> a new variable may cause realloc of the whole environ array, and
> therefore change of its pointer value. That was exactly the case
> in os.environ() - it was using value of environ array remembered
> when Tarantool started.
> 
> And os.setenv() could realloc the array and turn the saved pointer
> into garbage.
> 
> Closes #4733
> ---

LGTM

  parent reply	other threads:[~2020-02-19 21:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06 22:47 Vladislav Shpilevoy
2020-02-10 11:03 ` Igor Munkin
2020-02-19 21:42 ` Nikita Pettik [this message]
2020-02-19 22:44   ` Vladislav Shpilevoy

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=20200219214245.GD40100@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/1] app: os.setenv() affects os.environ()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox