From owner-freebsd-current@FreeBSD.ORG Fri Dec 4 17:35:07 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C88A1065672 for ; Fri, 4 Dec 2009 17:35:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 914DA8FC1D for ; Fri, 4 Dec 2009 17:35:06 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nB4HZ2b5072634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Dec 2009 19:35:02 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nB4HZ2Q8026967; Fri, 4 Dec 2009 19:35:02 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nB4HZ2ES026966; Fri, 4 Dec 2009 19:35:02 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 4 Dec 2009 19:35:02 +0200 From: Kostik Belousov To: Boris Samorodov Message-ID: <20091204173502.GJ43143@deviant.kiev.zoral.com.ua> References: <20226798@bb.ipt.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fmvA4kSBHQVZhkR6" Content-Disposition: inline In-Reply-To: <20226798@bb.ipt.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-current@freebsd.org Subject: Re: amd64 host + i386 jail + ls -l = core dumped X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 17:35:07 -0000 --fmvA4kSBHQVZhkR6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 04, 2009 at 06:36:49PM +0300, Boris Samorodov wrote: > Hello List, >=20 > I'm using an amd64 system (r200095): > ----- > % uname -srm > FreeBSD 9.0-CURRENT amd64 > ----- >=20 > The i386 jail was build with the same sources. There is a problem > in the jail: > ----- > % sudo jail -c path=3D/export/diskless_root host.hostname=3Dtesthostname = ip4.addr=3D127.0.0.10 command=3D/bin/csh > %uname -m > amd64 > %setenv UNAME_m i386 > %uname -m > i386 > %cd /root > %ls > ls.core test.txt > %ls -l > total 8191 > Bad system call (core dumped) > % %gdb /bin/ls ls.core=20 > GNU gdb 6.1.1 [FreeBSD] > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you = are > welcome to change it and/or distribute copies of it under certain conditi= ons. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for detail= s. > This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols = found)... > Core was generated by `ls'. > Program terminated with signal 12, Bad system call. > Reading symbols from /lib/libutil.so.8...(no debugging symbols found)...d= one. > Loaded symbols for /lib/libutil.so.8 > Reading symbols from /lib/libncurses.so.8...(no debugging symbols found).= ..done. > Loaded symbols for /lib/libncurses.so.8 > Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done. > Loaded symbols for /lib/libc.so.7 > Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found).= ..done. > Loaded symbols for /libexec/ld-elf.so.1 > #0 0x2814316f in __sys___acl_get_link () from /lib/libc.so.7 > (gdb) bt > #0 0x2814316f in __sys___acl_get_link () from /lib/libc.so.7 > #1 0x2814303c in acl_get_link_np () from /lib/libc.so.7 > #2 0x0804c2f9 in ?? () > #3 0xffffcb83 in ?? () > #4 0x00000004 in ?? () > [...] It seems that struct acl does not need translation. And another block of acl-related syscalls do not touch it. Please try the patch below. After application of the patch, cd to sys/compat/freebsd32 directory and do make sysent. Then, rebuild the kernel as usual. diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/sy= scalls.master index 865f0c1..485f7a6 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -740,10 +740,14 @@ struct freebsd32_ucontext *oucp, \ const struct freebsd32_ucontext *ucp); } 424 AUE_SWAPOFF UNIMPL swapoff -425 AUE_NULL UNIMPL __acl_get_link -426 AUE_NULL UNIMPL __acl_set_link -427 AUE_NULL UNIMPL __acl_delete_link -428 AUE_NULL UNIMPL __acl_aclcheck_link +425 AUE_NULL NOPROTO { int __acl_get_link(const char *path, \ + acl_type_t type, struct acl *aclp); } +426 AUE_NULL NOPROTO { int __acl_set_link(const char *path, \ + acl_type_t type, struct acl *aclp); } +427 AUE_NULL NOPROTO { int __acl_delete_link(const char *path, \ + acl_type_t type); } +428 AUE_NULL NOPROTO { int __acl_aclcheck_link(const char *path, \ + acl_type_t type, struct acl *aclp); } 429 AUE_SIGWAIT NOPROTO { int sigwait(const sigset_t *set, \ int *sig); } 430 AUE_NULL UNIMPL thr_create; --fmvA4kSBHQVZhkR6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksZSEUACgkQC3+MBN1Mb4iBqgCgupAVAC/EfVz98KID0S+SxwT+ 3i0An2kAmQWs/V1HkrY8ltLp/+rOHisN =WUGj -----END PGP SIGNATURE----- --fmvA4kSBHQVZhkR6--