Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Sep 2009 19:43:37 +0200
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Alfred Perlstein <alfred@freebsd.org>
Cc:        FreeBSD developers <hackers@FreeBSD.org>
Subject:   Re: memchr() strangeness
Message-ID:  <4AA151C9.1090301@FreeBSD.org>
In-Reply-To: <20090904172511.GI21946@elvis.mu.org>
References:  <4AA14437.4050507@FreeBSD.org> <20090904172511.GI21946@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AA151C9.1090301>