mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] genimage segfaults with glibc 2.22
Date: Tue, 25 Aug 2015 14:09:20 +0200	[thread overview]
Message-ID: <20150825120915.GA25030@omega> (raw)
In-Reply-To: <334319B2EBE0B144BAE1402B79D82DC503959F3938@srvpegasus>

On Tue, Aug 25, 2015 at 01:41:42PM +0200, Koch, Alexander wrote:
> Hi,
> 
> I stumbled upon this as well, when upgrading glibc under Arch.
> 
> So to clarify, do we just need to wait until the patch mentioned by Alex in [0]
> gets included in an updated glibc package, or is there a proper way to make
> PTXdist (or better `genimage`) work again under Arch?
> 
> 

No, glibc will always segfault if setenv (..., NULL, ...) since glibc
2.22. So far I understand this is because setenv (..., NULL, ...) is
not defined [0].

Before glibc 2.22 they handled like VAR="", but this differs when you
not using glibc. Like uclibc will do a complete different handling
then (don't know the handling on uclibc, but it's a undef behaviour in
all libc implementations).

They also don't decide to return an errno value, because it's not
defined at [0], so they introduced a core dump.

This need to be fixed in genimage, I recently send a patch for adding a
workaround for that [1]. Simple don't call setenv when value is NULL.


_IMPORTANT NOTE_

Don't calling setenv != setenv(..., "", ...), I think this differs, the
different is getenv will return NULL, if name isn't found and if ""
then getenv return "".

I think it's better that mol decide that, I don't have currently the
full overview over genimage.


Current workaround:

I think, the current easiest workaround would be to copy the patch [1] in
your "$BSP/patches/genimage-7"

and rebuilt "host-genimage".

- Alex

[0] http://pubs.opengroup.org/onlinepubs/9699919799/functions/setenv.html
[1] http://article.gmane.org/gmane.comp.embedded.ptxdist.devel/13240

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2015-08-25 12:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25 11:41 Koch, Alexander
2015-08-25 12:09 ` Alexander Aring [this message]
2015-08-25 12:42   ` Alexander Aring
  -- strict thread matches above, loose matches on Subject: below --
2015-08-22 18:43 Alexander Aring
2015-08-23 16:46 ` Clemens Gruber

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=20150825120915.GA25030@omega \
    --to=alex.aring@gmail.com \
    --cc=ptxdist@pengutronix.de \
    /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