Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jan 2009 01:19:49 -0800
From:      Garrett Cooper <yanefbsd@gmail.com>
To:        Christoph Mallon <christoph.mallon@gmx.de>
Cc:        "amd64@freebsd.org" <amd64@freebsd.org>, Hackers freeBSD <freebsd-hackers@freebsd.org>
Subject:   Re: Confused by segfault with legitimate call to strerror(3) on amd64 / sysctl(3) setting `odd' errno's
Message-ID:  <7d6fde3d0901160119u7ca9606dw55300cd279410ad2@mail.gmail.com>
In-Reply-To: <7d6fde3d0901160058x785b0af7r741fc779eb537d5@mail.gmail.com>
References:  <7d6fde3d0901160041n55466290l55f737d274a40895@mail.gmail.com> <49704AEC.3080709@gmx.de> <7d6fde3d0901160056y7c395cb1m4675a3957b85f33d@mail.gmail.com> <49704C13.60505@gmx.de> <7d6fde3d0901160058x785b0af7r741fc779eb537d5@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 16, 2009 at 12:58 AM, Garrett Cooper <yanefbsd@gmail.com> wrote:
> On Fri, Jan 16, 2009 at 12:57 AM, Christoph Mallon
> <christoph.mallon@gmx.de> wrote:
>> Garrett Cooper schrieb:
>>>
>>> Good point. I modified the source to do that.
>>> Thanks,
>>> -Garrett
>>
>> You should reply to all so the discussion stays on the list.
>
> Yeah, that was a goofup on my part. Go-go Gmail web interface!
> -Garrett

Hmmm... looks like the strerror issue it could be a serious bug:

#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>

int
main()
{

        struct stat sb;

        int o_errno;

        if (stat("/some/file/that/doesn't/exist", &sb) != 0) {
                o_errno = errno;
                printf("Errno: %d\n", errno);
                err(errno, "%s", strerror(o_errno));
        }

        return 0;

}

[gcooper@optimus ~]$ ./badfile
Errno: 2
badfile: Segmentation fault: 11 (core dumped)

    I rebuilt my kernel and installed it, and I rebuilt world, but
haven't installed it yet though, so let me reboot the amd64 machine
and see what happens (may be a mismatched ABI issue)...
Cheers,
-Garrett



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