Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Dec 2006 21:55:37 -0600
From:      "Scot Hetzel" <swhetzel@gmail.com>
To:        "Divacky Roman" <xdivac02@stud.fit.vutbr.cz>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: linuxolator: amd64 Linux Test Project failures
Message-ID:  <790a9fff0612301955r35b16472r2429fbe3fce78228@mail.gmail.com>
In-Reply-To: <790a9fff0612301926n1562d560r1f3fff9af4bdb138@mail.gmail.com>
References:  <790a9fff0612290911t5ae69715gd2bf0dda0f9228f2@mail.gmail.com> <20061229213509.GA86839@stud.fit.vutbr.cz> <790a9fff0612291424g4ecbd088i7846d248851b3e63@mail.gmail.com> <20061230120722.GA36814@stud.fit.vutbr.cz> <790a9fff0612301926n1562d560r1f3fff9af4bdb138@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I think I found the problem,  I had wrongly assumed that the code was
using (char *)-1 as the address to pass to the function.  Instead the
code in access03, is using mmap to assign an address to variable
bad_address.

Below is the test program that shows that the problem is in mmap.

Scot

#include <errno.h>
#include <string.h>
#include <signal.h>

#include <unistd.h>
#include <sys/mman.h>

int
main()
{
   char * bad_addr;

   access((char *)-1, 0);
   bad_addr = mmap(0, 1, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
   printf("bad_addr = %p\n", bad_addr);
   access(bad_addr, 0);
   return(0);
}

hp010 / # gcc t1.c -o t1
hp010 / # ./t1
bad_addr = 0x2805e000
hp010 / # exit
exit

Dec 30 21:47:11 hp010 kernel: linux(1565): access(Checking if path
[0xffffffffffffffff/0xffffffffa3b5abe0/0xffffffff] exists)
Dec 30 21:47:11 hp010 kernel: kern_alternate_path: error = 14, path =
0xffffffffa3b5a980
Dec 30 21:47:11 hp010 kernel: linux(1565): access(Checking if path
[0xffffffffffffffff/0xffffffffa3b5abe0/0x2805e000] exists)
Dec 30 21:47:11 hp010 kernel: kern_alternate_path: error = 0, path =
0xffffffffa3b5a980



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