From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 4 17:59:05 2009 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8303D1065672 for ; Fri, 4 Sep 2009 17:59:05 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 3DA2A8FC18 for ; Fri, 4 Sep 2009 17:59:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id A826914D94FE; Fri, 4 Sep 2009 19:43:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at t-hosting.hu Received: from server.mypc.hu ([127.0.0.1]) by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id rYp80ndNTJAw; Fri, 4 Sep 2009 19:43:33 +0200 (CEST) Received: from [192.168.1.105] (catv-80-98-231-64.catv.broadband.hu [80.98.231.64]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 3760314D692F; Fri, 4 Sep 2009 19:43:33 +0200 (CEST) Message-ID: <4AA151C9.1090301@FreeBSD.org> Date: Fri, 04 Sep 2009 19:43:37 +0200 From: Gabor Kovesdan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Alfred Perlstein References: <4AA14437.4050507@FreeBSD.org> <20090904172511.GI21946@elvis.mu.org> In-Reply-To: <20090904172511.GI21946@elvis.mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: FreeBSD developers Subject: Re: memchr() strangeness X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2009 17:59:05 -0000 Alfred Perlstein escribió: > Moved to -hackers. > Thanks, this was my original intention. > Gabor, can you please make a smaller program to exhibit this behavior? > (not just the error line) > > I will be glad to help out. > After reading your mail, I've made a small program: #include #include #include #include int main(int argc, char *argv[]) { bool foo; foo = memchr(argv[1], '\0', strlen(argv[1])); if (foo) fprintf(stderr, "Ooooops!\n"); } And it works correctly, so actually grep fails somewhere else but it's very strange why it behaves differently jailed (or chrooted). Once submitted it for a portbuild test because it had been working correctly for me on a production system and then it failed on the cluster because the package build run jailed. And then I created a jail and in fact I could reproduce this but only in the jail. Regards, -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org