mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] genimage segfaults with glibc 2.22
@ 2015-08-22 18:43 Alexander Aring
  2015-08-23 16:46 ` Clemens Gruber
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Aring @ 2015-08-22 18:43 UTC (permalink / raw)
  To: ptxdist; +Cc: m.olbrich

Hi,

I currently see an issue with genimage and glibc 2.22. In this version
setenv segfaults if setenv (..., NULL, ...).

I think glibc fixed again with [0] and there are a couple of mailinglist
fights how to deal correctly with "setenv (..., NULL, ...)". [1]

Anyway I just want to leave a note here before other people run into the
same issue and debug hours "why" genimage segfaults.

Maybe genimage should be updated to don't call setenv if value == NULL.

- Alex

[0] https://sourceware.org/git/?p=glibc.git;a=commit;h=03c1e456b079929a8290aeb4aadb05c0df73bfd2
[1] https://sourceware.org/ml/libc-alpha/2015-03/msg00449.html

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] genimage segfaults with glibc 2.22
  2015-08-22 18:43 [ptxdist] genimage segfaults with glibc 2.22 Alexander Aring
@ 2015-08-23 16:46 ` Clemens Gruber
  0 siblings, 0 replies; 5+ messages in thread
From: Clemens Gruber @ 2015-08-23 16:46 UTC (permalink / raw)
  To: ptxdist

On Sat, Aug 22, 2015 at 08:43:18PM +0200, Alexander Aring wrote:
> Hi,
> 
> I currently see an issue with genimage and glibc 2.22. In this version
> setenv segfaults if setenv (..., NULL, ...).
> 
> I think glibc fixed again with [0] and there are a couple of mailinglist
> fights how to deal correctly with "setenv (..., NULL, ...)". [1]
> 
> Anyway I just want to leave a note here before other people run into the
> same issue and debug hours "why" genimage segfaults.
> 
> Maybe genimage should be updated to don't call setenv if value == NULL.
> 
> - Alex
> 
> [0] https://sourceware.org/git/?p=glibc.git;a=commit;h=03c1e456b079929a8290aeb4aadb05c0df73bfd2
> [1] https://sourceware.org/ml/libc-alpha/2015-03/msg00449.html
> 

Hi,

I was trying to debug that error last week on ArchLinux, thanks for posting this
here!

Regards,
Clemens

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] genimage segfaults with glibc 2.22
  2015-08-25 12:09 ` Alexander Aring
@ 2015-08-25 12:42   ` Alexander Aring
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Aring @ 2015-08-25 12:42 UTC (permalink / raw)
  To: ptxdist

On Tue, Aug 25, 2015 at 02:09:15PM +0200, Alexander Aring wrote:
> 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 currently see issues with the workaround solution [1]. Please adapt
the changes which I suggest inside the reply.

- Alex

[1] http://article.gmane.org/gmane.comp.embedded.ptxdist.devel/13240

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] genimage segfaults with glibc 2.22
  2015-08-25 11:41 Koch, Alexander
@ 2015-08-25 12:09 ` Alexander Aring
  2015-08-25 12:42   ` Alexander Aring
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Aring @ 2015-08-25 12:09 UTC (permalink / raw)
  To: ptxdist

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] genimage segfaults with glibc 2.22
@ 2015-08-25 11:41 Koch, Alexander
  2015-08-25 12:09 ` Alexander Aring
  0 siblings, 1 reply; 5+ messages in thread
From: Koch, Alexander @ 2015-08-25 11:41 UTC (permalink / raw)
  To: ptxdist

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?


Best regards,

Alex


On Sun, Aug 23, 2015 at 16:46:51 GMT, Clemens Gruber wrote:
> On Sat, Aug 22, 2015 at 08:43:18PM +0200, Alexander Aring wrote:
>> Hi,
>> 
>> I currently see an issue with genimage and glibc 2.22. In this version
>> setenv segfaults if setenv (..., NULL, ...).
>> 
>> I think glibc fixed again with [0] and there are a couple of mailinglist
>> fights how to deal correctly with "setenv (..., NULL, ...)". [1]
>> 
>> Anyway I just want to leave a note here before other people run into the
>> same issue and debug hours "why" genimage segfaults.
>> 
>> Maybe genimage should be updated to don't call setenv if value == NULL.
>> 
>> - Alex
>> 
>> [0] https://sourceware.org/git/?p=glibc.git;a=commit;h=03c1e456b079929a8290ae
b4aadb05c0df73bfd2
>> [1] https://sourceware.org/ml/libc-alpha/2015-03/msg00449.html
>> 
> 
> Hi,
> 
> I was trying to debug that error last week on ArchLinux, thanks for posting
> this
> here!
> 
> Regards,
> Clemens
-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-25 12:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-22 18:43 [ptxdist] genimage segfaults with glibc 2.22 Alexander Aring
2015-08-23 16:46 ` Clemens Gruber
2015-08-25 11:41 Koch, Alexander
2015-08-25 12:09 ` Alexander Aring
2015-08-25 12:42   ` Alexander Aring

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