Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Sep 2009 20:14:20 +0200
From:      Max Laier <max@love2party.net>
To:        freebsd-hackers@freebsd.org
Subject:   Re: memchr() strangeness
Message-ID:  <200909042014.21290.max@love2party.net>
In-Reply-To: <4AA151C9.1090301@FreeBSD.org>
References:  <4AA14437.4050507@FreeBSD.org> <20090904172511.GI21946@elvis.mu.org> <4AA151C9.1090301@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 04 September 2009 19:43:37 Gabor Kovesdan wrote:
> Alfred Perlstein escribi=F3:
> > 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 =3D 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.

LC_* set to a locale not available in the jail?  Just a wild guess.

=2D-=20
/"\  Best regards,                      | mlaier@freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier@EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News



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