Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 10726] New: Current libglib2.mk creates broken libglib2 binary when using glibc 2.26
@ 2018-02-01 10:44 bugzilla at busybox.net
  2018-02-05 10:24 ` [Buildroot] [Bug 10726] " bugzilla at busybox.net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bugzilla at busybox.net @ 2018-02-01 10:44 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=10726

            Bug ID: 10726
           Summary: Current libglib2.mk creates broken libglib2 binary
                    when using glibc 2.26
           Product: buildroot
           Version: 2017.11.2
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at buildroot.uclibc.org
          Reporter: porto.rio at gmx.net
                CC: buildroot at uclibc.org
  Target Milestone: ---

We recently ran into a weird problem where the udisks-daemon crashes at startup
when migrating from buildroot 2017.08 to 2017.11.

Debugging the issue yielded the following problem:
? udisks tries to call g_io_channel_new_file ("/proc/mdstat", "r", &error);
which fails because "/proc/mdstat" does not exists (see
build/libglib2-2.54.2/glib/giounix.c:527).
? libglib2 then tries to create an error string using g_strerror() (see
build/libglib2-2.54.2/glib/gstrfuncs.c)
? g_error() uses strerror_r() to acquire the error string but discards the
returned string (see build/libglib2-2.54.2/glib/gstrfuncs.c:1293).

BR 2017.11 uses libglib2-2.54.2 (BR 2017.08 used 2.52.2) which changed the
detection of the available variant of strerror_r() (returning the message vs.
filling a buffer) in the c-library (see
build/libglib2-2.54.2/glib/gstrfuncs.c).

Old check in libglib2-2.52.2,:
#  if defined(__GLIBC__) && !((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >=
600) && ! _GNU_SOURCE)

New check in libglib2-2.54.2:
#  if defined(STRERROR_R_CHAR_P)

The 2.54.2 version relies on a configure-time check to determine if
strerror_r() returns the error message or fills the provided buffer with the
message.
STRERROR_R_CHAR_P needs to be defined for the current version of glibc (2.26)
but is set to undefined in the current makefile for libglib2 in Buildroot.
See buildroot-2017.11.2/package/libglib2/libglib2.mk. It contains
LIBGLIB2_CONF_ENV which sets "ac_cv_have_decl_strerror_r=yes
ac_cv_func_strerror_r_char_p=no".
If these two lines are removed the resulting libglib2 binary works again as the
configure script selects the right variant of strerror_r().

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Buildroot] [Bug 10726] Current libglib2.mk creates broken libglib2 binary when using glibc 2.26
  2018-02-01 10:44 [Buildroot] [Bug 10726] New: Current libglib2.mk creates broken libglib2 binary when using glibc 2.26 bugzilla at busybox.net
@ 2018-02-05 10:24 ` bugzilla at busybox.net
  2018-02-05 10:38 ` bugzilla at busybox.net
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla at busybox.net @ 2018-02-05 10:24 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=10726

--- Comment #1 from Matthias <porto.rio@gmx.net> ---
Please find attached a buildroot-config for a minimal qemu image which
reproduces the problem.
It was created and tested with the sequence below.

> cd tmp/
> tar xvf ../dl/buildroot-2017.11.2.tar.bz2
> make qemu_arm_versatile_defconfig
> make menuconfig
[activate eudev, glibc and udisks]
> make
> qemu-system-arm -M versatilepb -kernel output/images/zImage -dtb output/images/versatile-pb.dtb -drive file=output/images/rootfs.ext2,if=scsi,format=raw -append "root=/dev/sda console=ttyAMA0,115200" -serial stdio -net nic,model=rtl8139 -net user
# /usr/libexec/udisks-daemon 
Invalid byte sequence in conversion input

(udisks-daemon:112): GLib-CRITICAL **: g_error_new_literal: assertion 'message
!= NULL' failed
Segmentation fault

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Buildroot] [Bug 10726] Current libglib2.mk creates broken libglib2 binary when using glibc 2.26
  2018-02-01 10:44 [Buildroot] [Bug 10726] New: Current libglib2.mk creates broken libglib2 binary when using glibc 2.26 bugzilla at busybox.net
  2018-02-05 10:24 ` [Buildroot] [Bug 10726] " bugzilla at busybox.net
@ 2018-02-05 10:38 ` bugzilla at busybox.net
  2018-02-05 16:40 ` bugzilla at busybox.net
  2018-02-25 21:36 ` bugzilla at busybox.net
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla at busybox.net @ 2018-02-05 10:38 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=10726

--- Comment #2 from Matthias <porto.rio@gmx.net> ---
Created attachment 7451
  --> https://bugs.busybox.net/attachment.cgi?id=7451&action=edit
buildroot-config for a minimal qemu image which reproduces the problem

Note: Comments were removed by 'grep -v "# BR2_" .config >glib-error_defconfig'
to reduce size.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Buildroot] [Bug 10726] Current libglib2.mk creates broken libglib2 binary when using glibc 2.26
  2018-02-01 10:44 [Buildroot] [Bug 10726] New: Current libglib2.mk creates broken libglib2 binary when using glibc 2.26 bugzilla at busybox.net
  2018-02-05 10:24 ` [Buildroot] [Bug 10726] " bugzilla at busybox.net
  2018-02-05 10:38 ` bugzilla at busybox.net
@ 2018-02-05 16:40 ` bugzilla at busybox.net
  2018-02-25 21:36 ` bugzilla at busybox.net
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla at busybox.net @ 2018-02-05 16:40 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=10726

--- Comment #3 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> ---
Thanks for your well-documented bug report!

I think all those pre-seeded cache variables in LIBGLIB2_CONF_ENV are just
crap. They have been there since the glib2 package was introduced back in
January 2007, and the vast majority of them are useless, and potentially
harmful (as you have discovered). So the fix is most likely to remove almost
all of them, the key being to identify which ones we need to keep.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Buildroot] [Bug 10726] Current libglib2.mk creates broken libglib2 binary when using glibc 2.26
  2018-02-01 10:44 [Buildroot] [Bug 10726] New: Current libglib2.mk creates broken libglib2 binary when using glibc 2.26 bugzilla at busybox.net
                   ` (2 preceding siblings ...)
  2018-02-05 16:40 ` bugzilla at busybox.net
@ 2018-02-25 21:36 ` bugzilla at busybox.net
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla at busybox.net @ 2018-02-25 21:36 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=10726

Thomas Petazzoni <thomas.petazzoni@free-electrons.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> ---
Fixed by
https://git.buildroot.org/buildroot/commit/?id=eb1a45f4c1e01fa1af7ad3dbbd6b2bade7fc958d.
Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2018-02-25 21:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 10:44 [Buildroot] [Bug 10726] New: Current libglib2.mk creates broken libglib2 binary when using glibc 2.26 bugzilla at busybox.net
2018-02-05 10:24 ` [Buildroot] [Bug 10726] " bugzilla at busybox.net
2018-02-05 10:38 ` bugzilla at busybox.net
2018-02-05 16:40 ` bugzilla at busybox.net
2018-02-25 21:36 ` bugzilla at busybox.net

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