From: Shuah Khan <shuah@kernel.org>
To: Anders Roxell <anders.roxell@linaro.org>, tbird20d@gmail.com
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <shuahkh@osg.samsung.com>,
Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH] selftests/size: rework to use main instead of _start
Date: Wed, 7 Mar 2018 08:38:03 -0700 [thread overview]
Message-ID: <f4df30f2-7445-d937-7c36-9b16b1d0415e@kernel.org> (raw)
In-Reply-To: <613a519a-9c2b-fb11-ecb9-f3c464d0af43@kernel.org>
On 03/07/2018 08:11 AM, Shuah Khan wrote:
> On 03/07/2018 06:07 AM, Anders Roxell wrote:
>> In a -ffreestanding environment without glibc, we shouldn't be able to
>> call either getenv or printf. It seems that printf() happens to work
>> fine, but it ends up using the glibc getenv(), which doesn't work unless
>> we call the glibc _start() function first.
>> Using _start() was originally meant as an optimization to reduce the
>> memory consumption of the test program itself, in order to get a more
>> accurate representation of the available RAM at system boot time.
>> However, it causes more problems than it helps, especially when run from
>> a shell script that also consumes some memory.
>>
>> get_size[2838]: segfault at ffffffffffffffd0 ip 000000000040538b
>> sp 00007ffc41980668 error 5 in get_size[400000+b0000]
>> audit: type=1701 audit(1521532923.838:4): auid=0 uid=0 gid=0 ses=2
>> subj=kernel pid=2838 comm=\"get_size\"
>> exe=\"/opt/kselftests/next/size/get_size\" sig=11 res=1
>> get_size[2840]: segfault at ffffffffffffffd0 ip 000000000040538b
>> sp 00007ffdace9b378 error 5 in get_size[400000+b0000]
>> audit: type=1701 audit(1521532932.057:5): auid=0 uid=0 gid=0 ses=2
>> subj=kernel pid=2840 comm=\"get_size\"
>> exe=\"/opt/kselftests/next/size/get_size\" sig=11 res=1
>>
>> Rework to get_size test to use main (and printf) instead of _start. All
>> other seftest tests uses main and not _start.
>>
>> Fixes: 0081901af95f ("selftests: size call ksft_print_header() to print TAP header")
>> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
>
> Andres,
>
> Thanks for finding and reporting the problem. This patch is in linux-kselftest next
> for 4.17-rc1. I would rather revert the patch than fix it a this time.
>
> I knew there was a reason why Tim didn't use printf() in the first, I couldn't
> remember. I won't be sending
>
> 0081901af95f ("selftests: size call ksft_print_header() to print TAP header")
>
> for inclusion into 4.17-rc1
>
Okay. Dropped the problem patch
0081901af95f ("selftests: size call ksft_print_header() to print TAP header")
from linux-kselftest next.
thanks again for finding the problem so quickly.
-- Shuah
prev parent reply other threads:[~2018-03-07 15:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 13:07 Anders Roxell
2018-03-07 15:11 ` Shuah Khan
2018-03-07 15:38 ` Shuah Khan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f4df30f2-7445-d937-7c36-9b16b1d0415e@kernel.org \
--to=shuah@kernel.org \
--cc=anders.roxell@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuahkh@osg.samsung.com \
--cc=tbird20d@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®