Hi,
investigating a segfault
(gdb) bt full
#0 0x00007fffec28dd90 in __deregister_frame_info () from /lib/
libgcc_s.so.1
No symbol table info available.
#1 0x00007fffebf8af66 in __do_global_dtors_aux () from /usr/lib/
libgcrypt.so.20
when starting Apache with mod_php activated on a buildroot-built x86_64-
system with uclibc-1.0.19 I came across discussions from 2012 & 2014 on
the uClibc mailinglist:
2012:
http://lists.uclibc.org/pipermail/uclibc/2012-October/047059.html
2014:
http://lists.busybox.net/pipermail/uclibc/2014-December/048737.html
Building mod_php without libgcrypt.so, which means disabling
BR2_PACKAGE_PHP_EXT_XSL, does not fix the problem, the segfault will
occur in another shared lib.
Quoting the message from 2014:
> In my particular case, this meant dlopening and dlclosing some 47
> shared objects as reported by "LD_DEBUG=1 /usr/bin/gdk-pixbuf-query-
> loaders ./libpixbufloader-svg.la 2>&1 | grep ^do_dlopen | grep ctors
> | wc -l"
My system opens even more shared libs when starting Apache & mod_php:
# LD_DEBUG=1 /usr/bin/httpd -t 2>&1 | grep ^do_dlopen | grep ctors | wc -l
64
Segmentation fault
Please note that using Apache without mod_php works fine, php-cgi itself
also works fine.
In 2014 Anthony suggested to revert
https://git.busybox.net/uClibc/commit/ldso?
h=0.9.33&id=9b42da7d0558884e2a3cc9a8674ccfc752369610
which still solves the Apache/mod_php segfault today.
Uclibc-1.0.19 includes all commits from 2016-09-26 and older in
https://cgit.openadk.org/cgi/cgit/uclibc-ng.git/log/ldso/libdl
it therefore includes https://cgit.openadk.org/cgi/cgit/uclibc-ng.git/
commit/ldso/libdl?id=cc04ab27ba6341f46bbe094478c9af3e3706f411 which
refers to fix the problem from the 2012 message, but it did not.
Regards, Bernd
Hi,
I would suggest following patch, which removes the special
communication between ld.so and gdb.
While debugging a ld.so issue with gdb 8.0 on alpha, I recognized
that the debugger stalled when trying to execute this code.
It thought this code was added to help debugging ld.so, but it seems
nowadays it prevents to do so. May be bitrotted?
Does anyone found it useful while debugging ld.so with gdb in the
past?
best regards
Waldemar
From: "Anthony G. Basile" <blueness(a)gentoo.org>
man feature_test_macros(7) specifies that _BSD_SOURCE and _SVID_SOURCE have
been deprecated in favor of _DEFAULT_SOURCE since libc 2.20. Specifying
either of the former is now equivalent to specifying just the latter. We add
this macro to conform to this standard, but do not add the compiler warning
to maintain full backwards compatibility with earlier version of glibc and
uclibc.
Signed-off-by: Anthony G. Basile <blueness(a)gentoo.org>
---
include/features.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/features.h b/include/features.h
index f9820791b..362b811fd 100644
--- a/include/features.h
+++ b/include/features.h
@@ -40,6 +40,7 @@
_SVID_SOURCE ISO C, POSIX, and SVID things.
_ATFILE_SOURCE Additional *at interfaces.
_GNU_SOURCE All of the above, plus GNU extensions.
+ _DEFAULT_SOURCE Equivalent to defining _BSD_SOURCE and _SVID_SOURCE.
_REENTRANT Select additionally reentrant object.
_THREAD_SAFE Same as _REENTRANT, often used by other systems.
_FORTIFY_SOURCE If set to numeric value > 0 additional security
@@ -140,6 +141,19 @@
# define __GNUC_PREREQ(maj, min) 0
#endif
+/* _DEFAULT_SOURCE is equivalent to defining _BSD_SOURCE and _SVID_SOURCE
+ * and vice versa. */
+#ifdef _DEFAULT_SOURCE
+# undef _BSD_SOURCE
+# define _BSD_SOURCE 1
+# undef _SVID_SOURCE
+# define _SVID_SOURCE 1
+#endif
+
+#if defined _BSD_SOURCE || defined _SVID_SOURCE
+# undef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */
#if defined _BSD_SOURCE && \
--
2.13.0
Hi,
I released a new version of uClibc-ng today.
It contains mostly bugfixes and cleanups.
It allows to be used for gcc 7.1 toolchains.
have fun,
Waldemar
Hi,
I just noticed today that mkostemp64 calls __gen_tempname with mode
S_IRUSR | S_IWUSR | S_IXUSR, while all other flavors call it with mode
S_IRUSR | S_IWUSR, as per POSIX.1-2008.
See libc/stdlib/mkostemp64.c. I assume I don't need to send a patch
for that.
Cheers,
Ignacy
--
Ignacy Gawędzki
R&D Engineer
Green Communications
From: "Anthony G. Basile" <blueness(a)gentoo.org>
This syncs up <sys/reboot.h> with the GNU C library, see their
commit 1a09dc56. These constants are needed by init systems like
openrc.
Signed-off-by: Anthony G. Basile <blueness(a)gentoo.org>
---
include/sys/reboot.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/sys/reboot.h b/include/sys/reboot.h
index bc685aebb..fafd2fb0c 100644
--- a/include/sys/reboot.h
+++ b/include/sys/reboot.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,6 +38,12 @@
/* Stop system and switch power off if possible. */
#define RB_POWER_OFF 0x4321fedc
+/* Suspend system using software suspend. */
+#define RB_SW_SUSPEND 0xd000fce2
+
+/* Reboot system into new kernel. */
+#define RB_KEXEC 0x45584543
+
__BEGIN_DECLS
/* Reboot or halt the system. */
--
2.13.0
This syncs up <sys/reboot.h> with the GNU C library, see their
commit 1a09dc56. These constants are needed by init systems like
openrc.
Signed-off-by: Anthony G. Basile <blueness(a)gentoo.org>
---
include/sys/reboot.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/sys/reboot.h b/include/sys/reboot.h
index bc685aebb..fafd2fb0c 100644
--- a/include/sys/reboot.h
+++ b/include/sys/reboot.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,6 +38,12 @@
/* Stop system and switch power off if possible. */
#define RB_POWER_OFF 0x4321fedc
+/* Suspend system using software suspend. */
+#define RB_SW_SUSPEND 0xd000fce2
+
+/* Reboot system into new kernel. */
+#define RB_KEXEC 0x45584543
+
__BEGIN_DECLS
/* Reboot or halt the system. */
--
2.13.0