Hello,
I think I've run into a rather odd bug on a big-endian MIPS platform while
trying to hand-assemble a MIPS-II ISA netboot image built from a uclibc-ng
chroot. In my netboot, I need to include xfsprogs, but this has a dependency
on the 'valloc' function call. So in uclibc-ng, I enabled
CONFIG_UCLIBC_SUSV2_LEGACY to enable that function, and rebuilt uclibc-ng.
This fixes the xfsprogs build, but it very subtly breaks busybox's ash shell.
After rebuilding uclibc-ng, then rebuilding busybox statically/multicall, if
you run /bin/ash with a malformed argument or give it a script to execute that
doesn't have the execute bit set, you get a SIGSEGV:
Fudging up the argument syntax to /bin/ash:
octane / # /bin/ash "-c"
/bin/ash: -c requires an argument
Segmentation fault
Via a non-executable script "x.sh", we start with this sample:
octane / # cat ./x.sh
#!/bin/ash
echo "foo!"
If "x.sh" has the executable bit set, we're all good:
octane / # ls -l ./x.sh
-rwxr-xr-x 1 root root 24 Oct 12 01:57 ./x.sh
octane / # /bin/ash -c ./x.sh
foo!
But if we turn off the executable bit...
octane / # chmod -x ./x.sh
octane / # ls -l ./x.sh
-rw-r--r-- 1 root root 24 Oct 12 01:57 ./x.sh
octane / # /bin/ash -c ./x.sh
/bin/ash: ./x.sh: Permission denied
Segmentation fault
The only backtrace I can get out of it after rebuilding uclibc-ng and busybox
with debugging is this (generated via the fudged argument example):
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x00452278 in __GI__longjmp_unwind (env=0x7ffeed58, val=1) at
libpthread/nptl/sysdeps/unix/sysv/linux/jmp-unwind.c:30
#2 0x004061e4 in __libc_longjmp (env=0x7ffeed58, val=1) at
libc/sysdeps/linux/common/longjmp.c:29
#3 0x0050185c in raise_exception (e=1) at shell/ash.c:448
#4 0x00501f00 in ash_vmsg_and_raise (cond=1, msg=0x60294d
<bb_msg_requires_arg> "%s requires an argument", ap=0x7ffeece4) at shell/ash.c:1232
#5 0x00501f4c in ash_msg_and_raise_error (msg=0x60294d <bb_msg_requires_arg>
"%s requires an argument") at shell/ash.c:1243
#6 0x0051a918 in procargs (argv=0x7ffeeff4) at shell/ash.c:13009
#7 0x0051afe4 in ash_main (argc=2, argv=0x7ffeeff4) at shell/ash.c:13158
#8 0x0047e320 in run_applet_no_and_exit (applet_no=9, argv=0x7ffeeff4) at
libbb/appletlib.c:774
#9 0x0047e370 in run_applet_and_exit (name=0x7ffef130 "ash", argv=0x7ffeeff4)
at libbb/appletlib.c:781
#10 0x0047e484 in main (argc=2, argv=0x7ffeeff4) at libbb/appletlib.c:838
Line #30 in jmp-unwind.c leads me to a really old uclibc bug, #3919:
https://bugs.busybox.net/show_bug.cgi?id=3919
But further investigation reveals that the null_not_ptr() check introduced by
the patch in that bug is already present in uclibc-ng in the patched spots,
plus a few new locations. So either I've run into a new area of the code that
needs a similar change, or I'm chasing the wrong rabbit down the wrong hole and
the bug lies elsewhere, e.g., in busybox (hinted at by the SIGSEGV only when
chmod -x on the script).
I am aware that CONFIG_UCLIBC_SUSV2_LEGACY introduces an ABI compatibility, but
it appears to remainder of the chroot userland used to build the netboot
operates normally. Only /bin/ash seems to have an issue.
No idea if instead, I need to get xfsprogs off of using valloc (given XFS' age
as a filesystem, it might need this anyways). I can pursue that avenue if
needed, but I think I've stumbled onto a really obscure bug here that still may
need looking into.
Anything else I can provide to help chase this down?
--
Joshua Kinard
Gentoo/MIPS
kumba(a)gentoo.org
6144R/F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943
"The past tempts us, the present confuses us, the future frightens us. And our
lives slip away, moment by moment, lost in that vast, terrible in-between."
--Emperor Turhan, Centauri Republic
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 543308f6c46cf2edf8a524bc9c631e472570fe72 (commit)
from e87c79f7983d995b1a69151e3dd43e9e7466b333 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 543308f6c46cf2edf8a524bc9c631e472570fe72
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Mon Oct 24 05:15:07 2016 +0200
linuxthreads: add back signal.h
Somehow this got removed with f1d7505e40654a185843bdc8f1cf1fd00ab55c04.
Reported-by: Thomas Petazzoni <thomas.petazzoni(a)free-electrons.com>
-----------------------------------------------------------------------
Summary of changes:
libpthread/linuxthreads/sysdeps/pthread/pthread.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/libpthread/linuxthreads/sysdeps/pthread/pthread.h b/libpthread/linuxthreads/sysdeps/pthread/pthread.h
index cf043b5..cc13a52 100644
--- a/libpthread/linuxthreads/sysdeps/pthread/pthread.h
+++ b/libpthread/linuxthreads/sysdeps/pthread/pthread.h
@@ -20,6 +20,7 @@
#include <sched.h>
#include <time.h>
+#include <signal.h>
#include <bits/pthreadtypes.h>
#include <bits/initspin.h>
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
On 10/12/2016 04:27, Waldemar Brodkorb wrote:
> hi,
>
> i am visiting elce, be back on monday.
> can you try 1.0.17 please.
> 1.0.18 introduced some interesting regressions i habe not covered in my tests.
> i have solved most of them, but not all is pushed, yet.
>
> looks related to the patch i sent out to lance last week on the list.
> best regards
> Waldemar
>
> Von meinem iPhone gesendet
>
>> Am 12.10.2016 um 09:59 schrieb Joshua Kinard <kumba(a)gentoo.org>:
>>
>>> On 10/12/2016 03:53, Joshua Kinard wrote:
>>> Hello,
>>>
>>> I think I've run into a rather odd bug on a big-endian MIPS platform while
>>> trying to hand-assemble a MIPS-II ISA netboot image built from a uclibc-ng
>>> chroot.
>>
>> [snip]
>>
>> PS, I forgot to add, this is using uclibc-ng-1.0.18 and busybox-1.24.2.
>>
(Resending to the actual list, sorry Waldemar!)
Unfortunately, my base root for building the netboot is built on 1.0.18 at the
moment. It'd take about two days to do a full rebuild.
That said, I think I might have an idea. The bit of code cited in Bug #3919
for old uclibc only defines and uses null_not_ptr in __uClibc_main.c, but it
looks like the code in jmp-unwind.c does not. So I am going to try moving the
null_not_ptr definition to a header somewhere, mark it non-static (maybe
inline?), then try using it on the __pthread_cleanup_upto test and see if that
might resolve the issue.
Sound sane?
--
Joshua Kinard
Gentoo/MIPS
kumba(a)gentoo.org
6144R/F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943
"The past tempts us, the present confuses us, the future frightens us. And our
lives slip away, moment by moment, lost in that vast, terrible in-between."
--Emperor Turhan, Centauri Republic
Hello,
I was investigating the recent build failures of the libbluray package
in Buildroot, which occur on the Microblaze, Blackfin and m68k
architecture (at least), using the latest uClibc-ng release. The
failure looks like this:
http://autobuild.buildroot.net/results/941/941c06e29f6542e258f20799dc6f3f94…
Relevant part:
In file included from /home/buildroot/autobuild/run/instance-3/output/host/usr/microblazeel-buildroot-linux-uclibc/sysroot/usr/include/pthread.h:686:0,
from src/util/mutex.c:32:
/home/buildroot/autobuild/run/instance-3/output/host/usr/microblazeel-buildroot-linux-uclibc/sysroot/usr/include/bits/sigthread.h:31:14: error: unknown type name '__sigset_t'
const __sigset_t *__restrict __newmask,
^
/home/buildroot/autobuild/run/instance-3/output/host/usr/microblazeel-buildroot-linux-uclibc/sysroot/usr/include/bits/sigthread.h:32:8: error: unknown type name '__sigset_t'
__sigset_t *__restrict __oldmask)__THROW;
And indeed, one can reproduce this problem with a very simple test case:
====
#include <pthread.h>
int main(void) { return 0; }
====
If you build it with the Microblaze/uClibc compiler with no special
flags, it works just fine:
$ ./output/host/usr/bin/microblazeel-linux-gcc -o test test.c
$
However, as soon as you start adding the -std=c99 flag, the build fails:
$ ./output/host/usr/bin/microblazeel-linux-gcc -std=c99 -o test test.c
In file included from /home/thomas/projets/buildroot/output/host/usr/microblazeel-buildroot-linux-uclibc/sysroot/usr/include/pthread.h:686:0,
from pouet.c:1:
/home/thomas/projets/buildroot/output/host/usr/microblazeel-buildroot-linux-uclibc/sysroot/usr/include/bits/sigthread.h:31:14: error: unknown type name ‘__sigset_t’
const __sigset_t *__restrict __newmask,
^
/home/thomas/projets/buildroot/output/host/usr/microblazeel-buildroot-linux-uclibc/sysroot/usr/include/bits/sigthread.h:32:8: error: unknown type name ‘__sigset_t’
__sigset_t *__restrict __oldmask)__THROW;
^
Is this problem already known?
Best regards,
Thomas Petazzoni
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Hi Embedded-Linux-Hackers,
this release is mostly bug fixing and regression fixes from the
single-libc patch.
Next release will separate the testsuite to its own project.
Thanks for testing and bug reports,
Waldemar
Changes:
John Ata (1):
Fix nftw when called with FTW_CHDIR and FTW_DEPTH
Vineet Gupta (4):
ARC: nptl: cancellable wrappers were broken
ARC: nptl: cancellable wrappers were broken #2
ARC: update .note.ABI-tag for ABIv4
ARC: build: don't force usage of llock and swape instructions
Waldemar Brodkorb (14):
locale: remove building for the host, as it breaks
ubacktrace/uargp: remove unneeded and false linker scripts
remove linux kernel 2.4 modules support
cleanup ppc port
test: fix tests including non-wrapper libgcc exception handling code
cleanup libc.a
ppc: do not include copysgnl.c if UCLIBC_HAS_LONG_DOUBLE_MATH enabled
fix mips/mips64 build for old compilers
cleanup and fix static linking issues
linuxthreads: allow to choose on all supported architectures
create empty static files conditionally
test: add nftw test case
test: add a simple check, that -std=c99 working
bump for release
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The annotated tag, v1.0.19 has been created
at 20c83f773d9b1dd7739dcbfdb9be92245b216ad1 (tag)
tagging e87c79f7983d995b1a69151e3dd43e9e7466b333 (commit)
replaces v1.0.18
tagged by Waldemar Brodkorb
on Sun Oct 23 09:19:06 2016 +0200
- Log -----------------------------------------------------------------
release 1.0.19 - Trapistes Rochefort 6
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iQIcBAABCAAGBQJYDGRsAAoJEMEz+QKmmH5i4iUQALKz7YezIqW1aIB4eX9U5enz
ja+ZkHhVa8iS3MUYNQ16zA67IAMYikRKDnPQ2gLjv4OXXSP+mUe7zvCCDpW0I9S7
3AdyvZye3u/KvZ0xyEMJMITT2FSC/ksw0jJk9olCYPHSjHnjrHW6Yi/yeluotVJj
9gpxL3KsKDqKJGPtdo5v7Q0jee3OWPxHYJUTkfXI4OM/4bXlqv32diMpdRLw8rMP
M/vPk0NAYPVVY2sFCkvdPQ3y7Yj4CicTzSG+CyjJ+as2PMUuYxMLSFwovl1v/YtB
7twyhCACr1+LiDG4K/v+i/RG8VYcDCaKfCtEhZ12yKOVKmcrY2b9mx1TGCY/sNmQ
AwRTzD3NihKJnywIZ3Vz3cbA6g2P/oUc7sjkSque/s2iUHNvhUWZzMvCPtIwYmm1
0WWfPUk6LKjnvQm4I5R3NrOZVw8o3V90tTxdejIIiO0LxrhBvrZop9iPiXt0qqyE
q3PLhUzCebmweyzJI+WzrFbAWFVoJuc5NqAL+Slj3Cfz3xGl4aFz8zlYeqAuCGtX
T7h52DePA5jL0VVP9p2VhrWzOHF2175KKrCYGFKk77LpFXSsVAGGmJcHZJXxNDQM
anPc9mC932G9mRABErGFB+qcbGxPUC9E+ZqQi3InhtobhkQ3oXeY3u9F550D7zaH
FGCe4Jc+EE8jikQ0ibnW
=RXBs
-----END PGP SIGNATURE-----
John Ata (1):
Fix nftw when called with FTW_CHDIR and FTW_DEPTH
Vineet Gupta (4):
ARC: nptl: cancellable wrappers were broken
ARC: nptl: cancellable wrappers were broken #2
ARC: update .note.ABI-tag for ABIv4
ARC: build: don't force usage of llock and swape instructions
Waldemar Brodkorb (14):
locale: remove building for the host, as it breaks
ubacktrace/uargp: remove unneeded and false linker scripts
remove linux kernel 2.4 modules support
cleanup ppc port
test: fix tests including non-wrapper libgcc exception handling code
cleanup libc.a
ppc: do not include copysgnl.c if UCLIBC_HAS_LONG_DOUBLE_MATH enabled
fix mips/mips64 build for old compilers
cleanup and fix static linking issues
linuxthreads: allow to choose on all supported architectures
create empty static files conditionally
test: add nftw test case
test: add a simple check, that -std=c99 working
bump for release
-----------------------------------------------------------------------
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via e87c79f7983d995b1a69151e3dd43e9e7466b333 (commit)
via a3c78c66667ffaa0487b59e3cc6a5dab5a4e59f2 (commit)
via 8d2f169a82bec9b8c143e33e447b64e7b555e66a (commit)
from a6cdfdfff38584cadec40b6d6f2df2651e0b34b8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e87c79f7983d995b1a69151e3dd43e9e7466b333
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sun Oct 23 09:13:29 2016 +0200
bump for release
commit a3c78c66667ffaa0487b59e3cc6a5dab5a4e59f2
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Oct 22 19:03:37 2016 +0200
test: add a simple check, that -std=c99 working
commit 8d2f169a82bec9b8c143e33e447b64e7b555e66a
Author: Vineet Gupta <Vineet.Gupta1(a)synopsys.com>
Date: Fri Oct 21 14:20:55 2016 -0700
ARC: build: don't force usage of llock and swape instructions
This is because some old ARC750 cores lack these instructions.
We now rely on the default for the toolchain driver:
-mcpu=A7 won't enable those, while -mcpu=archs will as these
instructions are baseline (and thus is not impacted with this change).
If some arc700 based cpu does have them, it can override the driver
defaults in it's one level up build system.
Signed-off-by: Vineet Gupta <vgupta(a)synopsys.com>
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 3 +--
test/pthread/Makefile.in | 2 ++
test/pthread/tst-c99.c | 2 ++
3 files changed, 5 insertions(+), 2 deletions(-)
create mode 100644 test/pthread/tst-c99.c
diff --git a/Rules.mak b/Rules.mak
index b9dbf25..9631b03 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -127,7 +127,7 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR
# Now config hard core
MAJOR_VERSION := 1
MINOR_VERSION := 0
-SUBLEVEL := 18
+SUBLEVEL := 19
EXTRAVERSION :=
VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL)
ABI_VERSION := $(MAJOR_VERSION)
@@ -503,7 +503,6 @@ ifeq ($(TARGET_ARCH),c6x)
endif
ifeq ($(TARGET_ARCH),arc)
- CPU_CFLAGS-y += -mlock -mswape
CPU_CFLAGS-$(CONFIG_ARC_CPU_700) += -mA7
CPU_CFLAGS-$(CONFIG_ARC_CPU_HS) += -mcpu=archs
CPU_LDFLAGS-y += $(CPU_CFLAGS) -marclinux
diff --git a/test/pthread/Makefile.in b/test/pthread/Makefile.in
index c50748d..bd6b29b 100644
--- a/test/pthread/Makefile.in
+++ b/test/pthread/Makefile.in
@@ -6,3 +6,5 @@ TESTS_DISABLED += cancellation-points
EXTRA_LDFLAGS := -lpthread
LDFLAGS_cancellation-points := -lrt
+
+CFLAGS_tst-c99 := -std=c99
diff --git a/test/pthread/tst-c99.c b/test/pthread/tst-c99.c
new file mode 100644
index 0000000..3cc91b1
--- /dev/null
+++ b/test/pthread/tst-c99.c
@@ -0,0 +1,2 @@
+#include <pthread.h>
+int main(void) { return 0; }
hooks/post-receive
--
uClibc-ng - small C library for embedded systems