Received: by 10.223.185.116 with SMTP id b49csp5186123wrg; Wed, 7 Mar 2018 07:40:05 -0800 (PST) X-Google-Smtp-Source: AG47ELuC8Va3xzKBNmwn/lOplCh4CHjW90oKUCfgAvCc7ujRsLYfPpveiaPOgKqegxEqIoJa1JwK X-Received: by 10.99.125.79 with SMTP id m15mr18207255pgn.428.1520437205219; Wed, 07 Mar 2018 07:40:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520437205; cv=none; d=google.com; s=arc-20160816; b=nwVaQa5Zq1X2Fv7u3uPfTuDr+qcQJUe3qZDuvmJHLEiBIy5EWAgFrNsNk8OziewvI/ VNu13UQ2UKRO2Yv0JgoT73DovgC2YnA9mBdcuapfURFxHvb4y+cw7uaS0sIKw/c+rM9W AXk0BUksaiK3lLI2yrkb0W99w1o+ZieaYzJh5g4z3i9OeBH0zyH9IDt82tvh9HKo0f8b I19KX1NDSe0ukrQZM8VjcniewFK/bL4QoTN3ocmlkayLsIJjQWwIaWAjLMduW7T8OE0h xb0iehuIMR64WZkwwIo21qSnA+6VyVb9x1TpfYxGGpqHBOAeCys/vtdFBYddCRYyim0m EJqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to :arc-authentication-results; bh=ikvH9IIuC9LMp6yqVBU2NZKu/SAxTMAA7ZtTVJwWg+c=; b=XC01Lilu9Uf5huF0FlLsJrVn1EroQqIdnOkcm7RMEBAtV6LBJD4FuhKEWZ1efJ2upq YU96RwbC0ddZ6RW7KmncGoIGKXrLO6ogtrxJDowAB+woB5bEqA5TxcALJKgqGi5WKlK/ Lq+JyAsYpYP43x9/BKN2uYRsis+LcO1bJavNNAVsuEWodTPonw1967xvYTj1OjDyCAa1 2yDTKoz4pJJuIKR9yPsSJIdLG8LgOHJ1rJxvmg7rxaAAIF6fKV7CU4MH3iBRtxSv94PA IzxQDUlGCIxYYKDu6sP7b14dQZ+5Jfe33BkUfquEZ501s4bWip6NrxYD9H0vfoPtW8BU kyKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si13726277pff.406.2018.03.07.07.39.50; Wed, 07 Mar 2018 07:40:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933968AbeCGPiQ (ORCPT + 99 others); Wed, 7 Mar 2018 10:38:16 -0500 Received: from mailout.easymail.ca ([64.68.200.34]:54166 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933749AbeCGPiN (ORCPT ); Wed, 7 Mar 2018 10:38:13 -0500 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id E6DF9218FD; Wed, 7 Mar 2018 15:38:12 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xx6sW1wRPgYB; Wed, 7 Mar 2018 15:38:12 +0000 (UTC) Received: from mail.gonehiking.org (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) by mailout.easymail.ca (Postfix) with ESMTPA id 552DB2183E; Wed, 7 Mar 2018 15:38:04 +0000 (UTC) Received: from [192.168.1.87] (shuah-xps.internal [192.168.1.87]) by mail.gonehiking.org (Postfix) with ESMTP id 2ADC69F143; Wed, 7 Mar 2018 08:38:04 -0700 (MST) Reply-To: shuah@kernel.org Subject: Re: [PATCH] selftests/size: rework to use main instead of _start To: Anders Roxell , tbird20d@gmail.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , Shuah Khan References: <20180307130725.8267-1-anders.roxell@linaro.org> <613a519a-9c2b-fb11-ecb9-f3c464d0af43@kernel.org> From: Shuah Khan Message-ID: Date: Wed, 7 Mar 2018 08:38:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <613a519a-9c2b-fb11-ecb9-f3c464d0af43@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 > > 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