On Sun, 2019-01-20 at 04:37 +0000, Ben Hutchings wrote: [...]> ppc/powerpc-linux-gnu: pass fail: malloctest2*, > setjmptest*, sigint*[...]> s390x/s390x-linux-gnu: fail: fcntl fail: malloctest2*, setjmptest* setjmptest*, > sigint*[...]> Unfortunately this shows that there were some regressions for powerpc > (32-bit) and s390x, which I will need to investigate.I think this is a bug in QEMU's ELF loader - it doesn't properly handle a pure BSS segment (one with file size of 0). The difference between 2.0.4 and 2.0.5 is that I explicitly disabled PIE which removed some unused dynamic linking machinery. These specific test programs now have BSS but no writable static data. And I spotted another test program that has this property (setjmptest on s390x), which also had it when built for 2.0.4. It also failed in both versions, but I failed to record this in the table above. Ben. -- Ben Hutchings You can't have everything. Where would you put it? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: <http://www.zytor.com/pipermail/klibc/attachments/20190120/8c2fb0e7/attachment-0001.sig>
Thorsten Glaser
2019-Jan-20 14:18 UTC
[klibc] testing by building mksh (was Re: RFT: klibc 2.0.5)
Hi Ben, *massive* thanks for picking up klibc work. This might motivate me to pick up some of the TODOs for it that have piled on in my TODO (but only after the freeze, I?m sorry to say, I have more to do for other packages).>And I spotted another test program that has this property (setjmptestsetjmp is a good topic? I found that building mksh and running its testsuite is a good test to find compiler/toolchain/libc/kernel bugs and would be glad if you could add this to your tests on all platforms (should even work on those not supported by Debian). The easiest way is to just package klibc, throw that into an sbuild or cowbuilder/pbuilder chroot and try to rebuild mksh with it, then look at the build log (look for ?Build information for static-klibc mksh? and some lines blow ?Result: regressed? and ?| Total failed: 0? are the important knobs, but lksh is also currently built with klibc if it failed, so a few lines below, under ?Build information for legacy mksh? the same should be, plus ?| CC='klcc'? under ?Variables used?. This does not test shared klibc, but should give you an idea what flags to use. To build manually, get the source (apt-get source mksh will do, or just extract the origtgz somewhere), go into either a new empty build directory or the source one, and run something like: export CC=klcc CPPFLAGS='-Wdate-time -D_FORTIFY_SOURCE=2' export CFLAGS='-Wformat -Werror=format-security -Wall -Wextra -g -fno-stack-protector -Os' export LDFLAGS='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed' #export LDSTATIC='-static' # optional sh /path/to/mksh/Build.sh -r && ./test.sh (You can also add -DMKSH_SMALL -DMKSH_SMALL_BUT_FAST for non-lksh test builds to match what Debian does, but that?s not important.) Oh, and install the ed package before running test.sh if you haven?t already, otherwise, three tests for the history function will fail. (When test-building for lksh, add '-DMKSH_BINSHPOSIX -DMKSH_BINSHREDUCED' to CPPFLAGS, the -L flag to the Build.sh invocation, debian/printf.c to the current working directory, and export USE_PRINTF_BUILTIN=1 in addition. But that should also not make enough of a difference, so just running the normal build from above, once for static once for shared, should suffice.) Thanks, //mirabilos -- 11:56??liwakura:#!/bin/mksh? also, i wanted to add mksh to my own distro ? i was disappointed that there is no makefile ? but somehow the Build.sh is the least painful built system i've ever seen ? honours CC, {CPP,C,LD}FLAGS properly ? looks cleary like done by someone who knows what they are doing
On Sun, 2019-01-20 at 06:31 +0000, Ben Hutchings wrote:> On Sun, 2019-01-20 at 04:37 +0000, Ben Hutchings wrote: > [...] > > ppc/powerpc-linux-gnu: pass fail: malloctest2*, > > setjmptest*, sigint* > [...] > > s390x/s390x-linux-gnu: fail: fcntl fail: malloctest2*, setjmptest* setjmptest*, > > sigint* > [...] > > Unfortunately this shows that there were some regressions for powerpc > > (32-bit) and s390x, which I will need to investigate. > > I think this is a bug in QEMU's ELF loader - it doesn't properly handle > a pure BSS segment (one with file size of 0). The difference between > 2.0.4 and 2.0.5 is that I explicitly disabled PIE which removed some > unused dynamic linking machinery. These specific test programs now > have BSS but no writable static data.I've now built a patched QEMU and these all pass, so I don't think this is a real regression. Ben.> And I spotted another test program that has this property (setjmptest > on s390x), which also had it when built for 2.0.4. It also failed in > both versions, but I failed to record this in the table above. > > Ben. >-- Ben Hutchings You can't have everything. Where would you put it? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: <http://www.zytor.com/pipermail/klibc/attachments/20190120/0c8e4b4d/attachment.sig>
Ben Hutchings
2019-Jan-21 00:13 UTC
[klibc] testing by building mksh (was Re: RFT: klibc 2.0.5)
On Sun, 2019-01-20 at 14:18 +0000, Thorsten Glaser wrote:> Hi Ben, > > *massive* thanks for picking up klibc work. This might motivate > me to pick up some of the TODOs for it that have piled on in my > TODO (but only after the freeze, I?m sorry to say, I have more > to do for other packages). > > >And I spotted another test program that has this property > (setjmptest > > setjmp is a good topic? I found that building mksh and running its > testsuite is a good test to find compiler/toolchain/libc/kernel > bugs and would be glad if you could add this to your tests on all > platforms (should even work on those not supported by Debian).Well I'm using Debian's cross-compiler packages so I don't currently have a way to support anything else.> The easiest way is to just package klibc, throw that into an sbuild > or cowbuilder/pbuilder chroot and try to rebuild mksh with it, then > look at the build log (look for ?Build information for static-klibc > mksh? and some lines blow ?Result: regressed? and ?| Total failed: 0? > are the important knobs, but lksh is also currently built with klibc > if it failed, so a few lines below, under ?Build information for > legacy mksh? the same should be, plus ?| CC='klcc'? under ?Variables > used?.[...] I've pushed my current test script out to: https://git.kernel.org/pub/scm/linux/kernel/git/bwh/klibc-maint.git/ If you can work out how to integrate mksh into this then please do that and send patches. But I'm probably not going to do it myself. Ben. -- Ben Hutchings You can't have everything. Where would you put it? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: <http://www.zytor.com/pipermail/klibc/attachments/20190121/a1c955ac/attachment.sig>