From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 08:20:34 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC0611065678 for ; Sun, 14 Sep 2008 08:20:34 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 8A8C48FC15 for ; Sun, 14 Sep 2008 08:20:34 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 309641B696E; Sun, 14 Sep 2008 12:20:32 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1123974679; Sun, 14 Sep 2008 12:20:32 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.2/8.14.2) with ESMTP id m8E8KUqj002837; Sun, 14 Sep 2008 12:20:30 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.2/8.14.2/Submit) id m8E8KPFf002836; Sun, 14 Sep 2008 12:20:25 +0400 (MSD) (envelope-from root) Date: Sun, 14 Sep 2008 12:20:25 +0400 From: Chagin Dmitry To: Jose Garcia Juanino Message-ID: <20080914082025.GA2792@dchagin.dialup.corbina.ru> Mail-Followup-To: Jose Garcia Juanino , freebsd-emulation@freebsd.org References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080913205515.GA6158@sanabria> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 08:20:34 -0000 On Sat, Sep 13, 2008 at 10:55:17PM +0200, Jose Garcia Juanino wrote: > El s?bado 13 de septiembre a las 10:51:08 CEST, Chagin Dmitry escribi?: > > On Sat, Sep 13, 2008 at 10:44:13AM +0200, Jose Garcia Juanino wrote: > > > > > > Thank you for your response. > > > > > > The output is: > > > > > > # uname -vp > > > FreeBSD 7.0-RELEASE-p4 #3: Thu Sep 4 08:54:56 CEST 2008 root@:/usr/obj/src/sys/MK2008Jun06 i386 > > > > > > [ .... ] > > > > > > > thnx, I believe you problem already fixed at 07.09.08, > > please cvsup and try yet... > > I have done that now, but sadly, there is no difference with 7.0: > > $ uname -r > 7.1-PRERELEASE > > $ /compat/linux/usr/lib/oracle/10.2.0.3/client/bin/sqlplus /nolog > > SQL*Plus: Release 10.2.0.3.0 - Production on Sat Sep 13 20:47:47 2008 > > Copyright (c) 1982, 2006, Oracle. All Rights Reserved. > > SQL> [hit CTRL+C] > Segmentation fault > thnx! on amd64 I can't repeat this: dchagin# chroot /compat/linux /bin/bash bash-3.2# bash-3.2# uname -a Linux dchagin.dialup.corbina.ru 2.6.16 FreeBSD 8.0-CURRENT #2: Fri Sep 12 10:36: 07 MSD 2008 i686 i686 i386 GNU/Linux bash-3.2# bash-3.2# sqlplus /nolog SQL*Plus: Release 10.2.0.3.0 - Production on Sun Sep 14 08:10:40 2008 Copyright (c) 1982, 2006, Oracle. All Rights Reserved. SQL> ^C SQL> but I see strange behaviour of read() call: 1428 sqlplus 6.276496 CALL write(0x1,0x28066000,0x5) 1428 sqlplus 6.276514 GIO fd 1 wrote 5 bytes "SQL> " 1428 sqlplus 6.276526 RET write 5 1428 sqlplus 6.276545 CALL read(0,0x28067000,0x1000) 1428 sqlplus 21.321774 RET read -1 errno 1 (EPERM) Operation not permitted 1428 sqlplus 21.321832 PSIG SIGINT caught handler=0x28c06c2c code=0x0 1428 sqlplus 21.321856 CALL linux_rt_sigprocmask(SIG_BLOCK,0xffff8de8,0,0x8) 1428 sqlplus 21.321867 RET linux_rt_sigprocmask 0 1428 sqlplus 21.321877 CALL linux_rt_sigprocmask(SIG_UNBLOCK,0xffff8de8,0,0x8) 1428 sqlplus 21.321886 RET linux_rt_sigprocmask 0 1428 sqlplus 21.321896 CALL linux_rt_sigreturn(0xffff8f4c) 1428 sqlplus 21.321905 RET linux_rt_sigreturn -1 errno 2 (ENOENT) No such fil 1428 sqlplus 21.321913 CALL read(0,0x28067000,0x1000) 1428 sqlplus 23.893183 GIO fd 0 read 1 byte at least, EPERM is not EINTR :) I will check up it on i386 later. thnx Jose :) -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 09:08:55 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D66E41065684 for ; Sun, 14 Sep 2008 09:08:55 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 5E01E8FC15 for ; Sun, 14 Sep 2008 09:08:49 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id E422165C1D9; Sun, 14 Sep 2008 11:08:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GG9Rhdg4gpbA; Sun, 14 Sep 2008 11:08:57 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id E355665C16F; Sun, 14 Sep 2008 11:08:56 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m8E98uJb051350; Sun, 14 Sep 2008 11:08:56 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 14 Sep 2008 11:08:56 +0200 From: Roman Divacky To: Jose Garcia Juanino Message-ID: <20080914090856.GA51307@freebsd.org> References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080913205515.GA6158@sanabria> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 09:08:55 -0000 On Sat, Sep 13, 2008 at 10:55:17PM +0200, Jose Garcia Juanino wrote: > El s?bado 13 de septiembre a las 10:51:08 CEST, Chagin Dmitry escribi?: > > On Sat, Sep 13, 2008 at 10:44:13AM +0200, Jose Garcia Juanino wrote: > > > > > > Thank you for your response. > > > > > > The output is: > > > > > > # uname -vp > > > FreeBSD 7.0-RELEASE-p4 #3: Thu Sep 4 08:54:56 CEST 2008 root@:/usr/obj/src/sys/MK2008Jun06 i386 > > > > > > [ .... ] > > > > > > > thnx, I believe you problem already fixed at 07.09.08, > > please cvsup and try yet... > > I have done that now, but sadly, there is no difference with 7.0: > > $ uname -r > 7.1-PRERELEASE > > $ /compat/linux/usr/lib/oracle/10.2.0.3/client/bin/sqlplus /nolog > > SQL*Plus: Release 10.2.0.3.0 - Production on Sat Sep 13 20:47:47 2008 > > Copyright (c) 1982, 2006, Oracle. All Rights Reserved. > > SQL> [hit CTRL+C] > Segmentation fault > > Best regards please provide ktrace/linux_kdump... the "unknown futex operation" problem is fixed in this release so there must be something else From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 09:25:28 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C2E21065674; Sun, 14 Sep 2008 09:25:28 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 29E978FC17; Sun, 14 Sep 2008 09:25:27 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 80CE61B6807; Sun, 14 Sep 2008 13:25:26 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1124115046; Sun, 14 Sep 2008 13:25:26 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.2/8.14.2) with ESMTP id m8E9PPO7003158; Sun, 14 Sep 2008 13:25:25 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.2/8.14.2/Submit) id m8E9PKpL003157; Sun, 14 Sep 2008 13:25:20 +0400 (MSD) (envelope-from root) Date: Sun, 14 Sep 2008 13:25:19 +0400 From: Chagin Dmitry To: Roman Divacky Message-ID: <20080914092519.GA3121@dchagin.dialup.corbina.ru> Mail-Followup-To: Roman Divacky , Jose Garcia Juanino , freebsd-emulation@freebsd.org References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914090856.GA51307@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080914090856.GA51307@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org, Jose Garcia Juanino Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 09:25:28 -0000 On Sun, Sep 14, 2008 at 11:08:56AM +0200, Roman Divacky wrote: > On Sat, Sep 13, 2008 at 10:55:17PM +0200, Jose Garcia Juanino wrote: > > El s?bado 13 de septiembre a las 10:51:08 CEST, Chagin Dmitry escribi?: > > > On Sat, Sep 13, 2008 at 10:44:13AM +0200, Jose Garcia Juanino wrote: > > > > > > > > Thank you for your response. > > > > > > > > The output is: > > > > > > > > # uname -vp > > > > FreeBSD 7.0-RELEASE-p4 #3: Thu Sep 4 08:54:56 CEST 2008 root@:/usr/obj/src/sys/MK2008Jun06 i386 > > > > > > > > [ .... ] > > > > > > > > > > thnx, I believe you problem already fixed at 07.09.08, > > > please cvsup and try yet... > > > > I have done that now, but sadly, there is no difference with 7.0: > > > > $ uname -r > > 7.1-PRERELEASE > > > > $ /compat/linux/usr/lib/oracle/10.2.0.3/client/bin/sqlplus /nolog > > > > SQL*Plus: Release 10.2.0.3.0 - Production on Sat Sep 13 20:47:47 2008 > > > > Copyright (c) 1982, 2006, Oracle. All Rights Reserved. > > > > SQL> [hit CTRL+C] > > Segmentation fault > > > > Best regards > > please provide ktrace/linux_kdump... the "unknown futex operation" problem is fixed > in this release so there must be something else 1428 sqlplus 0.874520 CALL munmap(0x28066000,0xc41d) 1428 sqlplus 0.874543 RET munmap 0 1428 sqlplus 0.874553 CALL linux_set_tid_address(0x292cf708) 1428 sqlplus 0.874563 RET linux_set_tid_address 1428/0x594 1428 sqlplus 0.874572 CALL linux_set_robust_list(0x292cf710,0xc) 1428 sqlplus 0.874580 RET linux_set_robust_list -1 errno 22 (EINVAL) Invali d argument 1428 sqlplus 0.874596 CALL linux_sys_futex(0xffffdbc4,FUTEX_WAKE|FUTEX_PRIVA TE_FLAG,0x1,0x292cf6c0,0x29154ff4,0xffffdbd8) 1428 sqlplus 0.874608 RET linux_sys_futex 1 1428 sqlplus 0.874641 CALL linux_rt_sigaction(SIG 32,0xffffd87c,0,0x8) 1428 sqlplus 0.874651 RET linux_rt_sigaction 0 -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 11:49:52 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 372291065678 for ; Sun, 14 Sep 2008 11:49:52 +0000 (UTC) (envelope-from jjuanino@gmail.com) Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.177]) by mx1.freebsd.org (Postfix) with ESMTP id C303B8FC0C for ; Sun, 14 Sep 2008 11:49:51 +0000 (UTC) (envelope-from jjuanino@gmail.com) Received: by ik-out-1112.google.com with SMTP id c29so1427406ika.3 for ; Sun, 14 Sep 2008 04:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:x-operating-system:user-agent; bh=QSB9WAtIuvjHsvr8ms5WoO3Umev8gkJpLPG/4wvi3Qc=; b=ihFjVPw1P3NtZVOH5ztPLwSnCe2cOur1PhZz0G3glT+hBU2dpIEK5G7Yn0rTAeJ96D faZMXhd9EKNtV4c9OT/6ZEY0IKln7z0eN1XPglAtNitYVAkJrtOaRmSPy/aNzpqeBtFw wNBhUdz5H0a6EfiuqnhKnt87MsePmcO5xqSYA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-operating-system :user-agent; b=ffYDy/NqqDr6SLUUpnDcDEAsxCG4GWo+9YGcKOwmUnRYxAgUnVzNhy38NxcrCXd6xc waNwnC2+pjFChnk7zb8LsPAV2hqqZgyfWdJcuLoZCCeR2885ajMk8n0gla0dpEP+WC4m I4zZxBSJ8xN79Uh1VI/jMjTINjBw6KcPC78GY= Received: by 10.103.193.13 with SMTP id v13mr4551580mup.7.1221392990178; Sun, 14 Sep 2008 04:49:50 -0700 (PDT) Received: from sanabria ( [85.54.133.208]) by mx.google.com with ESMTPS id j9sm25339683mue.3.2008.09.14.04.49.48 (version=SSLv3 cipher=RC4-MD5); Sun, 14 Sep 2008 04:49:49 -0700 (PDT) Date: Sun, 14 Sep 2008 13:49:45 +0200 From: Jose Garcia Juanino To: Roman Divacky Message-ID: <20080914114945.GB3411@sanabria> References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914090856.GA51307@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wULyF7TL5taEdwHz" Content-Disposition: inline In-Reply-To: <20080914090856.GA51307@freebsd.org> X-Operating-System: FreeBSD 7.0-RELEASE-p4 User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-emulation@freebsd.org Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 11:49:52 -0000 --wULyF7TL5taEdwHz Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable El domingo 14 de septiembre a las 11:08:56 CEST, Roman Divacky escribi=F3: > On Sat, Sep 13, 2008 at 10:55:17PM +0200, Jose Garcia Juanino wrote: > > > > [ ...=20 > > > > I have done that now, but sadly, there is no difference with 7.0: > >=20 > > $ uname -r > > 7.1-PRERELEASE > >=20 > > $ /compat/linux/usr/lib/oracle/10.2.0.3/client/bin/sqlplus /nolog > >=20 > > SQL*Plus: Release 10.2.0.3.0 - Production on Sat Sep 13 20:47:47 2008 > >=20 > > Copyright (c) 1982, 2006, Oracle. All Rights Reserved. > >=20 > > SQL> [hit CTRL+C] > > Segmentation fault > >=20 > > Best regards >=20 > please provide ktrace/linux_kdump... the "unknown futex operation" proble= m is fixed > in this release so there must be something else Thanks for your response The output is: # uname -rm 7.1-PRERELEASE i386 # ktrace -d -t+ /compat/linux/usr/lib/oracle/10.2.0.3/client/bin/sqlplus /n= olog SQL*Plus: Release 10.2.0.3.0 - Production on Sun Sep 14 11:39:20 2008 Copyright (c) 1982, 2006, Oracle. All Rights Reserved. SQL> ^C [hit enter here] Segmentation fault # linux_kdump -t+ The output of linux_kdump is here: http://perso.orange.es/jogaju5001/ktrace.out (I have built the kernel with makeoptions DEBUG=3D-g, and I have suppressed INSTALL_NODEBUG=3D"yes" from /etc/make.conf ) Best regards --wULyF7TL5taEdwHz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjM+lkACgkQFOo0zaS9RnJxZQCgseJZfByb+yKgx0aU2X5QQm5s VgYAnjzb6k8R9xxj5aGOqcZzrTIB7gcN =Vlef -----END PGP SIGNATURE----- --wULyF7TL5taEdwHz-- From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 13:19:19 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5535F106567A for ; Sun, 14 Sep 2008 13:19:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 0A3998FC21 for ; Sun, 14 Sep 2008 13:19:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KerVV-0006w4-Kl; Sun, 14 Sep 2008 16:19:17 +0300 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 m8EDJ5LQ072934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 14 Sep 2008 16:19:05 +0300 (EEST) (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.2/8.14.2) with ESMTP id m8EDJ5xP026682; Sun, 14 Sep 2008 16:19:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m8EDJ4fP026681; Sun, 14 Sep 2008 16:19:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 14 Sep 2008 16:19:04 +0300 From: Kostik Belousov To: Jose Garcia Juanino , freebsd-emulation@freebsd.org Message-ID: <20080914131904.GY39652@deviant.kiev.zoral.com.ua> References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914082025.GA2792@dchagin.dialup.corbina.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/ZPAxgSw4JMezHmq" Content-Disposition: inline In-Reply-To: <20080914082025.GA2792@dchagin.dialup.corbina.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on 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 X-Virus-Scanned: mail.terabit.net.ua 1KerVV-0006w4-Kl fc8f0307bacaa7b1d3346d4e79cfb03e X-Terabit: YES Cc: Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 13:19:19 -0000 --/ZPAxgSw4JMezHmq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 14, 2008 at 12:20:25PM +0400, Chagin Dmitry wrote: > On Sat, Sep 13, 2008 at 10:55:17PM +0200, Jose Garcia Juanino wrote: > > El s?bado 13 de septiembre a las 10:51:08 CEST, Chagin Dmitry escribi?: > > > On Sat, Sep 13, 2008 at 10:44:13AM +0200, Jose Garcia Juanino wrote: > > > >=20 > > > > Thank you for your response. > > > >=20 > > > > The output is: > > > >=20 > > > > # uname -vp > > > > FreeBSD 7.0-RELEASE-p4 #3: Thu Sep 4 08:54:56 CEST 2008 root@:/usr/obj/src/sys/MK2008Jun06 i386 > > > >=20 > > > > [ .... ] > > > > > > >=20 > > > thnx, I believe you problem already fixed at 07.09.08, > > > please cvsup and try yet... > >=20 > > I have done that now, but sadly, there is no difference with 7.0: > >=20 > > $ uname -r > > 7.1-PRERELEASE > >=20 > > $ /compat/linux/usr/lib/oracle/10.2.0.3/client/bin/sqlplus /nolog > >=20 > > SQL*Plus: Release 10.2.0.3.0 - Production on Sat Sep 13 20:47:47 2008 > >=20 > > Copyright (c) 1982, 2006, Oracle. All Rights Reserved. > >=20 > > SQL> [hit CTRL+C] > > Segmentation fault > >=20 >=20 > thnx! on amd64 I can't repeat this: >=20 > dchagin# chroot /compat/linux /bin/bash > bash-3.2# > bash-3.2# uname -a > Linux dchagin.dialup.corbina.ru 2.6.16 FreeBSD 8.0-CURRENT #2: Fri Sep 12= 10:36: > 07 MSD 2008 i686 i686 i386 GNU/Linux > bash-3.2# > bash-3.2# sqlplus /nolog >=20 > SQL*Plus: Release 10.2.0.3.0 - Production on Sun Sep 14 08:10:40 2008 >=20 > Copyright (c) 1982, 2006, Oracle. All Rights Reserved. >=20 > SQL> ^C >=20 > SQL> It appears that I did not make MFC of the relevant commit. --/ZPAxgSw4JMezHmq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjND0gACgkQC3+MBN1Mb4g7agCgsmbYXvxmFf5GUP6ck1wSo8lt spcAnRi6d5m7DpNQ2if8jsC9er41FBnJ =Z6Yg -----END PGP SIGNATURE----- --/ZPAxgSw4JMezHmq-- From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 15:01:31 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 211D71065671 for ; Sun, 14 Sep 2008 15:01:31 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id C54158FC14 for ; Sun, 14 Sep 2008 15:01:30 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 2E0FD1B132A; Sun, 14 Sep 2008 19:01:28 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1124793583; Sun, 14 Sep 2008 19:00:56 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.2/8.14.2) with ESMTP id m8EF0tku004679; Sun, 14 Sep 2008 19:00:55 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.2/8.14.2/Submit) id m8EF0oHg004678; Sun, 14 Sep 2008 19:00:50 +0400 (MSD) (envelope-from root) Date: Sun, 14 Sep 2008 19:00:50 +0400 From: Chagin Dmitry To: Kostik Belousov Message-ID: <20080914150050.GA4644@dchagin.dialup.corbina.ru> Mail-Followup-To: Kostik Belousov , Jose Garcia Juanino , freebsd-emulation@freebsd.org References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914082025.GA2792@dchagin.dialup.corbina.ru> <20080914131904.GY39652@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080914131904.GY39652@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org, Jose Garcia Juanino Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 15:01:31 -0000 On Sun, Sep 14, 2008 at 04:19:04PM +0300, Kostik Belousov wrote: > On Sun, Sep 14, 2008 at 12:20:25PM +0400, Chagin Dmitry wrote: > > On Sat, Sep 13, 2008 at 10:55:17PM +0200, Jose Garcia Juanino wrote: > > > El s?bado 13 de septiembre a las 10:51:08 CEST, Chagin Dmitry escribi?: > > > > On Sat, Sep 13, 2008 at 10:44:13AM +0200, Jose Garcia Juanino wrote: > > > > > > > > > > Thank you for your response. > > > > > > > > > > The output is: > > > > > > > > > > # uname -vp > > > > > FreeBSD 7.0-RELEASE-p4 #3: Thu Sep 4 08:54:56 CEST 2008 root@:/usr/obj/src/sys/MK2008Jun06 i386 > > > > > > > > > > [ .... ] > > > > > > > > > > > > > thnx, I believe you problem already fixed at 07.09.08, > > > > please cvsup and try yet... > > > > > > I have done that now, but sadly, there is no difference with 7.0: > > > > > > $ uname -r > > > 7.1-PRERELEASE > > > > > > $ /compat/linux/usr/lib/oracle/10.2.0.3/client/bin/sqlplus /nolog > > > > > > SQL*Plus: Release 10.2.0.3.0 - Production on Sat Sep 13 20:47:47 2008 > > > > > > Copyright (c) 1982, 2006, Oracle. All Rights Reserved. > > > > > > SQL> [hit CTRL+C] > > > Segmentation fault > > > > > > > thnx! on amd64 I can't repeat this: > > > > dchagin# chroot /compat/linux /bin/bash > > bash-3.2# > > bash-3.2# uname -a > > Linux dchagin.dialup.corbina.ru 2.6.16 FreeBSD 8.0-CURRENT #2: Fri Sep 12 10:36: > > 07 MSD 2008 i686 i686 i386 GNU/Linux > > bash-3.2# > > bash-3.2# sqlplus /nolog > > > > SQL*Plus: Release 10.2.0.3.0 - Production on Sun Sep 14 08:10:40 2008 > > > > Copyright (c) 1982, 2006, Oracle. All Rights Reserved. > > > > SQL> ^C > > > > SQL> > > It appears that I did not make MFC of the relevant commit. ah, I'm sorry... I have thought that week has passed and has not checked up it (( -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 15:17:57 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 978661065671 for ; Sun, 14 Sep 2008 15:17:57 +0000 (UTC) (envelope-from jjuanino@gmail.com) Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.191]) by mx1.freebsd.org (Postfix) with ESMTP id 1C58F8FC17 for ; Sun, 14 Sep 2008 15:17:56 +0000 (UTC) (envelope-from jjuanino@gmail.com) Received: by gv-out-0910.google.com with SMTP id n8so722155gve.39 for ; Sun, 14 Sep 2008 08:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:x-operating-system:user-agent; bh=FFT8nC/gboo5xPRZiXh9S/TX1AHQi7FJCAQdOpqy+pM=; b=O7FCPqpkMWDq6FBDOQBZZ0u4GtgAn0eEUHcKFxSFOumk4mydW/9f3KzSHMEycAQK+K vrW22fRhnOXOliDQcqtfxJwVKC8b7aFjUDoDtbK908+xY2PObiMxFboqMkdbxi8GJ0mp VRIuk5xFlv0XUDROCHebWEZVEGdLhX8u/cDtI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-operating-system :user-agent; b=HKKSdB+rl/495rw8DNWvzizJJmx91NnmXjM8T5D2lRILj6k9O3eeN8g9QD9y4Fj+pA tSPmkLASfCf2Dw1fPIIhb7riMOo7XxFFj9wb7PAzSi1Avj9nyLQeEBIXmvXmJGVqavDr nZWTQdn5gjdSXdPzwvhW7BqocT8tlwYE8zO6E= Received: by 10.103.233.12 with SMTP id k12mr4667498mur.54.1221405475513; Sun, 14 Sep 2008 08:17:55 -0700 (PDT) Received: from sanabria ( [85.54.133.208]) by mx.google.com with ESMTPS id u9sm28254585muf.9.2008.09.14.08.17.53 (version=SSLv3 cipher=RC4-MD5); Sun, 14 Sep 2008 08:17:54 -0700 (PDT) Date: Sun, 14 Sep 2008 17:17:49 +0200 From: Jose Garcia Juanino To: freebsd-emulation@freebsd.org Message-ID: <20080914151748.GA5370@sanabria> References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914082025.GA2792@dchagin.dialup.corbina.ru> <20080914131904.GY39652@deviant.kiev.zoral.com.ua> <20080914150050.GA4644@dchagin.dialup.corbina.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline In-Reply-To: <20080914150050.GA4644@dchagin.dialup.corbina.ru> X-Operating-System: FreeBSD 7.0-RELEASE-p4 User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 15:17:57 -0000 --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable El domingo 14 de septiembre a las 17:00:50 CEST, Chagin Dmitry escribi=F3: > On Sun, Sep 14, 2008 at 04:19:04PM +0300, Kostik Belousov wrote: > >=20 > > It appears that I did not make MFC of the relevant commit. >=20 > ah, I'm sorry... I have thought that week has passed > and has not checked up it (( Therefore, this issue holds for RELENG_7, but not for CURRENT. Is there any prevision to make the MFC, despite of freeze of RELENG_7 branch? Or it is needed wait until 7.2-RELEASE? Best regards --Kj7319i9nmIyA2yE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjNKxwACgkQFOo0zaS9RnL5ZACZAfbNToCRr5aPcBdmFRJ+yOdc oEoAnR/GYfguI7wlsm1rjq8QkTWCWv7P =YfGA -----END PGP SIGNATURE----- --Kj7319i9nmIyA2yE-- From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 15:49:31 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A69F106567C for ; Sun, 14 Sep 2008 15:49:31 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [87.251.61.211]) by mx1.freebsd.org (Postfix) with ESMTP id AAF4D8FC0C for ; Sun, 14 Sep 2008 15:49:30 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id E34EE1CC22; Sun, 14 Sep 2008 17:38:40 +0200 (CEST) Date: Sun, 14 Sep 2008 17:38:40 +0200 From: Ed Schouten To: freebsd-emulation@freebsd.org Message-ID: <20080914153840.GO1191@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BouVgDkIlpb7X6Bk" Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Subject: [Patch] Compiling COMPAT_SVR4 without COMPAT_43 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 15:49:31 -0000 --BouVgDkIlpb7X6Bk Content-Type: multipart/mixed; boundary="G+DT6X5ssgZ56VG3" Content-Disposition: inline --G+DT6X5ssgZ56VG3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello everyone, I just build this patch on my system at home. Fortunately I'm not a user of COMPAT_SVR4, but I thought some of its users may actually find it useful. The attached patch should allow COMPAT_SVR4 users to use it without having COMPAT_43 in their kernel configuration. Any comments? I'll commit it when (if) I've received any feedback. Thanks! --=20 Ed Schouten WWW: http://80386.nl/ --G+DT6X5ssgZ56VG3 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="svr4.diff" Content-Transfer-Encoding: quoted-printable Index: sys/compat/svr4/svr4_stream.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/compat/svr4/svr4_stream.c (revision 182995) +++ sys/compat/svr4/svr4_stream.c (working copy) @@ -1985,24 +1985,32 @@ struct thread *td; struct svr4_sys_send_args *uap; { - struct osend_args osa; - osa.s =3D uap->s; - osa.buf =3D uap->buf; - osa.len =3D uap->len; - osa.flags =3D uap->flags; - return osend(td, &osa); + struct sendto_args sta; + + sta.s =3D uap->s; + sta.buf =3D uap->buf; + sta.len =3D uap->len; + sta.flags =3D uap->flags; + sta.to =3D NULL; + sta.tolen =3D 0; + + return (sendto(td, &sta)); } =20 int svr4_sys_recv(td, uap) struct thread *td; struct svr4_sys_recv_args *uap; { - struct orecv_args ora; - ora.s =3D uap->s; - ora.buf =3D uap->buf; - ora.len =3D uap->len; - ora.flags =3D uap->flags; - return orecv(td, &ora); + struct recvfrom_args rfa; + + rfa.s =3D uap->s; + rfa.buf =3D uap->buf; + rfa.len =3D uap->len; + rfa.flags =3D uap->flags; + rfa.from =3D NULL; + rfa.fromlenaddr =3D NULL; + + return (recvfrom(td, &rfa)); } =20 /*=20 Index: sys/compat/svr4/svr4_sysvec.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/compat/svr4/svr4_sysvec.c (revision 182995) +++ sys/compat/svr4/svr4_sysvec.c (working copy) @@ -34,10 +34,6 @@ /* XXX we use functions that might not exist. */ #include "opt_compat.h" =20 -#ifndef COMPAT_43 -#error "Unable to compile SVR4-emulator due to missing COMPAT_43 option!" -#endif - #include #include #include Index: sys/modules/svr4/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/modules/svr4/Makefile (revision 182995) +++ sys/modules/svr4/Makefile (working copy) @@ -24,14 +24,9 @@ svr4_genassym.o: svr4_genassym.c svr4.h @ machine ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC} =20 -.if !defined(KERNBUILDDIR) -opt_compat.h: - echo "#define COMPAT_43 1" > ${.TARGET} - -.if defined(DEBUG) +.if !defined(KERNBUILDDIR) && defined(DEBUG) opt_svr4.h: echo "#define DEBUG_SVR4 1" > ${.TARGET} .endif -.endif =20 .include --G+DT6X5ssgZ56VG3-- --BouVgDkIlpb7X6Bk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjNMAAACgkQ52SDGA2eCwV0KwCePpJO/B76CX6xwg9ZY/ZxUwjD zPYAnixg5M12LlroplrAQkEUqS6hzB5X =LDWq -----END PGP SIGNATURE----- --BouVgDkIlpb7X6Bk-- From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 16:38:47 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 496F8106567B for ; Sun, 14 Sep 2008 16:38:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id D18A88FC1F for ; Sun, 14 Sep 2008 16:38:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KeucW-000GP4-4j; Sun, 14 Sep 2008 19:38:44 +0300 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 m8EGcfKD082079 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 14 Sep 2008 19:38:41 +0300 (EEST) (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.2/8.14.2) with ESMTP id m8EGcfnV046699; Sun, 14 Sep 2008 19:38:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m8EGcf1m046698; Sun, 14 Sep 2008 19:38:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 14 Sep 2008 19:38:41 +0300 From: Kostik Belousov To: Jose Garcia Juanino Message-ID: <20080914163841.GB39652@deviant.kiev.zoral.com.ua> References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914082025.GA2792@dchagin.dialup.corbina.ru> <20080914131904.GY39652@deviant.kiev.zoral.com.ua> <20080914150050.GA4644@dchagin.dialup.corbina.ru> <20080914151748.GA5370@sanabria> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jk5HhkA9Kov5Oxsi" Content-Disposition: inline In-Reply-To: <20080914151748.GA5370@sanabria> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on 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 X-Virus-Scanned: mail.terabit.net.ua 1KeucW-000GP4-4j b1b70e65a7f88adb3d7a28261ea3d5df X-Terabit: YES Cc: freebsd-emulation@freebsd.org Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 16:38:47 -0000 --jk5HhkA9Kov5Oxsi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 14, 2008 at 05:17:49PM +0200, Jose Garcia Juanino wrote: > El domingo 14 de septiembre a las 17:00:50 CEST, Chagin Dmitry escribi?: > > On Sun, Sep 14, 2008 at 04:19:04PM +0300, Kostik Belousov wrote: > > >=20 > > > It appears that I did not make MFC of the relevant commit. > >=20 > > ah, I'm sorry... I have thought that week has passed > > and has not checked up it (( >=20 > Therefore, this issue holds for RELENG_7, but not for CURRENT. Is > there any prevision to make the MFC, despite of freeze of RELENG_7 > branch? Or it is needed wait until 7.2-RELEASE? I asked re@ for MFC permit. --jk5HhkA9Kov5Oxsi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjNPhAACgkQC3+MBN1Mb4ivKwCfTUDMZDfRwz9hdktWsZ44Xj6t 2poAn1sYRbzMcgc2YuU2mg4mrHitjDUC =NBkX -----END PGP SIGNATURE----- --jk5HhkA9Kov5Oxsi-- From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 18:48:20 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E51D3106566C for ; Sun, 14 Sep 2008 18:48:20 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 894E88FC08 for ; Sun, 14 Sep 2008 18:48:20 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 48E6165C24D for ; Sun, 14 Sep 2008 20:48:28 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WZ1HEbLD1gLC for ; Sun, 14 Sep 2008 20:48:17 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 7A40965C248 for ; Sun, 14 Sep 2008 20:48:17 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m8EImHQk086513 for freebsd-emulation@freebsd.org; Sun, 14 Sep 2008 20:48:17 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 14 Sep 2008 20:48:17 +0200 From: Roman Divacky To: freebsd-emulation@freebsd.org Message-ID: <20080914184817.GA86425@freebsd.org> References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914082025.GA2792@dchagin.dialup.corbina.ru> <20080914131904.GY39652@deviant.kiev.zoral.com.ua> <20080914150050.GA4644@dchagin.dialup.corbina.ru> <20080914151748.GA5370@sanabria> <20080914163841.GB39652@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080914163841.GB39652@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 18:48:21 -0000 On Sun, Sep 14, 2008 at 07:38:41PM +0300, Kostik Belousov wrote: > On Sun, Sep 14, 2008 at 05:17:49PM +0200, Jose Garcia Juanino wrote: > > El domingo 14 de septiembre a las 17:00:50 CEST, Chagin Dmitry escribi?: > > > On Sun, Sep 14, 2008 at 04:19:04PM +0300, Kostik Belousov wrote: > > > > > > > > It appears that I did not make MFC of the relevant commit. > > > > > > ah, I'm sorry... I have thought that week has passed > > > and has not checked up it (( > > > > Therefore, this issue holds for RELENG_7, but not for CURRENT. Is > > there any prevision to make the MFC, despite of freeze of RELENG_7 > > branch? Or it is needed wait until 7.2-RELEASE? > > I asked re@ for MFC permit. heh... doesnt it feel a little schizophrenic to ask yourself for the permit? :) From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 18:49:26 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 792841065678 for ; Sun, 14 Sep 2008 18:49:26 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 213A18FC16 for ; Sun, 14 Sep 2008 18:49:26 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 7C2F865C248; Sun, 14 Sep 2008 20:49:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ftvUiwY81u-Q; Sun, 14 Sep 2008 20:49:33 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 2679D65C1E7; Sun, 14 Sep 2008 20:49:33 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m8EInX5S086603; Sun, 14 Sep 2008 20:49:33 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 14 Sep 2008 20:49:33 +0200 From: Roman Divacky To: Jose Garcia Juanino , freebsd-emulation@freebsd.org Message-ID: <20080914184933.GB86425@freebsd.org> References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914090856.GA51307@freebsd.org> <20080914092519.GA3121@dchagin.dialup.corbina.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080914092519.GA3121@dchagin.dialup.corbina.ru> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 18:49:26 -0000 On Sun, Sep 14, 2008 at 01:25:19PM +0400, Chagin Dmitry wrote: > On Sun, Sep 14, 2008 at 11:08:56AM +0200, Roman Divacky wrote: > > On Sat, Sep 13, 2008 at 10:55:17PM +0200, Jose Garcia Juanino wrote: > > > El s?bado 13 de septiembre a las 10:51:08 CEST, Chagin Dmitry escribi?: > > > > On Sat, Sep 13, 2008 at 10:44:13AM +0200, Jose Garcia Juanino wrote: > > > > > > > > > > Thank you for your response. > > > > > > > > > > The output is: > > > > > > > > > > # uname -vp > > > > > FreeBSD 7.0-RELEASE-p4 #3: Thu Sep 4 08:54:56 CEST 2008 root@:/usr/obj/src/sys/MK2008Jun06 i386 > > > > > > > > > > [ .... ] > > > > > > > > > > > > > thnx, I believe you problem already fixed at 07.09.08, > > > > please cvsup and try yet... > > > > > > I have done that now, but sadly, there is no difference with 7.0: > > > > > > $ uname -r > > > 7.1-PRERELEASE > > > > > > $ /compat/linux/usr/lib/oracle/10.2.0.3/client/bin/sqlplus /nolog > > > > > > SQL*Plus: Release 10.2.0.3.0 - Production on Sat Sep 13 20:47:47 2008 > > > > > > Copyright (c) 1982, 2006, Oracle. All Rights Reserved. > > > > > > SQL> [hit CTRL+C] > > > Segmentation fault > > > > > > Best regards > > > > please provide ktrace/linux_kdump... the "unknown futex operation" problem is fixed > > in this release so there must be something else > > 1428 sqlplus 0.874520 CALL munmap(0x28066000,0xc41d) > 1428 sqlplus 0.874543 RET munmap 0 > 1428 sqlplus 0.874553 CALL linux_set_tid_address(0x292cf708) > 1428 sqlplus 0.874563 RET linux_set_tid_address 1428/0x594 > 1428 sqlplus 0.874572 CALL linux_set_robust_list(0x292cf710,0xc) > 1428 sqlplus 0.874580 RET linux_set_robust_list -1 errno 22 (EINVAL) Invali > d argument > 1428 sqlplus 0.874596 CALL linux_sys_futex(0xffffdbc4,FUTEX_WAKE|FUTEX_PRIVA > TE_FLAG,0x1,0x292cf6c0,0x29154ff4,0xffffdbd8) > 1428 sqlplus 0.874608 RET linux_sys_futex 1 > 1428 sqlplus 0.874641 CALL linux_rt_sigaction(SIG 32,0xffffd87c,0,0x8) > 1428 sqlplus 0.874651 RET linux_rt_sigaction 0 the robust futexes are also implemented in -CURRENT but I dont feel like MFcing them.... the error is also harmless do you want me guys to MFC the robust futexes? From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 18:51:37 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94D5B1065676 for ; Sun, 14 Sep 2008 18:51:37 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 415BB8FC08 for ; Sun, 14 Sep 2008 18:51:37 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id ECE2265C248; Sun, 14 Sep 2008 20:51:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CKEbwAlFr-hJ; Sun, 14 Sep 2008 20:51:45 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id E91C465C1E7; Sun, 14 Sep 2008 20:51:44 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m8EIpiUs086795; Sun, 14 Sep 2008 20:51:44 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 14 Sep 2008 20:51:44 +0200 From: Roman Divacky To: Ed Schouten Message-ID: <20080914185144.GC86425@freebsd.org> References: <20080914153840.GO1191@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080914153840.GO1191@hoeg.nl> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: [Patch] Compiling COMPAT_SVR4 without COMPAT_43 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 18:51:37 -0000 On Sun, Sep 14, 2008 at 05:38:40PM +0200, Ed Schouten wrote: > Hello everyone, > > I just build this patch on my system at home. Fortunately I'm not a user > of COMPAT_SVR4, but I thought some of its users may actually find it > useful. > > The attached patch should allow COMPAT_SVR4 users to use it without > having COMPAT_43 in their kernel configuration. Any comments? I'll > commit it when (if) I've received any feedback. Thanks! looks good to me. I believe you might want to ask jhb@ as he seems to know of some users of SVR4 (at yahoo! ?)... just out of curiousity... why did you do this? thnx! roman From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 19:00:32 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7812106564A; Sun, 14 Sep 2008 19:00:32 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id 712F78FC17; Sun, 14 Sep 2008 19:00:32 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 9D4081CCDC; Sun, 14 Sep 2008 21:00:31 +0200 (CEST) Date: Sun, 14 Sep 2008 21:00:31 +0200 From: Ed Schouten To: Roman Divacky Message-ID: <20080914190031.GA81522@hoeg.nl> References: <20080914153840.GO1191@hoeg.nl> <20080914185144.GC86425@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <20080914185144.GC86425@freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-emulation@freebsd.org Subject: Re: [Patch] Compiling COMPAT_SVR4 without COMPAT_43 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 19:00:32 -0000 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Roman Divacky wrote: > On Sun, Sep 14, 2008 at 05:38:40PM +0200, Ed Schouten wrote: > > Hello everyone, > >=20 > > I just build this patch on my system at home. Fortunately I'm not a user > > of COMPAT_SVR4, but I thought some of its users may actually find it > > useful. > >=20 > > The attached patch should allow COMPAT_SVR4 users to use it without > > having COMPAT_43 in their kernel configuration. Any comments? I'll > > commit it when (if) I've received any feedback. Thanks! >=20 > looks good to me. I believe you might want to ask jhb@ as he seems > to know of some users of SVR4 (at yahoo! ?)... >=20 > just out of curiousity... why did you do this? I was running a random grep on our source tree on COMPAT_43 and I noticed svr4 had this #error in it, so I thought: I wonder what would happen if I'd remove the #error. It turns out only two socket functions used actual COMPAT_43 bits, so that's why I wrote the patch. Thanks for pointing me to jhb. I'll contact him. --=20 Ed Schouten WWW: http://80386.nl/ --GvXjxJ+pjyke8COw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjNX08ACgkQ52SDGA2eCwXKTQCfUEgX6lXjd2w4+1p0T1sT0K98 +fcAn23vz0/yRCg+s+nGvQm4FIWPyyeM =fYDL -----END PGP SIGNATURE----- --GvXjxJ+pjyke8COw-- From owner-freebsd-emulation@FreeBSD.ORG Mon Sep 15 15:18:46 2008 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD518106564A for ; Mon, 15 Sep 2008 15:18:46 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AC0078FC27 for ; Mon, 15 Sep 2008 15:18:46 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m8FFIkhL018849 for ; Mon, 15 Sep 2008 15:18:46 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m8FFIkKx018845 for freebsd-emulation@FreeBSD.org; Mon, 15 Sep 2008 15:18:46 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 15 Sep 2008 15:18:46 GMT Message-Id: <200809151518.m8FFIkKx018845@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-emulation@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-emulation@FreeBSD.org X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2008 15:18:46 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/126232 emulation [linux] Linux ioctl TCGETS (0x5401) always fails o ports/121800 emulation x11-toolkits/linux-openmotif - OpenMotif upgrade to 2. o kern/97326 emulation [linux] file descriptor leakage in linux emulation o ports/91318 emulation [fix] graphics/linux_dri: works on amd64 too o kern/91293 emulation [svr4] [patch] *Experimental* Update to the SVR4 emula o kern/73777 emulation [linux] [patch] linux emulation: root dir special hand a kern/72920 emulation [linux]: path "prefixing" is not done on unix domain s o kern/41543 emulation [patch] [request] easier wine/w23 support o kern/39201 emulation [linux] [patch] ptrace(2) and rfork(RFLINUXTHPN) confu o kern/29698 emulation [linux] [patch] linux ipcs doesn'work o kern/21463 emulation [linux] Linux compatability mode should not allow setu o kern/11165 emulation [ibcs2] IBCS2 doesn't work correctly with PID_MAX 9999 12 problems total. From owner-freebsd-emulation@FreeBSD.ORG Mon Sep 15 15:48:25 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76EA01065676; Mon, 15 Sep 2008 15:48:25 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 0E8878FC2B; Mon, 15 Sep 2008 15:48:19 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id F1B981BB2F9; Mon, 15 Sep 2008 19:48:16 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1130495545; Mon, 15 Sep 2008 19:48:16 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.2/8.14.2) with ESMTP id m8FFmGtR003733; Mon, 15 Sep 2008 19:48:16 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.2/8.14.2/Submit) id m8FFmBJb003732; Mon, 15 Sep 2008 19:48:11 +0400 (MSD) (envelope-from root) Date: Mon, 15 Sep 2008 19:48:11 +0400 From: Chagin Dmitry To: Roman Divacky Message-ID: <20080915154811.GA3696@dchagin.dialup.corbina.ru> Mail-Followup-To: Roman Divacky , Jose Garcia Juanino , freebsd-emulation@freebsd.org References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914090856.GA51307@freebsd.org> <20080914092519.GA3121@dchagin.dialup.corbina.ru> <20080914184933.GB86425@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080914184933.GB86425@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org, Jose Garcia Juanino Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2008 15:48:25 -0000 On Sun, Sep 14, 2008 at 08:49:33PM +0200, Roman Divacky wrote: > On Sun, Sep 14, 2008 at 01:25:19PM +0400, Chagin Dmitry wrote: > > > > > > please provide ktrace/linux_kdump... the "unknown futex operation" problem is fixed > > > in this release so there must be something else > > > > 1428 sqlplus 0.874520 CALL munmap(0x28066000,0xc41d) > > 1428 sqlplus 0.874543 RET munmap 0 > > 1428 sqlplus 0.874553 CALL linux_set_tid_address(0x292cf708) > > 1428 sqlplus 0.874563 RET linux_set_tid_address 1428/0x594 > > 1428 sqlplus 0.874572 CALL linux_set_robust_list(0x292cf710,0xc) > > 1428 sqlplus 0.874580 RET linux_set_robust_list -1 errno 22 (EINVAL) Invali > > d argument > > 1428 sqlplus 0.874596 CALL linux_sys_futex(0xffffdbc4,FUTEX_WAKE|FUTEX_PRIVA > > TE_FLAG,0x1,0x292cf6c0,0x29154ff4,0xffffdbd8) > > 1428 sqlplus 0.874608 RET linux_sys_futex 1 > > 1428 sqlplus 0.874641 CALL linux_rt_sigaction(SIG 32,0xffffd87c,0,0x8) > > 1428 sqlplus 0.874651 RET linux_rt_sigaction 0 > > the robust futexes are also implemented in -CURRENT but I dont feel like > MFcing them.... the error is also harmless it amd64, so, set_robust_list() here does not work. look at a patch bellow, I show it for example only because I don't understand how futexes work :) diff --git a/src/sys/compat/linux/linux_futex.c b/src/sys/compat/linux/linux_futex.c index 6588d23..73cf3a7 100644 --- a/src/sys/compat/linux/linux_futex.c +++ b/src/sys/compat/linux/linux_futex.c @@ -551,7 +551,7 @@ linux_set_robust_list(struct thread *td, struct linux_set_robust_list_args *args return (EINVAL); em = em_find(td->td_proc, EMUL_DOLOCK); - em->robust_futexes = args->head; + em->robust_futexes = PTRIN(args->head); EMUL_UNLOCK(&emul_lock); return (0); @@ -661,17 +661,17 @@ release_futexes(struct proc *p) if (head == NULL) return; - if (fetch_robust_entry(&entry, &head->list.next, &pi)) + if (fetch_robust_entry(&entry, PTRIN(&head->list.next), &pi)) return; if (copyin(&head->futex_offset, &futex_offset, sizeof(l_ulong))) return; - if (fetch_robust_entry(&pending, &head->pending_list, &pip)) + if (fetch_robust_entry(&pending, PTRIN(&head->pending_list), &pip)) return; while (entry != &head->list) { - rc = fetch_robust_entry(&next_entry, &entry->next, &next_pi); + rc = fetch_robust_entry(&next_entry, PTRIN(&entry->next), &next_pi); if (entry != pending) if (handle_futex_death((char *)entry + futex_offset, diff --git a/src/sys/compat/linux/linux_futex.h b/src/sys/compat/linux/linux_futex.h index f6a2d4b..67b5115 100644 --- a/src/sys/compat/linux/linux_futex.h +++ b/src/sys/compat/linux/linux_futex.h @@ -66,14 +66,22 @@ /* This is defined by Linux user-space */ struct linux_robust_list { - struct linux_robust_list *next; -}; + l_uintptr_t next; +} +#if defined(__amd64__) && defined(COMPAT_LINUX32) +__packed +#endif +; struct linux_robust_list_head { struct linux_robust_list list; l_ulong futex_offset; - struct linux_robust_list *pending_list; -}; + l_uintptr_t pending_list; +} +#if defined(__amd64__) && defined(COMPAT_LINUX32) +__packed +#endif +; #define FUTEX_WAITERS 0x80000000 #define FUTEX_OWNER_DIED 0x40000000 thnx! -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Mon Sep 15 20:44:05 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 807B5106566B for ; Mon, 15 Sep 2008 20:44:05 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 02D8F8FC08 for ; Mon, 15 Sep 2008 20:44:04 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 9667565C2DA; Mon, 15 Sep 2008 22:44:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id syTFxR4Fu3bN; Mon, 15 Sep 2008 22:44:01 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 0077F65C2BA; Mon, 15 Sep 2008 22:44:00 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m8FKi0If092095; Mon, 15 Sep 2008 22:44:00 +0200 (CEST) (envelope-from rdivacky) Date: Mon, 15 Sep 2008 22:44:00 +0200 From: Roman Divacky To: Jose Garcia Juanino , freebsd-emulation@freebsd.org Message-ID: <20080915204400.GA92022@freebsd.org> References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914090856.GA51307@freebsd.org> <20080914092519.GA3121@dchagin.dialup.corbina.ru> <20080914184933.GB86425@freebsd.org> <20080915154811.GA3696@dchagin.dialup.corbina.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080915154811.GA3696@dchagin.dialup.corbina.ru> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2008 20:44:05 -0000 On Mon, Sep 15, 2008 at 07:48:11PM +0400, Chagin Dmitry wrote: > On Sun, Sep 14, 2008 at 08:49:33PM +0200, Roman Divacky wrote: > > On Sun, Sep 14, 2008 at 01:25:19PM +0400, Chagin Dmitry wrote: > > > > > > > > please provide ktrace/linux_kdump... the "unknown futex operation" problem is fixed > > > > in this release so there must be something else > > > > > > 1428 sqlplus 0.874520 CALL munmap(0x28066000,0xc41d) > > > 1428 sqlplus 0.874543 RET munmap 0 > > > 1428 sqlplus 0.874553 CALL linux_set_tid_address(0x292cf708) > > > 1428 sqlplus 0.874563 RET linux_set_tid_address 1428/0x594 > > > 1428 sqlplus 0.874572 CALL linux_set_robust_list(0x292cf710,0xc) > > > 1428 sqlplus 0.874580 RET linux_set_robust_list -1 errno 22 (EINVAL) Invali > > > d argument > > > 1428 sqlplus 0.874596 CALL linux_sys_futex(0xffffdbc4,FUTEX_WAKE|FUTEX_PRIVA > > > TE_FLAG,0x1,0x292cf6c0,0x29154ff4,0xffffdbd8) > > > 1428 sqlplus 0.874608 RET linux_sys_futex 1 > > > 1428 sqlplus 0.874641 CALL linux_rt_sigaction(SIG 32,0xffffd87c,0,0x8) > > > 1428 sqlplus 0.874651 RET linux_rt_sigaction 0 > > > > the robust futexes are also implemented in -CURRENT but I dont feel like > > MFcing them.... the error is also harmless > > it amd64, so, set_robust_list() here does not work. look at a patch bellow, > I show it for example only because I don't understand how futexes work :) > > > diff --git a/src/sys/compat/linux/linux_futex.c b/src/sys/compat/linux/linux_futex.c > index 6588d23..73cf3a7 100644 > --- a/src/sys/compat/linux/linux_futex.c > +++ b/src/sys/compat/linux/linux_futex.c > @@ -551,7 +551,7 @@ linux_set_robust_list(struct thread *td, struct linux_set_robust_list_args *args > return (EINVAL); > > em = em_find(td->td_proc, EMUL_DOLOCK); > - em->robust_futexes = args->head; > + em->robust_futexes = PTRIN(args->head); > EMUL_UNLOCK(&emul_lock); > > return (0); > @@ -661,17 +661,17 @@ release_futexes(struct proc *p) > if (head == NULL) > return; > > - if (fetch_robust_entry(&entry, &head->list.next, &pi)) > + if (fetch_robust_entry(&entry, PTRIN(&head->list.next), &pi)) > return; > > if (copyin(&head->futex_offset, &futex_offset, sizeof(l_ulong))) > return; > > - if (fetch_robust_entry(&pending, &head->pending_list, &pip)) > + if (fetch_robust_entry(&pending, PTRIN(&head->pending_list), &pip)) > return; > > while (entry != &head->list) { > - rc = fetch_robust_entry(&next_entry, &entry->next, &next_pi); > + rc = fetch_robust_entry(&next_entry, PTRIN(&entry->next), &next_pi); > > if (entry != pending) > if (handle_futex_death((char *)entry + futex_offset, > diff --git a/src/sys/compat/linux/linux_futex.h b/src/sys/compat/linux/linux_futex.h > index f6a2d4b..67b5115 100644 > --- a/src/sys/compat/linux/linux_futex.h > +++ b/src/sys/compat/linux/linux_futex.h > @@ -66,14 +66,22 @@ > /* This is defined by Linux user-space */ > > struct linux_robust_list { > - struct linux_robust_list *next; > -}; > + l_uintptr_t next; > +} > +#if defined(__amd64__) && defined(COMPAT_LINUX32) > +__packed > +#endif > +; > > struct linux_robust_list_head { > struct linux_robust_list list; > l_ulong futex_offset; > - struct linux_robust_list *pending_list; > -}; > + l_uintptr_t pending_list; > +} > +#if defined(__amd64__) && defined(COMPAT_LINUX32) > +__packed > +#endif > +; > > #define FUTEX_WAITERS 0x80000000 > #define FUTEX_OWNER_DIED 0x40000000 this looks about right... I'll ask kostik to commit this, dmitry, you should have commit bit :) From owner-freebsd-emulation@FreeBSD.ORG Wed Sep 17 05:17:01 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96B89106564A; Wed, 17 Sep 2008 05:17:01 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 40CA98FC19; Wed, 17 Sep 2008 05:17:00 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 3AE491C7D3F; Wed, 17 Sep 2008 09:16:58 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1141239085; Wed, 17 Sep 2008 09:16:58 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.2/8.14.2) with ESMTP id m8H5Gv9o002425; Wed, 17 Sep 2008 09:16:57 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.2/8.14.2/Submit) id m8H5GphP002424; Wed, 17 Sep 2008 09:16:51 +0400 (MSD) (envelope-from root) Date: Wed, 17 Sep 2008 09:16:51 +0400 From: Chagin Dmitry To: Roman Divacky Message-ID: <20080917051651.GA2390@dchagin.dialup.corbina.ru> Mail-Followup-To: Roman Divacky , freebsd-emulation@freebsd.org References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914090856.GA51307@freebsd.org> <20080914092519.GA3121@dchagin.dialup.corbina.ru> <20080914184933.GB86425@freebsd.org> <20080915154811.GA3696@dchagin.dialup.corbina.ru> <20080915204400.GA92022@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080915204400.GA92022@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2008 05:17:01 -0000 On Mon, Sep 15, 2008 at 10:44:00PM +0200, Roman Divacky wrote: > On Mon, Sep 15, 2008 at 07:48:11PM +0400, Chagin Dmitry wrote: > > On Sun, Sep 14, 2008 at 08:49:33PM +0200, Roman Divacky wrote: > > > On Sun, Sep 14, 2008 at 01:25:19PM +0400, Chagin Dmitry wrote: > > > > > > > > > > please provide ktrace/linux_kdump... the "unknown futex operation" problem is fixed > > > > > in this release so there must be something else > > > > > > > > 1428 sqlplus 0.874520 CALL munmap(0x28066000,0xc41d) > > > > 1428 sqlplus 0.874543 RET munmap 0 > > > > 1428 sqlplus 0.874553 CALL linux_set_tid_address(0x292cf708) > > > > 1428 sqlplus 0.874563 RET linux_set_tid_address 1428/0x594 > > > > 1428 sqlplus 0.874572 CALL linux_set_robust_list(0x292cf710,0xc) > > > > 1428 sqlplus 0.874580 RET linux_set_robust_list -1 errno 22 (EINVAL) Invali > > > > d argument > > > > 1428 sqlplus 0.874596 CALL linux_sys_futex(0xffffdbc4,FUTEX_WAKE|FUTEX_PRIVA > > > > TE_FLAG,0x1,0x292cf6c0,0x29154ff4,0xffffdbd8) > > > > 1428 sqlplus 0.874608 RET linux_sys_futex 1 > > > > 1428 sqlplus 0.874641 CALL linux_rt_sigaction(SIG 32,0xffffd87c,0,0x8) > > > > 1428 sqlplus 0.874651 RET linux_rt_sigaction 0 > > > > > > the robust futexes are also implemented in -CURRENT but I dont feel like > > > MFcing them.... the error is also harmless > > > > it amd64, so, set_robust_list() here does not work. look at a patch bellow, > > I show it for example only because I don't understand how futexes work :) > > > > > > diff --git a/src/sys/compat/linux/linux_futex.c b/src/sys/compat/linux/linux_futex.c > > index 6588d23..73cf3a7 100644 > > --- a/src/sys/compat/linux/linux_futex.c > > +++ b/src/sys/compat/linux/linux_futex.c > > @@ -551,7 +551,7 @@ linux_set_robust_list(struct thread *td, struct linux_set_robust_list_args *args > > return (EINVAL); > > > > em = em_find(td->td_proc, EMUL_DOLOCK); > > - em->robust_futexes = args->head; > > + em->robust_futexes = PTRIN(args->head); > > EMUL_UNLOCK(&emul_lock); > > > > return (0); > > @@ -661,17 +661,17 @@ release_futexes(struct proc *p) > > if (head == NULL) > > return; > > > > - if (fetch_robust_entry(&entry, &head->list.next, &pi)) > > + if (fetch_robust_entry(&entry, PTRIN(&head->list.next), &pi)) > > return; > > > > if (copyin(&head->futex_offset, &futex_offset, sizeof(l_ulong))) > > return; > > > > - if (fetch_robust_entry(&pending, &head->pending_list, &pip)) > > + if (fetch_robust_entry(&pending, PTRIN(&head->pending_list), &pip)) > > return; > > > > while (entry != &head->list) { > > - rc = fetch_robust_entry(&next_entry, &entry->next, &next_pi); > > + rc = fetch_robust_entry(&next_entry, PTRIN(&entry->next), &next_pi); > > > > if (entry != pending) > > if (handle_futex_death((char *)entry + futex_offset, > > diff --git a/src/sys/compat/linux/linux_futex.h b/src/sys/compat/linux/linux_futex.h > > index f6a2d4b..67b5115 100644 > > --- a/src/sys/compat/linux/linux_futex.h > > +++ b/src/sys/compat/linux/linux_futex.h > > @@ -66,14 +66,22 @@ > > /* This is defined by Linux user-space */ > > > > struct linux_robust_list { > > - struct linux_robust_list *next; > > -}; > > + l_uintptr_t next; > > +} > > +#if defined(__amd64__) && defined(COMPAT_LINUX32) > > +__packed > > +#endif > > +; > > > > struct linux_robust_list_head { > > struct linux_robust_list list; > > l_ulong futex_offset; > > - struct linux_robust_list *pending_list; > > -}; > > + l_uintptr_t pending_list; > > +} > > +#if defined(__amd64__) && defined(COMPAT_LINUX32) > > +__packed > > +#endif > > +; > > > > #define FUTEX_WAITERS 0x80000000 > > #define FUTEX_OWNER_DIED 0x40000000 > > this looks about right... I'll ask kostik to commit this, > I think that better if to move definitions of structures to linux.h > dmitry, you should have commit bit :) i'm ready :) thnx! -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Wed Sep 17 18:38:15 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FDCA1065680 for ; Wed, 17 Sep 2008 18:38:15 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 36CE08FC0C for ; Wed, 17 Sep 2008 18:38:08 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 84FC51C249A; Wed, 17 Sep 2008 22:38:07 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1146127590; Wed, 17 Sep 2008 22:38:07 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.2/8.14.2) with ESMTP id m8HIc6pO002798; Wed, 17 Sep 2008 22:38:06 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.2/8.14.2/Submit) id m8HIc1TU002797; Wed, 17 Sep 2008 22:38:01 +0400 (MSD) (envelope-from root) Date: Wed, 17 Sep 2008 22:38:01 +0400 From: Chagin Dmitry To: freebsd-emulation@freebsd.org Message-ID: <20080917183801.GA2714@dchagin.dialup.corbina.ru> Mail-Followup-To: freebsd-emulation@freebsd.org, freebsd-net@freebsd.org References: <20080822112927.GZ99951@hoeg.nl> <20080822112946.GA97526@freebsd.org> <20080831110610.GA2380@dchagin.dialup.corbina.ru> <20080902085623.GA12395@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080902085623.GA12395@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org Subject: [PATCH] recvmsg() sendmsg() linux emulation X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2008 18:38:15 -0000 On Tue, Sep 02, 2008 at 10:56:23AM +0200, Roman Divacky wrote: > On Sun, Aug 31, 2008 at 03:06:10PM +0400, Chagin Dmitry wrote: > > On Fri, Aug 22, 2008 at 01:29:46PM +0200, Roman Divacky wrote: > > > On Fri, Aug 22, 2008 at 01:29:27PM +0200, Ed Schouten wrote: > > > > Hello Emulation folks, > > > > > > > > I just wanted to send you all a message to say one of the things I tried > > > > to improve in the MPSAFE TTY branch was support for PTY's for Linux > > > > binaries. > > > > > > > > At home I've got a FreeBSD Jail running Debian Etch. Unfortunately, > > > > Linux sendmsg() is a little broken on FreeBSD/amd64, but so far I've > > > > been able to at least get OpenSSH (as root) and GNU Screen working. > > > > > > I believe dmitry has a patch for this.. > > > > the patch is bellow, I tested a patch only on LTP tests (with little changes), > > it's necessary to test on real apps, it will be good if Ed will test.. > > this should be reviewed by someone with a knowledge of how networking works in > FreeBSD. Any volunteer? Dmitry, can you send a mail to net@ describing the changes > in the patch and ask for a review there? > Hi, So, a patch bellow. The patch corrects sendmsg() recvmsg() in our linuxulator, also adds SO_PASSCRED option to linuxulator setsockopt() getsockopt() it's necessary for implementing Linux analogue of FreeBSD SCM_CREDS control message. I have tested it on i386 && ia32@amd64 linuxulators, it works for me now. Please review, any comment will be helpful. thnx! diff --git a/src/sys/amd64/linux32/linux.h b/src/sys/amd64/linux32/linux.h index 8940289..9439900 100644 --- a/src/sys/amd64/linux32/linux.h +++ b/src/sys/amd64/linux32/linux.h @@ -685,6 +685,7 @@ union l_semun { #define LINUX_SO_NO_CHECK 11 #define LINUX_SO_PRIORITY 12 #define LINUX_SO_LINGER 13 +#define LINUX_SO_PASSCRED 16 #define LINUX_SO_PEERCRED 17 #define LINUX_SO_RCVLOWAT 18 #define LINUX_SO_SNDLOWAT 19 @@ -709,6 +710,28 @@ struct l_sockaddr { char sa_data[14]; } __packed; +struct l_msghdr { + l_uintptr_t msg_name; + l_int msg_namelen; + l_uintptr_t msg_iov; + l_size_t msg_iovlen; + l_uintptr_t msg_control; + l_size_t msg_controllen; + l_uint msg_flags; +} __packed; + +struct l_cmsghdr { + l_size_t cmsg_len; + l_int cmsg_level; + l_int cmsg_type; +} __packed; + +struct l_ucred { + uint32_t pid; + uint32_t uid; + uint32_t gid; +} __packed; + struct l_ifmap { l_ulong mem_start; l_ulong mem_end; diff --git a/src/sys/amd64/linux32/linux32_machdep.c b/src/sys/amd64/linux32/linux32_machdep.c index 32cbe0b..26459c9 100644 --- a/src/sys/amd64/linux32/linux32_machdep.c +++ b/src/sys/amd64/linux32/linux32_machdep.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.49 2008/09/08 09 #include #include +#include #include #include #include @@ -232,13 +233,6 @@ linux_execve(struct thread *td, struct linux_execve_args *args) return (error); } -struct iovec32 { - u_int32_t iov_base; - int iov_len; -}; - -CTASSERT(sizeof(struct iovec32) == 8); - static int linux32_copyinuio(struct iovec32 *iovp, u_int iovcnt, struct uio **uiop) { @@ -281,6 +275,34 @@ linux32_copyinuio(struct iovec32 *iovp, u_int iovcnt, struct uio **uiop) } int +linux32_copyiniov(struct iovec32 *iovp32, u_int iovcnt, struct iovec **iovp, + int error) +{ + struct iovec32 iov32; + struct iovec *iov; + u_int iovlen; + int i; + + *iovp = NULL; + if (iovcnt > UIO_MAXIOV) + return (error); + iovlen = iovcnt * sizeof(struct iovec); + iov = malloc(iovlen, M_IOV, M_WAITOK); + for (i = 0; i < iovcnt; i++) { + error = copyin(&iovp32[i], &iov32, sizeof(struct iovec32)); + if (error) { + free(iov, M_IOV); + return (error); + } + iov[i].iov_base = PTRIN(iov32.iov_base); + iov[i].iov_len = iov32.iov_len; + } + *iovp = iov; + return(0); + +} + +int linux_readv(struct thread *td, struct linux_readv_args *uap) { struct uio *auio; diff --git a/src/sys/compat/linux/linux_socket.c b/src/sys/compat/linux/linux_socket.c index f97aa23..34e25dc 100644 --- a/src/sys/compat/linux/linux_socket.c +++ b/src/sys/compat/linux/linux_socket.c @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.76 2008/09/09 13:01: #ifdef COMPAT_LINUX32 #include +#include #include #else #include @@ -294,6 +295,8 @@ linux_to_bsd_so_sockopt(int opt) return (SO_OOBINLINE); case LINUX_SO_LINGER: return (SO_LINGER); + case LINUX_SO_PASSCRED: + return (LOCAL_CREDS); case LINUX_SO_PEERCRED: return (LOCAL_PEERCRED); case LINUX_SO_RCVLOWAT: @@ -421,6 +424,63 @@ linux_sa_put(struct osockaddr *osa) } static int +linux_to_bsd_cmsg_type(int cmsg_type) +{ + + switch (cmsg_type) { + case LINUX_SCM_RIGHTS: + return (SCM_RIGHTS); + case LINUX_SCM_CREDENTIALS: + return (SCM_CREDS); + } + return (cmsg_type); +} + +static int +bsd_to_linux_cmsg_type(int cmsg_type) +{ + + switch (cmsg_type) { + case SCM_RIGHTS: + return (LINUX_SCM_RIGHTS); + case SCM_CREDS: + return (LINUX_SCM_CREDENTIALS); + } + return (cmsg_type); +} + + + +static int +linux_to_bsd_msghdr(struct msghdr *bhdr, const struct l_msghdr *lhdr) +{ + if (lhdr->msg_controllen > INT_MAX) + return (ENOBUFS); + + bhdr->msg_name = PTRIN(lhdr->msg_name); + bhdr->msg_namelen = lhdr->msg_namelen; + bhdr->msg_iov = PTRIN(lhdr->msg_iov); + bhdr->msg_iovlen = lhdr->msg_iovlen; + bhdr->msg_control = PTRIN(lhdr->msg_control); + bhdr->msg_controllen = lhdr->msg_controllen; + bhdr->msg_flags = linux_to_bsd_msg_flags(lhdr->msg_flags); + return (0); +} + +static int +bsd_to_linux_msghdr(const struct msghdr *bhdr, struct l_msghdr *lhdr) +{ + lhdr->msg_name = PTROUT(bhdr->msg_name); + lhdr->msg_namelen = bhdr->msg_namelen; + lhdr->msg_iov = PTROUT(bhdr->msg_iov); + lhdr->msg_iovlen = bhdr->msg_iovlen; + lhdr->msg_control = PTROUT(bhdr->msg_control); + lhdr->msg_controllen = bhdr->msg_controllen; + /* msg_flags skipped */ + return (0); +} + +static int linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, enum uio_seg segflg) { @@ -437,25 +497,57 @@ linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, to = NULL; if (mp->msg_control != NULL) { + struct l_cmsghdr *ptr_cmsg; + struct l_cmsghdr linux_cmsg; struct cmsghdr *cmsg; - - if (mp->msg_controllen < sizeof(struct cmsghdr)) { - error = EINVAL; - goto bad; - } - error = sockargs(&control, mp->msg_control, - mp->msg_controllen, MT_CONTROL); - if (error) - goto bad; - - cmsg = mtod(control, struct cmsghdr *); - cmsg->cmsg_level = linux_to_bsd_sockopt_level(cmsg->cmsg_level); + void *data; + socklen_t datalen; + + cmsg = malloc(CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); + control = m_get(M_WAIT, MT_CONTROL); + ptr_cmsg = LINUX_CMSG_FIRSTHDR(mp); + + do { + error = copyin(ptr_cmsg, &linux_cmsg, + sizeof(struct l_cmsghdr)); + if (error) + goto bad; + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > INT_MAX) { + error = EINVAL; + goto bad; + } + + switch (linux_cmsg.cmsg_type) { + case LINUX_SCM_RIGHTS: + cmsg->cmsg_type = + linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); + break; + default: + error = EINVAL; + goto bad; + } + cmsg->cmsg_level = + linux_to_bsd_sockopt_level(linux_cmsg.cmsg_level); + + datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + cmsg->cmsg_len = CMSG_LEN(datalen); + data = LINUX_CMSG_DATA(ptr_cmsg); + + error = ENOBUFS; + if (!m_append(control, CMSG_HDRSZ, (c_caddr_t) cmsg)) + goto bad; + if (!m_append(control, datalen, (c_caddr_t) data)) + goto bad; + + } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(mp, ptr_cmsg))); + + free(cmsg, M_TEMP); } else control = NULL; error = kern_sendit(td, s, mp, linux_to_bsd_msg_flags(flags), control, segflg); - bad: if (to) FREE(to, M_SONAME); @@ -960,12 +1052,14 @@ static int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) { struct msghdr msg; + struct l_msghdr linux_msg; struct iovec *iov; int error; - /* XXXTJR sendmsg is broken on amd64 */ - - error = copyin(PTRIN(args->msg), &msg, sizeof(msg)); + error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); + if (error) + return (error); + error = linux_to_bsd_msghdr(&msg, &linux_msg); if (error) return (error); @@ -978,9 +1072,13 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) */ if (msg.msg_control != NULL && msg.msg_controllen == 0) msg.msg_control = NULL; + +#if defined(__amd64__) && defined(COMPAT_LINUX32) + error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, + &iov, EMSGSIZE); +#else error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); - if (error) - return (error); +#endif msg.msg_iov = iov; msg.msg_flags = 0; error = linux_sendit(td, args->s, &msg, args->flags, UIO_USERSPACE); @@ -997,44 +1095,168 @@ struct linux_recvmsg_args { static int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) { - struct recvmsg_args /* { - int s; - struct msghdr *msg; - int flags; - } */ bsd_args; struct msghdr msg; - struct cmsghdr *cmsg; + struct l_msghdr linux_msg; + struct l_cmsghdr *linux_cmsg = NULL; + struct iovec *iov, *uiov; + struct mbuf *control = NULL; + struct mbuf **controlp; int error; - /* XXXTJR recvmsg is broken on amd64 */ + error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); + if (error) + return (error); - if ((error = copyin(PTRIN(args->msg), &msg, sizeof (msg)))) + error = linux_to_bsd_msghdr(&msg, &linux_msg); + if (error) return (error); - bsd_args.s = args->s; - bsd_args.msg = PTRIN(args->msg); - bsd_args.flags = linux_to_bsd_msg_flags(args->flags); - if (msg.msg_name) { - linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name, - msg.msg_namelen); - error = recvmsg(td, &bsd_args); - bsd_to_linux_sockaddr((struct sockaddr *)msg.msg_name); - } else - error = recvmsg(td, &bsd_args); +#if defined(__amd64__) && defined(COMPAT_LINUX32) + error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, + &iov, EMSGSIZE); +#else + error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); +#endif if (error) return (error); - if (bsd_args.msg->msg_control != NULL && - bsd_args.msg->msg_controllen > 0) { - cmsg = (struct cmsghdr*)bsd_args.msg->msg_control; - cmsg->cmsg_level = bsd_to_linux_sockopt_level(cmsg->cmsg_level); + if (msg.msg_name) { + error = linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name, + msg.msg_namelen); + if (error) + goto bad; } - error = copyin(PTRIN(args->msg), &msg, sizeof(msg)); + uiov = msg.msg_iov; + msg.msg_iov = iov; + controlp = (msg.msg_control != NULL) ? &control : NULL; + error = kern_recvit(td, args->s, &msg, UIO_USERSPACE, controlp); + msg.msg_iov = uiov; if (error) - return (error); - if (msg.msg_name && msg.msg_namelen > 2) - error = linux_sa_put(msg.msg_name); + goto bad; + + error = bsd_to_linux_msghdr(&msg, &linux_msg); + if (error) + goto bad; + + if (linux_msg.msg_name) { + error = bsd_to_linux_sockaddr((struct sockaddr *) + PTRIN(linux_msg.msg_name)); + if (error) + goto bad; + } + if (linux_msg.msg_name && linux_msg.msg_namelen > 2) { + error = linux_sa_put(PTRIN(linux_msg.msg_name)); + if (error) + goto bad; + } + + if (control) { + caddr_t outbuf; + struct cmsghdr *cm; + socklen_t datalen, outlen; + socklen_t clen; + void *data; + struct sockcred *scred; + struct l_ucred lcred; + + linux_cmsg = malloc(L_CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); + outbuf = PTRIN(linux_msg.msg_control); + cm = mtod(control, struct cmsghdr *); + outlen = 0; + clen = control->m_len; + + while (cm != NULL) { + + switch (cm->cmsg_type) { + case SCM_CREDS: + + scred = (struct sockcred *)CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len - + (caddr_t)scred; + + if (outlen + LINUX_CMSG_LEN(sizeof(lcred)) > + linux_msg.msg_controllen) { + linux_msg.msg_flags |= LINUX_MSG_CTRUNC; + goto out; + } + + lcred.pid = -1; + lcred.uid = scred->sc_uid; + lcred.gid = scred->sc_gid; + + linux_cmsg->cmsg_len = + LINUX_CMSG_LEN(sizeof(lcred)); + linux_cmsg->cmsg_type = + bsd_to_linux_cmsg_type(cm->cmsg_type); + linux_cmsg->cmsg_level = + bsd_to_linux_sockopt_level(cm->cmsg_level); + + error = copyout(linux_cmsg, outbuf, L_CMSG_HDRSZ); + if (error) + goto bad; + outbuf += L_CMSG_HDRSZ; + + error = copyout(&lcred, outbuf, sizeof(lcred)); + if (error) + goto bad; + + outbuf += LINUX_CMSG_ALIGN(sizeof(lcred)); + outlen += LINUX_CMSG_LEN(sizeof(lcred)); + linux_msg.msg_controllen = outlen; + break; + + default: + + data = CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; + + if (outlen + LINUX_CMSG_LEN(datalen) > + linux_msg.msg_controllen) { + linux_msg.msg_flags |= LINUX_MSG_CTRUNC; + goto out; + } + + linux_cmsg->cmsg_len = LINUX_CMSG_LEN(datalen); + linux_cmsg->cmsg_type = + bsd_to_linux_cmsg_type(cm->cmsg_type); + linux_cmsg->cmsg_level = + bsd_to_linux_sockopt_level(cm->cmsg_level); + + error = copyout(linux_cmsg, outbuf, L_CMSG_HDRSZ); + if (error) + goto bad; + outbuf += L_CMSG_HDRSZ; + + error = copyout(data, outbuf, datalen); + if (error) + goto bad; + + outbuf += LINUX_CMSG_ALIGN(datalen); + outlen += LINUX_CMSG_LEN(datalen); + linux_msg.msg_controllen = outlen; + break; + } + + if (CMSG_SPACE(datalen) < clen) { + clen -= CMSG_SPACE(datalen); + cm = (struct cmsghdr *) + ((caddr_t)cm + CMSG_SPACE(datalen)); + } else + cm = NULL; + } + } + +out: + error = copyout(&linux_msg, PTRIN(args->msg), sizeof(linux_msg)); + +bad: + free(iov, M_IOV); + if (control != NULL) + m_freem(control); + if (linux_cmsg != NULL) + free(linux_cmsg, M_TEMP); + return (error); } @@ -1081,6 +1303,12 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) switch (bsd_args.level) { case SOL_SOCKET: name = linux_to_bsd_so_sockopt(args->optname); + switch (args->optname) { + case LINUX_SO_PASSCRED: + /* FreeBSD bug? socket level opts at non socket level */ + bsd_args.level = 0; + break; + } break; case IPPROTO_IP: name = linux_to_bsd_ip_sockopt(args->optname); @@ -1136,6 +1364,11 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) switch (bsd_args.level) { case SOL_SOCKET: name = linux_to_bsd_so_sockopt(args->optname); + switch (args->optname) { + case LINUX_SO_PASSCRED: + bsd_args.level = 0; + break; + } break; case IPPROTO_IP: name = linux_to_bsd_ip_sockopt(args->optname); diff --git a/src/sys/compat/linux/linux_socket.h b/src/sys/compat/linux/linux_socket.h index 074e8e0..e8c2ec8 100644 --- a/src/sys/compat/linux/linux_socket.h +++ b/src/sys/compat/linux/linux_socket.h @@ -49,4 +49,36 @@ #define LINUX_MSG_ERRQUEUE 0x2000 #define LINUX_MSG_NOSIGNAL 0x4000 +/* Socket-level control message types */ + +#define LINUX_SCM_RIGHTS 0x01 +#define LINUX_SCM_CREDENTIALS 0x02 + +/* Ancilliary data object information macros */ + +#define LINUX_CMSG_ALIGN(len) (((len) + sizeof(l_long)-1) & ~(sizeof(l_long)-1)) +#define LINUX_CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + \ + LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)))) +#define LINUX_CMSG_SPACE(len) (LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)) + \ + LINUX_CMSG_ALIGN(len)) +#define LINUX_CMSG_LEN(len) (LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)) + \ + (len)) +#define LINUX_CMSG_FIRSTHDR(msg) \ + ((msg)->msg_controllen >= \ + sizeof(struct l_cmsghdr) ? \ + (struct l_cmsghdr *)((msg)->msg_control) : \ + (struct l_cmsghdr *)(NULL)) +#define LINUX_CMSG_NXTHDR(msg, cmsg) \ + ((((char *)(cmsg) + \ + LINUX_CMSG_ALIGN((cmsg)->cmsg_len) + \ + sizeof(*(cmsg))) > \ + (((char *)(msg)->msg_control) + \ + (msg)->msg_controllen)) ? \ + (struct l_cmsghdr *) NULL : \ + (struct l_cmsghdr *)((char *)(cmsg) + \ + LINUX_CMSG_ALIGN((cmsg)->cmsg_len))) + +#define CMSG_HDRSZ CMSG_LEN(0) +#define L_CMSG_HDRSZ LINUX_CMSG_LEN(0) + #endif /* _LINUX_SOCKET_H_ */ diff --git a/src/sys/i386/linux/linux.h b/src/sys/i386/linux/linux.h index 1c3627d..28655fe 100644 --- a/src/sys/i386/linux/linux.h +++ b/src/sys/i386/linux/linux.h @@ -656,6 +656,7 @@ union l_semun { #define LINUX_SO_NO_CHECK 11 #define LINUX_SO_PRIORITY 12 #define LINUX_SO_LINGER 13 +#define LINUX_SO_PASSCRED 16 #define LINUX_SO_PEERCRED 17 #define LINUX_SO_RCVLOWAT 18 #define LINUX_SO_SNDLOWAT 19 @@ -680,6 +681,28 @@ struct l_sockaddr { char sa_data[14]; }; +struct l_msghdr { + l_uintptr_t msg_name; + l_int msg_namelen; + l_uintptr_t msg_iov; + l_size_t msg_iovlen; + l_uintptr_t msg_control; + l_size_t msg_controllen; + l_uint msg_flags; +}; + +struct l_cmsghdr { + l_size_t cmsg_len; + l_int cmsg_level; + l_int cmsg_type; +}; + +struct l_ucred { + uint32_t pid; + uint32_t uid; + uint32_t gid; +}; + struct l_ifmap { l_ulong mem_start; l_ulong mem_end; -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Wed Sep 17 19:02:49 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF38C106569A; Wed, 17 Sep 2008 19:02:49 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id DEB358FC0C; Wed, 17 Sep 2008 19:02:48 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 442AC1C7187; Wed, 17 Sep 2008 23:02:36 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1146221066; Wed, 17 Sep 2008 23:02:35 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.2/8.14.2) with ESMTP id m8HJ2Zcv002984; Wed, 17 Sep 2008 23:02:35 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.2/8.14.2/Submit) id m8HJ2UiT002983; Wed, 17 Sep 2008 23:02:30 +0400 (MSD) (envelope-from root) Date: Wed, 17 Sep 2008 23:02:30 +0400 From: Chagin Dmitry To: freebsd-emulation@freebsd.org, freebsd-net@freebsd.org Message-ID: <20080917190230.GA2947@dchagin.dialup.corbina.ru> Mail-Followup-To: freebsd-emulation@freebsd.org, freebsd-net@freebsd.org References: <20080822112927.GZ99951@hoeg.nl> <20080822112946.GA97526@freebsd.org> <20080831110610.GA2380@dchagin.dialup.corbina.ru> <20080902085623.GA12395@freebsd.org> <20080917183801.GA2714@dchagin.dialup.corbina.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080917183801.GA2714@dchagin.dialup.corbina.ru> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: [PATCH] recvmsg() sendmsg() linux emulation X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2008 19:02:49 -0000 On Wed, Sep 17, 2008 at 10:38:01PM +0400, Chagin Dmitry wrote: > > Please review, any comment will be helpful. > thnx! > ups... I have lost a new file, the previous patch is incorrect. sorry. diff --git a/src/sys/amd64/linux32/linux.h b/src/sys/amd64/linux32/linux.h index 8940289..9439900 100644 --- a/src/sys/amd64/linux32/linux.h +++ b/src/sys/amd64/linux32/linux.h @@ -685,6 +685,7 @@ union l_semun { #define LINUX_SO_NO_CHECK 11 #define LINUX_SO_PRIORITY 12 #define LINUX_SO_LINGER 13 +#define LINUX_SO_PASSCRED 16 #define LINUX_SO_PEERCRED 17 #define LINUX_SO_RCVLOWAT 18 #define LINUX_SO_SNDLOWAT 19 @@ -709,6 +710,28 @@ struct l_sockaddr { char sa_data[14]; } __packed; +struct l_msghdr { + l_uintptr_t msg_name; + l_int msg_namelen; + l_uintptr_t msg_iov; + l_size_t msg_iovlen; + l_uintptr_t msg_control; + l_size_t msg_controllen; + l_uint msg_flags; +} __packed; + +struct l_cmsghdr { + l_size_t cmsg_len; + l_int cmsg_level; + l_int cmsg_type; +} __packed; + +struct l_ucred { + uint32_t pid; + uint32_t uid; + uint32_t gid; +} __packed; + struct l_ifmap { l_ulong mem_start; l_ulong mem_end; diff --git a/src/sys/amd64/linux32/linux32_io.h b/src/sys/amd64/linux32/linux32_io.h new file mode 100644 index 0000000..c1a9f1c --- /dev/null +++ b/src/sys/amd64/linux32/linux32_io.h @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2004 Tim J. Robbins + * Copyright (c) 2001 Doug Rabson + * Copyright (c) 1994-1996 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _AMD64_LINUX32_IO_H_ +#define _AMD64_LINUX32_IO_H_ + + +struct iovec32 { + u_int32_t iov_base; + int iov_len; +}; + +CTASSERT(sizeof(struct iovec32) == 8); + +int linux32_copyiniov(struct iovec32 *iovp32, u_int iovcnt, struct iovec **iovp, + int error); + +#endif /* !_AMD64_LINUX32_IO_H_ */ diff --git a/src/sys/amd64/linux32/linux32_machdep.c b/src/sys/amd64/linux32/linux32_machdep.c index 32cbe0b..26459c9 100644 --- a/src/sys/amd64/linux32/linux32_machdep.c +++ b/src/sys/amd64/linux32/linux32_machdep.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.49 2008/09/08 09 #include #include +#include #include #include #include @@ -232,13 +233,6 @@ linux_execve(struct thread *td, struct linux_execve_args *args) return (error); } -struct iovec32 { - u_int32_t iov_base; - int iov_len; -}; - -CTASSERT(sizeof(struct iovec32) == 8); - static int linux32_copyinuio(struct iovec32 *iovp, u_int iovcnt, struct uio **uiop) { @@ -281,6 +275,34 @@ linux32_copyinuio(struct iovec32 *iovp, u_int iovcnt, struct uio **uiop) } int +linux32_copyiniov(struct iovec32 *iovp32, u_int iovcnt, struct iovec **iovp, + int error) +{ + struct iovec32 iov32; + struct iovec *iov; + u_int iovlen; + int i; + + *iovp = NULL; + if (iovcnt > UIO_MAXIOV) + return (error); + iovlen = iovcnt * sizeof(struct iovec); + iov = malloc(iovlen, M_IOV, M_WAITOK); + for (i = 0; i < iovcnt; i++) { + error = copyin(&iovp32[i], &iov32, sizeof(struct iovec32)); + if (error) { + free(iov, M_IOV); + return (error); + } + iov[i].iov_base = PTRIN(iov32.iov_base); + iov[i].iov_len = iov32.iov_len; + } + *iovp = iov; + return(0); + +} + +int linux_readv(struct thread *td, struct linux_readv_args *uap) { struct uio *auio; diff --git a/src/sys/compat/linux/linux_socket.c b/src/sys/compat/linux/linux_socket.c index f97aa23..34e25dc 100644 --- a/src/sys/compat/linux/linux_socket.c +++ b/src/sys/compat/linux/linux_socket.c @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.76 2008/09/09 13:01: #ifdef COMPAT_LINUX32 #include +#include #include #else #include @@ -294,6 +295,8 @@ linux_to_bsd_so_sockopt(int opt) return (SO_OOBINLINE); case LINUX_SO_LINGER: return (SO_LINGER); + case LINUX_SO_PASSCRED: + return (LOCAL_CREDS); case LINUX_SO_PEERCRED: return (LOCAL_PEERCRED); case LINUX_SO_RCVLOWAT: @@ -421,6 +424,63 @@ linux_sa_put(struct osockaddr *osa) } static int +linux_to_bsd_cmsg_type(int cmsg_type) +{ + + switch (cmsg_type) { + case LINUX_SCM_RIGHTS: + return (SCM_RIGHTS); + case LINUX_SCM_CREDENTIALS: + return (SCM_CREDS); + } + return (cmsg_type); +} + +static int +bsd_to_linux_cmsg_type(int cmsg_type) +{ + + switch (cmsg_type) { + case SCM_RIGHTS: + return (LINUX_SCM_RIGHTS); + case SCM_CREDS: + return (LINUX_SCM_CREDENTIALS); + } + return (cmsg_type); +} + + + +static int +linux_to_bsd_msghdr(struct msghdr *bhdr, const struct l_msghdr *lhdr) +{ + if (lhdr->msg_controllen > INT_MAX) + return (ENOBUFS); + + bhdr->msg_name = PTRIN(lhdr->msg_name); + bhdr->msg_namelen = lhdr->msg_namelen; + bhdr->msg_iov = PTRIN(lhdr->msg_iov); + bhdr->msg_iovlen = lhdr->msg_iovlen; + bhdr->msg_control = PTRIN(lhdr->msg_control); + bhdr->msg_controllen = lhdr->msg_controllen; + bhdr->msg_flags = linux_to_bsd_msg_flags(lhdr->msg_flags); + return (0); +} + +static int +bsd_to_linux_msghdr(const struct msghdr *bhdr, struct l_msghdr *lhdr) +{ + lhdr->msg_name = PTROUT(bhdr->msg_name); + lhdr->msg_namelen = bhdr->msg_namelen; + lhdr->msg_iov = PTROUT(bhdr->msg_iov); + lhdr->msg_iovlen = bhdr->msg_iovlen; + lhdr->msg_control = PTROUT(bhdr->msg_control); + lhdr->msg_controllen = bhdr->msg_controllen; + /* msg_flags skipped */ + return (0); +} + +static int linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, enum uio_seg segflg) { @@ -437,25 +497,57 @@ linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, to = NULL; if (mp->msg_control != NULL) { + struct l_cmsghdr *ptr_cmsg; + struct l_cmsghdr linux_cmsg; struct cmsghdr *cmsg; - - if (mp->msg_controllen < sizeof(struct cmsghdr)) { - error = EINVAL; - goto bad; - } - error = sockargs(&control, mp->msg_control, - mp->msg_controllen, MT_CONTROL); - if (error) - goto bad; - - cmsg = mtod(control, struct cmsghdr *); - cmsg->cmsg_level = linux_to_bsd_sockopt_level(cmsg->cmsg_level); + void *data; + socklen_t datalen; + + cmsg = malloc(CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); + control = m_get(M_WAIT, MT_CONTROL); + ptr_cmsg = LINUX_CMSG_FIRSTHDR(mp); + + do { + error = copyin(ptr_cmsg, &linux_cmsg, + sizeof(struct l_cmsghdr)); + if (error) + goto bad; + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > INT_MAX) { + error = EINVAL; + goto bad; + } + + switch (linux_cmsg.cmsg_type) { + case LINUX_SCM_RIGHTS: + cmsg->cmsg_type = + linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); + break; + default: + error = EINVAL; + goto bad; + } + cmsg->cmsg_level = + linux_to_bsd_sockopt_level(linux_cmsg.cmsg_level); + + datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + cmsg->cmsg_len = CMSG_LEN(datalen); + data = LINUX_CMSG_DATA(ptr_cmsg); + + error = ENOBUFS; + if (!m_append(control, CMSG_HDRSZ, (c_caddr_t) cmsg)) + goto bad; + if (!m_append(control, datalen, (c_caddr_t) data)) + goto bad; + + } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(mp, ptr_cmsg))); + + free(cmsg, M_TEMP); } else control = NULL; error = kern_sendit(td, s, mp, linux_to_bsd_msg_flags(flags), control, segflg); - bad: if (to) FREE(to, M_SONAME); @@ -960,12 +1052,14 @@ static int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) { struct msghdr msg; + struct l_msghdr linux_msg; struct iovec *iov; int error; - /* XXXTJR sendmsg is broken on amd64 */ - - error = copyin(PTRIN(args->msg), &msg, sizeof(msg)); + error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); + if (error) + return (error); + error = linux_to_bsd_msghdr(&msg, &linux_msg); if (error) return (error); @@ -978,9 +1072,13 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) */ if (msg.msg_control != NULL && msg.msg_controllen == 0) msg.msg_control = NULL; + +#if defined(__amd64__) && defined(COMPAT_LINUX32) + error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, + &iov, EMSGSIZE); +#else error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); - if (error) - return (error); +#endif msg.msg_iov = iov; msg.msg_flags = 0; error = linux_sendit(td, args->s, &msg, args->flags, UIO_USERSPACE); @@ -997,44 +1095,168 @@ struct linux_recvmsg_args { static int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) { - struct recvmsg_args /* { - int s; - struct msghdr *msg; - int flags; - } */ bsd_args; struct msghdr msg; - struct cmsghdr *cmsg; + struct l_msghdr linux_msg; + struct l_cmsghdr *linux_cmsg = NULL; + struct iovec *iov, *uiov; + struct mbuf *control = NULL; + struct mbuf **controlp; int error; - /* XXXTJR recvmsg is broken on amd64 */ + error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); + if (error) + return (error); - if ((error = copyin(PTRIN(args->msg), &msg, sizeof (msg)))) + error = linux_to_bsd_msghdr(&msg, &linux_msg); + if (error) return (error); - bsd_args.s = args->s; - bsd_args.msg = PTRIN(args->msg); - bsd_args.flags = linux_to_bsd_msg_flags(args->flags); - if (msg.msg_name) { - linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name, - msg.msg_namelen); - error = recvmsg(td, &bsd_args); - bsd_to_linux_sockaddr((struct sockaddr *)msg.msg_name); - } else - error = recvmsg(td, &bsd_args); +#if defined(__amd64__) && defined(COMPAT_LINUX32) + error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, + &iov, EMSGSIZE); +#else + error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); +#endif if (error) return (error); - if (bsd_args.msg->msg_control != NULL && - bsd_args.msg->msg_controllen > 0) { - cmsg = (struct cmsghdr*)bsd_args.msg->msg_control; - cmsg->cmsg_level = bsd_to_linux_sockopt_level(cmsg->cmsg_level); + if (msg.msg_name) { + error = linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name, + msg.msg_namelen); + if (error) + goto bad; } - error = copyin(PTRIN(args->msg), &msg, sizeof(msg)); + uiov = msg.msg_iov; + msg.msg_iov = iov; + controlp = (msg.msg_control != NULL) ? &control : NULL; + error = kern_recvit(td, args->s, &msg, UIO_USERSPACE, controlp); + msg.msg_iov = uiov; if (error) - return (error); - if (msg.msg_name && msg.msg_namelen > 2) - error = linux_sa_put(msg.msg_name); + goto bad; + + error = bsd_to_linux_msghdr(&msg, &linux_msg); + if (error) + goto bad; + + if (linux_msg.msg_name) { + error = bsd_to_linux_sockaddr((struct sockaddr *) + PTRIN(linux_msg.msg_name)); + if (error) + goto bad; + } + if (linux_msg.msg_name && linux_msg.msg_namelen > 2) { + error = linux_sa_put(PTRIN(linux_msg.msg_name)); + if (error) + goto bad; + } + + if (control) { + caddr_t outbuf; + struct cmsghdr *cm; + socklen_t datalen, outlen; + socklen_t clen; + void *data; + struct sockcred *scred; + struct l_ucred lcred; + + linux_cmsg = malloc(L_CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); + outbuf = PTRIN(linux_msg.msg_control); + cm = mtod(control, struct cmsghdr *); + outlen = 0; + clen = control->m_len; + + while (cm != NULL) { + + switch (cm->cmsg_type) { + case SCM_CREDS: + + scred = (struct sockcred *)CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len - + (caddr_t)scred; + + if (outlen + LINUX_CMSG_LEN(sizeof(lcred)) > + linux_msg.msg_controllen) { + linux_msg.msg_flags |= LINUX_MSG_CTRUNC; + goto out; + } + + lcred.pid = -1; + lcred.uid = scred->sc_uid; + lcred.gid = scred->sc_gid; + + linux_cmsg->cmsg_len = + LINUX_CMSG_LEN(sizeof(lcred)); + linux_cmsg->cmsg_type = + bsd_to_linux_cmsg_type(cm->cmsg_type); + linux_cmsg->cmsg_level = + bsd_to_linux_sockopt_level(cm->cmsg_level); + + error = copyout(linux_cmsg, outbuf, L_CMSG_HDRSZ); + if (error) + goto bad; + outbuf += L_CMSG_HDRSZ; + + error = copyout(&lcred, outbuf, sizeof(lcred)); + if (error) + goto bad; + + outbuf += LINUX_CMSG_ALIGN(sizeof(lcred)); + outlen += LINUX_CMSG_LEN(sizeof(lcred)); + linux_msg.msg_controllen = outlen; + break; + + default: + + data = CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; + + if (outlen + LINUX_CMSG_LEN(datalen) > + linux_msg.msg_controllen) { + linux_msg.msg_flags |= LINUX_MSG_CTRUNC; + goto out; + } + + linux_cmsg->cmsg_len = LINUX_CMSG_LEN(datalen); + linux_cmsg->cmsg_type = + bsd_to_linux_cmsg_type(cm->cmsg_type); + linux_cmsg->cmsg_level = + bsd_to_linux_sockopt_level(cm->cmsg_level); + + error = copyout(linux_cmsg, outbuf, L_CMSG_HDRSZ); + if (error) + goto bad; + outbuf += L_CMSG_HDRSZ; + + error = copyout(data, outbuf, datalen); + if (error) + goto bad; + + outbuf += LINUX_CMSG_ALIGN(datalen); + outlen += LINUX_CMSG_LEN(datalen); + linux_msg.msg_controllen = outlen; + break; + } + + if (CMSG_SPACE(datalen) < clen) { + clen -= CMSG_SPACE(datalen); + cm = (struct cmsghdr *) + ((caddr_t)cm + CMSG_SPACE(datalen)); + } else + cm = NULL; + } + } + +out: + error = copyout(&linux_msg, PTRIN(args->msg), sizeof(linux_msg)); + +bad: + free(iov, M_IOV); + if (control != NULL) + m_freem(control); + if (linux_cmsg != NULL) + free(linux_cmsg, M_TEMP); + return (error); } @@ -1081,6 +1303,12 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) switch (bsd_args.level) { case SOL_SOCKET: name = linux_to_bsd_so_sockopt(args->optname); + switch (args->optname) { + case LINUX_SO_PASSCRED: + /* FreeBSD bug? socket level opts at non socket level */ + bsd_args.level = 0; + break; + } break; case IPPROTO_IP: name = linux_to_bsd_ip_sockopt(args->optname); @@ -1136,6 +1364,11 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) switch (bsd_args.level) { case SOL_SOCKET: name = linux_to_bsd_so_sockopt(args->optname); + switch (args->optname) { + case LINUX_SO_PASSCRED: + bsd_args.level = 0; + break; + } break; case IPPROTO_IP: name = linux_to_bsd_ip_sockopt(args->optname); diff --git a/src/sys/compat/linux/linux_socket.h b/src/sys/compat/linux/linux_socket.h index 074e8e0..e8c2ec8 100644 --- a/src/sys/compat/linux/linux_socket.h +++ b/src/sys/compat/linux/linux_socket.h @@ -49,4 +49,36 @@ #define LINUX_MSG_ERRQUEUE 0x2000 #define LINUX_MSG_NOSIGNAL 0x4000 +/* Socket-level control message types */ + +#define LINUX_SCM_RIGHTS 0x01 +#define LINUX_SCM_CREDENTIALS 0x02 + +/* Ancilliary data object information macros */ + +#define LINUX_CMSG_ALIGN(len) (((len) + sizeof(l_long)-1) & ~(sizeof(l_long)-1)) +#define LINUX_CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + \ + LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)))) +#define LINUX_CMSG_SPACE(len) (LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)) + \ + LINUX_CMSG_ALIGN(len)) +#define LINUX_CMSG_LEN(len) (LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)) + \ + (len)) +#define LINUX_CMSG_FIRSTHDR(msg) \ + ((msg)->msg_controllen >= \ + sizeof(struct l_cmsghdr) ? \ + (struct l_cmsghdr *)((msg)->msg_control) : \ + (struct l_cmsghdr *)(NULL)) +#define LINUX_CMSG_NXTHDR(msg, cmsg) \ + ((((char *)(cmsg) + \ + LINUX_CMSG_ALIGN((cmsg)->cmsg_len) + \ + sizeof(*(cmsg))) > \ + (((char *)(msg)->msg_control) + \ + (msg)->msg_controllen)) ? \ + (struct l_cmsghdr *) NULL : \ + (struct l_cmsghdr *)((char *)(cmsg) + \ + LINUX_CMSG_ALIGN((cmsg)->cmsg_len))) + +#define CMSG_HDRSZ CMSG_LEN(0) +#define L_CMSG_HDRSZ LINUX_CMSG_LEN(0) + #endif /* _LINUX_SOCKET_H_ */ diff --git a/src/sys/i386/linux/linux.h b/src/sys/i386/linux/linux.h index 1c3627d..28655fe 100644 --- a/src/sys/i386/linux/linux.h +++ b/src/sys/i386/linux/linux.h @@ -656,6 +656,7 @@ union l_semun { #define LINUX_SO_NO_CHECK 11 #define LINUX_SO_PRIORITY 12 #define LINUX_SO_LINGER 13 +#define LINUX_SO_PASSCRED 16 #define LINUX_SO_PEERCRED 17 #define LINUX_SO_RCVLOWAT 18 #define LINUX_SO_SNDLOWAT 19 @@ -680,6 +681,28 @@ struct l_sockaddr { char sa_data[14]; }; +struct l_msghdr { + l_uintptr_t msg_name; + l_int msg_namelen; + l_uintptr_t msg_iov; + l_size_t msg_iovlen; + l_uintptr_t msg_control; + l_size_t msg_controllen; + l_uint msg_flags; +}; + +struct l_cmsghdr { + l_size_t cmsg_len; + l_int cmsg_level; + l_int cmsg_type; +}; + +struct l_ucred { + uint32_t pid; + uint32_t uid; + uint32_t gid; +}; + struct l_ifmap { l_ulong mem_start; l_ulong mem_end; -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Thu Sep 18 07:38:40 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 248E5106564A; Thu, 18 Sep 2008 07:38:40 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id BEEEC8FC0A; Thu, 18 Sep 2008 07:38:39 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p5DC5F32C.dip.t-dialin.net [93.197.243.44]) by redbull.bpaserver.net (Postfix) with ESMTP id 9EA322E1F9; Thu, 18 Sep 2008 09:38:34 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 101AF155369; Thu, 18 Sep 2008 09:38:32 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.14.2/8.13.8/Submit) id m8I7cVhC026284; Thu, 18 Sep 2008 09:38:31 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 18 Sep 2008 09:38:31 +0200 Message-ID: <20080918093831.89545e2iu5zjgjgg@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Thu, 18 Sep 2008 09:38:31 +0200 From: "Alexander Leidinger" To: "Chagin Dmitry" References: <20080822112927.GZ99951@hoeg.nl> <20080822112946.GA97526@freebsd.org> <20080831110610.GA2380@dchagin.dialup.corbina.ru> <20080902085623.GA12395@freebsd.org> <20080917183801.GA2714@dchagin.dialup.corbina.ru> <20080917190230.GA2947@dchagin.dialup.corbina.ru> In-Reply-To: <20080917190230.GA2947@dchagin.dialup.corbina.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.2) / FreeBSD-8.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: 9EA322E1F9.2187C X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-14.7, required 6, BAYES_00 -15.00, MR_NOT_ATTRIBUTED_IP 0.20, RDNS_DYNAMIC 0.10) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: freebsd-net@freebsd.org, freebsd-emulation@freebsd.org Subject: Re: [PATCH] recvmsg() sendmsg() linux emulation X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 07:38:40 -0000 Quoting "Chagin Dmitry" (from Wed, 17 Sep 2008 =20 23:02:30 +0400): > On Wed, Sep 17, 2008 at 10:38:01PM +0400, Chagin Dmitry wrote: >> >> Please review, any comment will be helpful. I did just a very quick look... > @@ -978,9 +1072,13 @@ linux_sendmsg(struct thread *td, struct =20 > linux_sendmsg_args *args) > =09 */ > =09if (msg.msg_control !=3D NULL && msg.msg_controllen =3D=3D 0) > =09=09msg.msg_control =3D NULL; > + > +#if defined(__amd64__) && defined(COMPAT_LINUX32) > +=09error =3D linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, > +=09 &iov, EMSGSIZE); > +#else > =09error =3D copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); > -=09if (error) > -=09=09return (error); > +#endif > =09msg.msg_iov =3D iov; > =09msg.msg_flags =3D 0; > =09error =3D linux_sendit(td, args->s, &msg, args->flags, UIO_USERSPACE); You've lost the error handling in the conditional. Bye, Alexander. --=20 BOFH excuse #266: All of the packets are empty http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137 From owner-freebsd-emulation@FreeBSD.ORG Thu Sep 18 13:57:45 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DEA21065673; Thu, 18 Sep 2008 13:57:45 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 744498FC1C; Thu, 18 Sep 2008 13:57:44 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 566E91C8D7D; Thu, 18 Sep 2008 17:57:42 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1151971826; Thu, 18 Sep 2008 17:57:41 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.3/8.14.2) with ESMTP id m8IDvfcF002234; Thu, 18 Sep 2008 17:57:41 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.3/8.14.2/Submit) id m8IDvarD002233; Thu, 18 Sep 2008 17:57:36 +0400 (MSD) (envelope-from root) Date: Thu, 18 Sep 2008 17:57:36 +0400 From: Chagin Dmitry To: Alexander Leidinger Message-ID: <20080918135736.GA2218@dchagin.dialup.corbina.ru> Mail-Followup-To: Alexander Leidinger , freebsd-emulation@freebsd.org, freebsd-net@freebsd.org References: <20080822112927.GZ99951@hoeg.nl> <20080822112946.GA97526@freebsd.org> <20080831110610.GA2380@dchagin.dialup.corbina.ru> <20080902085623.GA12395@freebsd.org> <20080917183801.GA2714@dchagin.dialup.corbina.ru> <20080917190230.GA2947@dchagin.dialup.corbina.ru> <20080918093831.89545e2iu5zjgjgg@webmail.leidinger.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080918093831.89545e2iu5zjgjgg@webmail.leidinger.net> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org, freebsd-emulation@freebsd.org Subject: Re: [PATCH] recvmsg() sendmsg() linux emulation X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 13:57:45 -0000 On Thu, Sep 18, 2008 at 09:38:31AM +0200, Alexander Leidinger wrote: > Quoting "Chagin Dmitry" (from Wed, 17 Sep 2008 > 23:02:30 +0400): > > >On Wed, Sep 17, 2008 at 10:38:01PM +0400, Chagin Dmitry wrote: > >> > >>Please review, any comment will be helpful. > > I did just a very quick look... > > >@@ -978,9 +1072,13 @@ linux_sendmsg(struct thread *td, struct > >linux_sendmsg_args *args) > > */ > > if (msg.msg_control != NULL && msg.msg_controllen == 0) > > msg.msg_control = NULL; > >+ > >+#if defined(__amd64__) && defined(COMPAT_LINUX32) > >+ error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, > >+ &iov, EMSGSIZE); > >+#else > > error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); > >- if (error) > >- return (error); > >+#endif > > msg.msg_iov = iov; > > msg.msg_flags = 0; > > error = linux_sendit(td, args->s, &msg, args->flags, UIO_USERSPACE); > > You've lost the error handling in the conditional. > It's accepted, thnx! diff --git a/src/sys/amd64/linux32/linux.h b/src/sys/amd64/linux32/linux.h index 8940289..9439900 100644 --- a/src/sys/amd64/linux32/linux.h +++ b/src/sys/amd64/linux32/linux.h @@ -685,6 +685,7 @@ union l_semun { #define LINUX_SO_NO_CHECK 11 #define LINUX_SO_PRIORITY 12 #define LINUX_SO_LINGER 13 +#define LINUX_SO_PASSCRED 16 #define LINUX_SO_PEERCRED 17 #define LINUX_SO_RCVLOWAT 18 #define LINUX_SO_SNDLOWAT 19 @@ -709,6 +710,28 @@ struct l_sockaddr { char sa_data[14]; } __packed; +struct l_msghdr { + l_uintptr_t msg_name; + l_int msg_namelen; + l_uintptr_t msg_iov; + l_size_t msg_iovlen; + l_uintptr_t msg_control; + l_size_t msg_controllen; + l_uint msg_flags; +} __packed; + +struct l_cmsghdr { + l_size_t cmsg_len; + l_int cmsg_level; + l_int cmsg_type; +} __packed; + +struct l_ucred { + uint32_t pid; + uint32_t uid; + uint32_t gid; +} __packed; + struct l_ifmap { l_ulong mem_start; l_ulong mem_end; diff --git a/src/sys/amd64/linux32/linux32_io.h b/src/sys/amd64/linux32/linux32_io.h new file mode 100644 index 0000000..c1a9f1c --- /dev/null +++ b/src/sys/amd64/linux32/linux32_io.h @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2004 Tim J. Robbins + * Copyright (c) 2001 Doug Rabson + * Copyright (c) 1994-1996 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _AMD64_LINUX32_IO_H_ +#define _AMD64_LINUX32_IO_H_ + + +struct iovec32 { + u_int32_t iov_base; + int iov_len; +}; + +CTASSERT(sizeof(struct iovec32) == 8); + +int linux32_copyiniov(struct iovec32 *iovp32, u_int iovcnt, struct iovec **iovp, + int error); + +#endif /* !_AMD64_LINUX32_IO_H_ */ diff --git a/src/sys/amd64/linux32/linux32_machdep.c b/src/sys/amd64/linux32/linux32_machdep.c index 32cbe0b..26459c9 100644 --- a/src/sys/amd64/linux32/linux32_machdep.c +++ b/src/sys/amd64/linux32/linux32_machdep.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.49 2008/09/08 09 #include #include +#include #include #include #include @@ -232,13 +233,6 @@ linux_execve(struct thread *td, struct linux_execve_args *args) return (error); } -struct iovec32 { - u_int32_t iov_base; - int iov_len; -}; - -CTASSERT(sizeof(struct iovec32) == 8); - static int linux32_copyinuio(struct iovec32 *iovp, u_int iovcnt, struct uio **uiop) { @@ -281,6 +275,34 @@ linux32_copyinuio(struct iovec32 *iovp, u_int iovcnt, struct uio **uiop) } int +linux32_copyiniov(struct iovec32 *iovp32, u_int iovcnt, struct iovec **iovp, + int error) +{ + struct iovec32 iov32; + struct iovec *iov; + u_int iovlen; + int i; + + *iovp = NULL; + if (iovcnt > UIO_MAXIOV) + return (error); + iovlen = iovcnt * sizeof(struct iovec); + iov = malloc(iovlen, M_IOV, M_WAITOK); + for (i = 0; i < iovcnt; i++) { + error = copyin(&iovp32[i], &iov32, sizeof(struct iovec32)); + if (error) { + free(iov, M_IOV); + return (error); + } + iov[i].iov_base = PTRIN(iov32.iov_base); + iov[i].iov_len = iov32.iov_len; + } + *iovp = iov; + return(0); + +} + +int linux_readv(struct thread *td, struct linux_readv_args *uap) { struct uio *auio; diff --git a/src/sys/compat/linux/linux_socket.c b/src/sys/compat/linux/linux_socket.c index f97aa23..634389d 100644 --- a/src/sys/compat/linux/linux_socket.c +++ b/src/sys/compat/linux/linux_socket.c @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.76 2008/09/09 13:01: #ifdef COMPAT_LINUX32 #include +#include #include #else #include @@ -294,6 +295,8 @@ linux_to_bsd_so_sockopt(int opt) return (SO_OOBINLINE); case LINUX_SO_LINGER: return (SO_LINGER); + case LINUX_SO_PASSCRED: + return (LOCAL_CREDS); case LINUX_SO_PEERCRED: return (LOCAL_PEERCRED); case LINUX_SO_RCVLOWAT: @@ -414,9 +417,64 @@ linux_sa_put(struct osockaddr *osa) sa.sa_family = bdom; error = copyout(&sa, osa, sizeof(sa.sa_family)); - if (error) - return (error); + return (error); +} + +static int +linux_to_bsd_cmsg_type(int cmsg_type) +{ + + switch (cmsg_type) { + case LINUX_SCM_RIGHTS: + return (SCM_RIGHTS); + case LINUX_SCM_CREDENTIALS: + return (SCM_CREDS); + } + return (cmsg_type); +} + +static int +bsd_to_linux_cmsg_type(int cmsg_type) +{ + + switch (cmsg_type) { + case SCM_RIGHTS: + return (LINUX_SCM_RIGHTS); + case SCM_CREDS: + return (LINUX_SCM_CREDENTIALS); + } + return (cmsg_type); +} + + + +static int +linux_to_bsd_msghdr(struct msghdr *bhdr, const struct l_msghdr *lhdr) +{ + if (lhdr->msg_controllen > INT_MAX) + return (ENOBUFS); + + bhdr->msg_name = PTRIN(lhdr->msg_name); + bhdr->msg_namelen = lhdr->msg_namelen; + bhdr->msg_iov = PTRIN(lhdr->msg_iov); + bhdr->msg_iovlen = lhdr->msg_iovlen; + bhdr->msg_control = PTRIN(lhdr->msg_control); + bhdr->msg_controllen = lhdr->msg_controllen; + bhdr->msg_flags = linux_to_bsd_msg_flags(lhdr->msg_flags); + return (0); +} + +static int +bsd_to_linux_msghdr(const struct msghdr *bhdr, struct l_msghdr *lhdr) +{ + lhdr->msg_name = PTROUT(bhdr->msg_name); + lhdr->msg_namelen = bhdr->msg_namelen; + lhdr->msg_iov = PTROUT(bhdr->msg_iov); + lhdr->msg_iovlen = bhdr->msg_iovlen; + lhdr->msg_control = PTROUT(bhdr->msg_control); + lhdr->msg_controllen = bhdr->msg_controllen; + /* msg_flags skipped */ return (0); } @@ -437,25 +495,57 @@ linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, to = NULL; if (mp->msg_control != NULL) { + struct l_cmsghdr *ptr_cmsg; + struct l_cmsghdr linux_cmsg; struct cmsghdr *cmsg; - - if (mp->msg_controllen < sizeof(struct cmsghdr)) { - error = EINVAL; - goto bad; - } - error = sockargs(&control, mp->msg_control, - mp->msg_controllen, MT_CONTROL); - if (error) - goto bad; - - cmsg = mtod(control, struct cmsghdr *); - cmsg->cmsg_level = linux_to_bsd_sockopt_level(cmsg->cmsg_level); + void *data; + socklen_t datalen; + + cmsg = malloc(CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); + control = m_get(M_WAIT, MT_CONTROL); + ptr_cmsg = LINUX_CMSG_FIRSTHDR(mp); + + do { + error = copyin(ptr_cmsg, &linux_cmsg, + sizeof(struct l_cmsghdr)); + if (error) + goto bad; + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > INT_MAX) { + error = EINVAL; + goto bad; + } + + switch (linux_cmsg.cmsg_type) { + case LINUX_SCM_RIGHTS: + cmsg->cmsg_type = + linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); + break; + default: + error = EINVAL; + goto bad; + } + cmsg->cmsg_level = + linux_to_bsd_sockopt_level(linux_cmsg.cmsg_level); + + datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + cmsg->cmsg_len = CMSG_LEN(datalen); + data = LINUX_CMSG_DATA(ptr_cmsg); + + error = ENOBUFS; + if (!m_append(control, CMSG_HDRSZ, (c_caddr_t) cmsg)) + goto bad; + if (!m_append(control, datalen, (c_caddr_t) data)) + goto bad; + + } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(mp, ptr_cmsg))); + + free(cmsg, M_TEMP); } else control = NULL; error = kern_sendit(td, s, mp, linux_to_bsd_msg_flags(flags), control, segflg); - bad: if (to) FREE(to, M_SONAME); @@ -960,12 +1050,14 @@ static int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) { struct msghdr msg; + struct l_msghdr linux_msg; struct iovec *iov; int error; - /* XXXTJR sendmsg is broken on amd64 */ - - error = copyin(PTRIN(args->msg), &msg, sizeof(msg)); + error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); + if (error) + return (error); + error = linux_to_bsd_msghdr(&msg, &linux_msg); if (error) return (error); @@ -978,7 +1070,13 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) */ if (msg.msg_control != NULL && msg.msg_controllen == 0) msg.msg_control = NULL; + +#if defined(__amd64__) && defined(COMPAT_LINUX32) + error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, + &iov, EMSGSIZE); +#else error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); +#endif if (error) return (error); msg.msg_iov = iov; @@ -997,44 +1095,168 @@ struct linux_recvmsg_args { static int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) { - struct recvmsg_args /* { - int s; - struct msghdr *msg; - int flags; - } */ bsd_args; struct msghdr msg; - struct cmsghdr *cmsg; + struct l_msghdr linux_msg; + struct l_cmsghdr *linux_cmsg = NULL; + struct iovec *iov, *uiov; + struct mbuf *control = NULL; + struct mbuf **controlp; int error; - /* XXXTJR recvmsg is broken on amd64 */ + error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); + if (error) + return (error); - if ((error = copyin(PTRIN(args->msg), &msg, sizeof (msg)))) + error = linux_to_bsd_msghdr(&msg, &linux_msg); + if (error) return (error); - bsd_args.s = args->s; - bsd_args.msg = PTRIN(args->msg); - bsd_args.flags = linux_to_bsd_msg_flags(args->flags); - if (msg.msg_name) { - linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name, - msg.msg_namelen); - error = recvmsg(td, &bsd_args); - bsd_to_linux_sockaddr((struct sockaddr *)msg.msg_name); - } else - error = recvmsg(td, &bsd_args); +#if defined(__amd64__) && defined(COMPAT_LINUX32) + error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, + &iov, EMSGSIZE); +#else + error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); +#endif if (error) return (error); - if (bsd_args.msg->msg_control != NULL && - bsd_args.msg->msg_controllen > 0) { - cmsg = (struct cmsghdr*)bsd_args.msg->msg_control; - cmsg->cmsg_level = bsd_to_linux_sockopt_level(cmsg->cmsg_level); + if (msg.msg_name) { + error = linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name, + msg.msg_namelen); + if (error) + goto bad; } - error = copyin(PTRIN(args->msg), &msg, sizeof(msg)); + uiov = msg.msg_iov; + msg.msg_iov = iov; + controlp = (msg.msg_control != NULL) ? &control : NULL; + error = kern_recvit(td, args->s, &msg, UIO_USERSPACE, controlp); + msg.msg_iov = uiov; if (error) - return (error); - if (msg.msg_name && msg.msg_namelen > 2) - error = linux_sa_put(msg.msg_name); + goto bad; + + error = bsd_to_linux_msghdr(&msg, &linux_msg); + if (error) + goto bad; + + if (linux_msg.msg_name) { + error = bsd_to_linux_sockaddr((struct sockaddr *) + PTRIN(linux_msg.msg_name)); + if (error) + goto bad; + } + if (linux_msg.msg_name && linux_msg.msg_namelen > 2) { + error = linux_sa_put(PTRIN(linux_msg.msg_name)); + if (error) + goto bad; + } + + if (control) { + caddr_t outbuf; + struct cmsghdr *cm; + socklen_t datalen, outlen; + socklen_t clen; + void *data; + struct sockcred *scred; + struct l_ucred lcred; + + linux_cmsg = malloc(L_CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); + outbuf = PTRIN(linux_msg.msg_control); + cm = mtod(control, struct cmsghdr *); + outlen = 0; + clen = control->m_len; + + while (cm != NULL) { + + switch (cm->cmsg_type) { + case SCM_CREDS: + + scred = (struct sockcred *)CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len - + (caddr_t)scred; + + if (outlen + LINUX_CMSG_LEN(sizeof(lcred)) > + linux_msg.msg_controllen) { + linux_msg.msg_flags |= LINUX_MSG_CTRUNC; + goto out; + } + + lcred.pid = -1; + lcred.uid = scred->sc_uid; + lcred.gid = scred->sc_gid; + + linux_cmsg->cmsg_len = + LINUX_CMSG_LEN(sizeof(lcred)); + linux_cmsg->cmsg_type = + bsd_to_linux_cmsg_type(cm->cmsg_type); + linux_cmsg->cmsg_level = + bsd_to_linux_sockopt_level(cm->cmsg_level); + + error = copyout(linux_cmsg, outbuf, L_CMSG_HDRSZ); + if (error) + goto bad; + outbuf += L_CMSG_HDRSZ; + + error = copyout(&lcred, outbuf, sizeof(lcred)); + if (error) + goto bad; + + outbuf += LINUX_CMSG_ALIGN(sizeof(lcred)); + outlen += LINUX_CMSG_LEN(sizeof(lcred)); + linux_msg.msg_controllen = outlen; + break; + + default: + + data = CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; + + if (outlen + LINUX_CMSG_LEN(datalen) > + linux_msg.msg_controllen) { + linux_msg.msg_flags |= LINUX_MSG_CTRUNC; + goto out; + } + + linux_cmsg->cmsg_len = LINUX_CMSG_LEN(datalen); + linux_cmsg->cmsg_type = + bsd_to_linux_cmsg_type(cm->cmsg_type); + linux_cmsg->cmsg_level = + bsd_to_linux_sockopt_level(cm->cmsg_level); + + error = copyout(linux_cmsg, outbuf, L_CMSG_HDRSZ); + if (error) + goto bad; + outbuf += L_CMSG_HDRSZ; + + error = copyout(data, outbuf, datalen); + if (error) + goto bad; + + outbuf += LINUX_CMSG_ALIGN(datalen); + outlen += LINUX_CMSG_LEN(datalen); + linux_msg.msg_controllen = outlen; + break; + } + + if (CMSG_SPACE(datalen) < clen) { + clen -= CMSG_SPACE(datalen); + cm = (struct cmsghdr *) + ((caddr_t)cm + CMSG_SPACE(datalen)); + } else + cm = NULL; + } + } + +out: + error = copyout(&linux_msg, PTRIN(args->msg), sizeof(linux_msg)); + +bad: + free(iov, M_IOV); + if (control != NULL) + m_freem(control); + if (linux_cmsg != NULL) + free(linux_cmsg, M_TEMP); + return (error); } @@ -1081,6 +1303,12 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) switch (bsd_args.level) { case SOL_SOCKET: name = linux_to_bsd_so_sockopt(args->optname); + switch (args->optname) { + case LINUX_SO_PASSCRED: + /* FreeBSD bug? socket level opts at non socket level */ + bsd_args.level = 0; + break; + } break; case IPPROTO_IP: name = linux_to_bsd_ip_sockopt(args->optname); @@ -1136,6 +1364,11 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) switch (bsd_args.level) { case SOL_SOCKET: name = linux_to_bsd_so_sockopt(args->optname); + switch (args->optname) { + case LINUX_SO_PASSCRED: + bsd_args.level = 0; + break; + } break; case IPPROTO_IP: name = linux_to_bsd_ip_sockopt(args->optname); diff --git a/src/sys/compat/linux/linux_socket.h b/src/sys/compat/linux/linux_socket.h index 074e8e0..e8c2ec8 100644 --- a/src/sys/compat/linux/linux_socket.h +++ b/src/sys/compat/linux/linux_socket.h @@ -49,4 +49,36 @@ #define LINUX_MSG_ERRQUEUE 0x2000 #define LINUX_MSG_NOSIGNAL 0x4000 +/* Socket-level control message types */ + +#define LINUX_SCM_RIGHTS 0x01 +#define LINUX_SCM_CREDENTIALS 0x02 + +/* Ancilliary data object information macros */ + +#define LINUX_CMSG_ALIGN(len) (((len) + sizeof(l_long)-1) & ~(sizeof(l_long)-1)) +#define LINUX_CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + \ + LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)))) +#define LINUX_CMSG_SPACE(len) (LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)) + \ + LINUX_CMSG_ALIGN(len)) +#define LINUX_CMSG_LEN(len) (LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)) + \ + (len)) +#define LINUX_CMSG_FIRSTHDR(msg) \ + ((msg)->msg_controllen >= \ + sizeof(struct l_cmsghdr) ? \ + (struct l_cmsghdr *)((msg)->msg_control) : \ + (struct l_cmsghdr *)(NULL)) +#define LINUX_CMSG_NXTHDR(msg, cmsg) \ + ((((char *)(cmsg) + \ + LINUX_CMSG_ALIGN((cmsg)->cmsg_len) + \ + sizeof(*(cmsg))) > \ + (((char *)(msg)->msg_control) + \ + (msg)->msg_controllen)) ? \ + (struct l_cmsghdr *) NULL : \ + (struct l_cmsghdr *)((char *)(cmsg) + \ + LINUX_CMSG_ALIGN((cmsg)->cmsg_len))) + +#define CMSG_HDRSZ CMSG_LEN(0) +#define L_CMSG_HDRSZ LINUX_CMSG_LEN(0) + #endif /* _LINUX_SOCKET_H_ */ diff --git a/src/sys/i386/linux/linux.h b/src/sys/i386/linux/linux.h index 1c3627d..28655fe 100644 --- a/src/sys/i386/linux/linux.h +++ b/src/sys/i386/linux/linux.h @@ -656,6 +656,7 @@ union l_semun { #define LINUX_SO_NO_CHECK 11 #define LINUX_SO_PRIORITY 12 #define LINUX_SO_LINGER 13 +#define LINUX_SO_PASSCRED 16 #define LINUX_SO_PEERCRED 17 #define LINUX_SO_RCVLOWAT 18 #define LINUX_SO_SNDLOWAT 19 @@ -680,6 +681,28 @@ struct l_sockaddr { char sa_data[14]; }; +struct l_msghdr { + l_uintptr_t msg_name; + l_int msg_namelen; + l_uintptr_t msg_iov; + l_size_t msg_iovlen; + l_uintptr_t msg_control; + l_size_t msg_controllen; + l_uint msg_flags; +}; + +struct l_cmsghdr { + l_size_t cmsg_len; + l_int cmsg_level; + l_int cmsg_type; +}; + +struct l_ucred { + uint32_t pid; + uint32_t uid; + uint32_t gid; +}; + struct l_ifmap { l_ulong mem_start; l_ulong mem_end; -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Thu Sep 18 14:25:08 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38C2A106566C; Thu, 18 Sep 2008 14:25:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id CC6908FC1B; Thu, 18 Sep 2008 14:25:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KgKRN-000FK1-Hf; Thu, 18 Sep 2008 17:25:05 +0300 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 m8IEOtwI081317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Sep 2008 17:24:55 +0300 (EEST) (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.2/8.14.2) with ESMTP id m8IEOtN1060761; Thu, 18 Sep 2008 17:24:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m8IEOsh5060760; Thu, 18 Sep 2008 17:24:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Sep 2008 17:24:54 +0300 From: Kostik Belousov To: Chagin Dmitry Message-ID: <20080918142454.GK39652@deviant.kiev.zoral.com.ua> References: <20080822112927.GZ99951@hoeg.nl> <20080822112946.GA97526@freebsd.org> <20080831110610.GA2380@dchagin.dialup.corbina.ru> <20080902085623.GA12395@freebsd.org> <20080917183801.GA2714@dchagin.dialup.corbina.ru> <20080917190230.GA2947@dchagin.dialup.corbina.ru> <20080918093831.89545e2iu5zjgjgg@webmail.leidinger.net> <20080918135736.GA2218@dchagin.dialup.corbina.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GI1PA4Sghwo1XriW" Content-Disposition: inline In-Reply-To: <20080918135736.GA2218@dchagin.dialup.corbina.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on 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 X-Virus-Scanned: mail.terabit.net.ua 1KgKRN-000FK1-Hf 707a1ba57d10f4d91fd3391f30716154 X-Terabit: YES Cc: Alexander Leidinger , freebsd-emulation@freebsd.org, freebsd-net@freebsd.org Subject: Re: [PATCH] recvmsg() sendmsg() linux emulation X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 14:25:08 -0000 --GI1PA4Sghwo1XriW Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 18, 2008 at 05:57:36PM +0400, Chagin Dmitry wrote: > diff --git a/src/sys/amd64/linux32/linux32_io.h b/src/sys/amd64/linux32/l= inux32_io.h > new file mode 100644 > index 0000000..c1a9f1c > --- /dev/null > +++ b/src/sys/amd64/linux32/linux32_io.h > @@ -0,0 +1,47 @@ > +/*- > + * Copyright (c) 2004 Tim J. Robbins > + * Copyright (c) 2001 Doug Rabson > + * Copyright (c) 1994-1996 S=F8ren Schmidt > + * All rights reserved. ^^^^^^^^^^ Is this true ? Coloring this further, do we need a new include file for one structure and one function ? P.S. Your MUA sets Mail-Followup-To: to the full list of the recipients _except_ you. Is this intentional ? --GI1PA4Sghwo1XriW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjSZLYACgkQC3+MBN1Mb4iElgCffmg0+jVngqsTCVCCjBnEwLSH nBEAoJ50iCUamcYuPGT4x3zZ6RPPXxX1 =RALa -----END PGP SIGNATURE----- --GI1PA4Sghwo1XriW-- From owner-freebsd-emulation@FreeBSD.ORG Thu Sep 18 15:08:07 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B1B51065670; Thu, 18 Sep 2008 15:08:07 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 253408FC20; Thu, 18 Sep 2008 15:08:06 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 58E261CA1EC; Thu, 18 Sep 2008 19:08:05 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1152420961; Thu, 18 Sep 2008 19:08:05 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.3/8.14.2) with ESMTP id m8IF85dP002981; Thu, 18 Sep 2008 19:08:05 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.3/8.14.2/Submit) id m8IF7x4a002980; Thu, 18 Sep 2008 19:07:59 +0400 (MSD) (envelope-from root) Date: Thu, 18 Sep 2008 19:07:59 +0400 From: Chagin Dmitry To: Kostik Belousov Message-ID: <20080918150759.GA2898@dchagin.dialup.corbina.ru> Mail-Followup-To: Kostik Belousov , Alexander Leidinger , freebsd-emulation@freebsd.org, freebsd-net@freebsd.org References: <20080822112927.GZ99951@hoeg.nl> <20080822112946.GA97526@freebsd.org> <20080831110610.GA2380@dchagin.dialup.corbina.ru> <20080902085623.GA12395@freebsd.org> <20080917183801.GA2714@dchagin.dialup.corbina.ru> <20080917190230.GA2947@dchagin.dialup.corbina.ru> <20080918093831.89545e2iu5zjgjgg@webmail.leidinger.net> <20080918135736.GA2218@dchagin.dialup.corbina.ru> <20080918142454.GK39652@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080918142454.GK39652@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i Cc: Alexander Leidinger , freebsd-emulation@freebsd.org, freebsd-net@freebsd.org Subject: Re: [PATCH] recvmsg() sendmsg() linux emulation X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 15:08:07 -0000 On Thu, Sep 18, 2008 at 05:24:54PM +0300, Kostik Belousov wrote: > On Thu, Sep 18, 2008 at 05:57:36PM +0400, Chagin Dmitry wrote: > > diff --git a/src/sys/amd64/linux32/linux32_io.h b/src/sys/amd64/linux32/linux32_io.h > > new file mode 100644 > > index 0000000..c1a9f1c > > --- /dev/null > > +++ b/src/sys/amd64/linux32/linux32_io.h > > @@ -0,0 +1,47 @@ > > +/*- > > + * Copyright (c) 2004 Tim J. Robbins > > + * Copyright (c) 2001 Doug Rabson > > + * Copyright (c) 1994-1996 Søren Schmidt > > + * All rights reserved. > ^^^^^^^^^^ Is this true ? > I have copied it from linux.h, can I remove it? > Coloring this further, do we need a new include file for one structure > and one function ? > You suggest to transfer it to linux.h? I can do it, but then it is necessary to insert #include into all files which include linux.h thnx! -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Thu Sep 18 15:31:16 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E44BD106566C; Thu, 18 Sep 2008 15:31:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 83CCC8FC1D; Thu, 18 Sep 2008 15:31:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KgLTO-000ME4-EU; Thu, 18 Sep 2008 18:31:14 +0300 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 m8IFVB7x085611 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Sep 2008 18:31:11 +0300 (EEST) (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.2/8.14.2) with ESMTP id m8IFVBp2067559; Thu, 18 Sep 2008 18:31:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m8IFVBdn067558; Thu, 18 Sep 2008 18:31:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Sep 2008 18:31:11 +0300 From: Kostik Belousov To: Alexander Leidinger , freebsd-emulation@freebsd.org, freebsd-net@freebsd.org Message-ID: <20080918153111.GL39652@deviant.kiev.zoral.com.ua> References: <20080822112927.GZ99951@hoeg.nl> <20080822112946.GA97526@freebsd.org> <20080831110610.GA2380@dchagin.dialup.corbina.ru> <20080902085623.GA12395@freebsd.org> <20080917183801.GA2714@dchagin.dialup.corbina.ru> <20080917190230.GA2947@dchagin.dialup.corbina.ru> <20080918093831.89545e2iu5zjgjgg@webmail.leidinger.net> <20080918135736.GA2218@dchagin.dialup.corbina.ru> <20080918142454.GK39652@deviant.kiev.zoral.com.ua> <20080918150759.GA2898@dchagin.dialup.corbina.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jTQ3i/+I4dznYrD2" Content-Disposition: inline In-Reply-To: <20080918150759.GA2898@dchagin.dialup.corbina.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on 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 X-Virus-Scanned: mail.terabit.net.ua 1KgLTO-000ME4-EU c47c7ed45be87fbccf88b0f79ab4ae35 X-Terabit: YES Cc: Subject: Re: [PATCH] recvmsg() sendmsg() linux emulation X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 15:31:17 -0000 --jTQ3i/+I4dznYrD2 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 18, 2008 at 07:07:59PM +0400, Chagin Dmitry wrote: I still cannot answer to you, so be it. > On Thu, Sep 18, 2008 at 05:24:54PM +0300, Kostik Belousov wrote: > > On Thu, Sep 18, 2008 at 05:57:36PM +0400, Chagin Dmitry wrote: > > > diff --git a/src/sys/amd64/linux32/linux32_io.h b/src/sys/amd64/linux= 32/linux32_io.h > > > new file mode 100644 > > > index 0000000..c1a9f1c > > > --- /dev/null > > > +++ b/src/sys/amd64/linux32/linux32_io.h > > > @@ -0,0 +1,47 @@ > > > +/*- > > > + * Copyright (c) 2004 Tim J. Robbins > > > + * Copyright (c) 2001 Doug Rabson > > > + * Copyright (c) 1994-1996 S=F8ren Schmidt > > > + * All rights reserved. > > ^^^^^^^^^^ Is this true ? > >=20 >=20 > I have copied it from linux.h, can I remove it? No, you should specify yourself as the copyright holder. >=20 > > Coloring this further, do we need a new include file for one structure > > and one function ? > >=20 >=20 > You suggest to transfer it to linux.h? > I can do it, but then it is necessary to insert #include > into all files which include linux.h This may be a trouble. Is there any other compat/linux include that requires uio ? --jTQ3i/+I4dznYrD2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjSdD4ACgkQC3+MBN1Mb4hplQCeMKpQpCX7LYIHOB7ucxlS41Kl 8i4AoM9GSfbh0NZ87H9/iUHelz/FOTyp =GhNg -----END PGP SIGNATURE----- --jTQ3i/+I4dznYrD2-- From owner-freebsd-emulation@FreeBSD.ORG Thu Sep 18 15:56:34 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 290E51065675; Thu, 18 Sep 2008 15:56:34 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id C949F8FC26; Thu, 18 Sep 2008 15:56:33 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id C218C1CBA28; Thu, 18 Sep 2008 19:56:32 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1152686052; Thu, 18 Sep 2008 19:56:32 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.3/8.14.2) with ESMTP id m8IFuW8u003379; Thu, 18 Sep 2008 19:56:32 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.3/8.14.2/Submit) id m8IFuQTJ003378; Thu, 18 Sep 2008 19:56:26 +0400 (MSD) (envelope-from root) Date: Thu, 18 Sep 2008 19:56:26 +0400 From: Chagin Dmitry To: Kostik Belousov Message-ID: <20080918155626.GA3299@dchagin.dialup.corbina.ru> References: <20080822112946.GA97526@freebsd.org> <20080831110610.GA2380@dchagin.dialup.corbina.ru> <20080902085623.GA12395@freebsd.org> <20080917183801.GA2714@dchagin.dialup.corbina.ru> <20080917190230.GA2947@dchagin.dialup.corbina.ru> <20080918093831.89545e2iu5zjgjgg@webmail.leidinger.net> <20080918135736.GA2218@dchagin.dialup.corbina.ru> <20080918142454.GK39652@deviant.kiev.zoral.com.ua> <20080918150759.GA2898@dchagin.dialup.corbina.ru> <20080918153111.GL39652@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080918153111.GL39652@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i Cc: Alexander Leidinger , freebsd-emulation@freebsd.org, freebsd-net@freebsd.org Subject: Re: [PATCH] recvmsg() sendmsg() linux emulation X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 15:56:34 -0000 On Thu, Sep 18, 2008 at 06:31:11PM +0300, Kostik Belousov wrote: > On Thu, Sep 18, 2008 at 07:07:59PM +0400, Chagin Dmitry wrote: > > I still cannot answer to you, so be it. > > > On Thu, Sep 18, 2008 at 05:24:54PM +0300, Kostik Belousov wrote: > > > On Thu, Sep 18, 2008 at 05:57:36PM +0400, Chagin Dmitry wrote: > > > > diff --git a/src/sys/amd64/linux32/linux32_io.h b/src/sys/amd64/linux32/linux32_io.h > > > > new file mode 100644 > > > > index 0000000..c1a9f1c > > > > --- /dev/null > > > > +++ b/src/sys/amd64/linux32/linux32_io.h > > > > @@ -0,0 +1,47 @@ > > > > +/*- > > > > + * Copyright (c) 2004 Tim J. Robbins > > > > + * Copyright (c) 2001 Doug Rabson > > > > + * Copyright (c) 1994-1996 Søren Schmidt > > > > + * All rights reserved. > > > ^^^^^^^^^^ Is this true ? > > > > > > > I have copied it from linux.h, can I remove it? > > No, you should specify yourself as the copyright holder. > ok > > > > > Coloring this further, do we need a new include file for one structure > > > and one function ? > > > > > > > You suggest to transfer it to linux.h? > > I can do it, but then it is necessary to insert #include > > into all files which include linux.h > > This may be a trouble. Is there any other compat/linux include that > requires uio ? yes, linux_util.h include uio now, but iovec32 stuff specific only for ia32@amd64 emulation. -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Fri Sep 19 07:39:59 2008 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83940106564A; Fri, 19 Sep 2008 07:39:59 +0000 (UTC) (envelope-from itetcu@FreeBSD.org) Received: from it.buh.tecnik93.com (it.buh.tecnik93.com [81.196.204.98]) by mx1.freebsd.org (Postfix) with ESMTP id 3BB9E8FC12; Fri, 19 Sep 2008 07:39:59 +0000 (UTC) (envelope-from itetcu@FreeBSD.org) Received: from it.buh.tecnik93.com (localhost [127.0.0.1]) by it.buh.tecnik93.com (Postfix) with ESMTP id B80182C50CEF; Fri, 19 Sep 2008 10:22:22 +0300 (EEST) Date: Fri, 19 Sep 2008 10:22:16 +0300 From: Ion-Mihai Tetcu To: infofarmer@FreeBSD.org, freebsd-emulation@FreeBSD.org Message-ID: <20080919102216.389c930f@it.buh.tecnik93.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/iM_AsuLI3+F6ZYo2p+auunU"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: Subject: x11-themes/linux-hicolor-icon-theme fails to install if sysutils/linux-nero X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2008 07:39:59 -0000 --Sig_/iM_AsuLI3+F6ZYo2p+auunU Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi, While trying to portupgrade acroreader I run into the following problem: [...] =3D=3D=3D> acroread8-8.1.2_2 depends on file: /usr/local/lib/linux-nvu/li= bgtkembedmoz.so - not found =3D=3D=3D> Verifying reinstall for /usr/local/lib/linux-nvu/libgtkembedm= oz.so in /usr/ports/www/linux-nvu [...] =3D=3D=3D> Installing for linux-nvu-1.0 [...] =3D=3D=3D> linux-nvu-1.0 depends on file: /compat/linux/usr/share/icons/h= icolor/index.theme - not found =3D=3D=3D> Verifying reinstall for /compat/linux/usr/share/icons/hicolor= /index.theme in /usr/ports/x11-themes/linux-hicolor-icon-theme [...] =3D=3D=3D> Installing for linux-hicolor-icon-theme-0.5_1 =3D=3D=3D> linux-hicolor-icon-theme-0.5_1 depends on file: /usr/local/sha= re/icons/hicolor/index.theme - found =3D=3D=3D> linux-hicolor-icon-theme-0.5_1 depends on file: /compat/linux/= bin/sh - found =3D=3D=3D> Generating temporary packing list install -d /compat/linux/usr/share/icons /bin/ln -fs /usr/local/share/icons/hicolor /compat/linux/usr/share/icons ln: /compat/linux/usr/share/icons/hicolor: Operation not permitted *** Error code 1 This happens because I already have /compat/linux/usr/share/icons/hicolor with sysutils/linux-nero's icons. Installing x11-themes/linux-hicolor-icon-theme first then sysutils/linux-nero's "fixes" the problem. While I'm not sure this is the right fix, making sysutils/linux-nero's RUN_DEPEND on x11-themes/linux-hicolor-icon-theme will fix this. --=20 IOnut - Un^d^dregistered ;) FreeBSD "user" "Intellectual Property" is nowhere near as valuable as "Intellect" FreeBSD committer -> itetcu@FreeBSD.org, PGP Key ID 057E9F8B493A297B --Sig_/iM_AsuLI3+F6ZYo2p+auunU Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjTUy4ACgkQJ7GIuiH/oeWK3QCgr4wMJnVxlERwywUNQEKZYg9p oR0Anjkwq4L2kd6IYLw7y8iFSEqWx/Cx =duNo -----END PGP SIGNATURE----- --Sig_/iM_AsuLI3+F6ZYo2p+auunU-- From owner-freebsd-emulation@FreeBSD.ORG Fri Sep 19 15:38:52 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7DD81065670; Fri, 19 Sep 2008 15:38:52 +0000 (UTC) (envelope-from jhein@timing.com) Received: from Daffy.timing.com (mx1.timing.com [206.168.13.218]) by mx1.freebsd.org (Postfix) with ESMTP id 57D218FC0A; Fri, 19 Sep 2008 15:38:47 +0000 (UTC) (envelope-from jhein@timing.com) Received: from gromit.timing.com (gromit.timing.com [206.168.13.209]) by Daffy.timing.com (8.13.1/8.13.1) with ESMTP id m8JFE9n1041268; Fri, 19 Sep 2008 09:14:09 -0600 (MDT) (envelope-from jhein@timing.com) Received: from gromit.timing.com (localhost [127.0.0.1]) by gromit.timing.com (8.14.2/8.14.2) with ESMTP id m8JEabJS014592; Fri, 19 Sep 2008 08:36:37 -0600 (MDT) (envelope-from jhein@gromit.timing.com) Received: (from jhein@localhost) by gromit.timing.com (8.14.2/8.14.2/Submit) id m8JEab0O014589; Fri, 19 Sep 2008 08:36:37 -0600 (MDT) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18643.47349.732101.661496@gromit.timing.com> Date: Fri, 19 Sep 2008 08:36:37 -0600 From: John Hein To: Ion-Mihai Tetcu In-Reply-To: <20080919102216.389c930f@it.buh.tecnik93.com> References: <20080919102216.389c930f@it.buh.tecnik93.com> X-Mailer: VM 7.19 under Emacs 22.1.1 X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on Daffy.timing.com X-Virus-Status: Clean Cc: freebsd-emulation@freebsd.org Subject: Re: x11-themes/linux-hicolor-icon-theme fails to install if sysutils/linux-nero X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2008 15:38:52 -0000 Ion-Mihai Tetcu wrote at 10:22 +0300 on Sep 19, 2008: > While trying to portupgrade acroreader I run into the following problem: > > [...] > ===> acroread8-8.1.2_2 depends on file: /usr/local/lib/linux-nvu/libgtkembedmoz.so - not found > ===> Verifying reinstall for /usr/local/lib/linux-nvu/libgtkembedmoz.so in /usr/ports/www/linux-nvu > [...] > ===> Installing for linux-nvu-1.0 > [...] > ===> linux-nvu-1.0 depends on file: /compat/linux/usr/share/icons/hicolor/index.theme - not found > ===> Verifying reinstall for /compat/linux/usr/share/icons/hicolor/index.theme in /usr/ports/x11-themes/linux-hicolor-icon-theme > [...] > > ===> Installing for linux-hicolor-icon-theme-0.5_1 > ===> linux-hicolor-icon-theme-0.5_1 depends on file: /usr/local/share/icons/hicolor/index.theme - found > ===> linux-hicolor-icon-theme-0.5_1 depends on file: /compat/linux/bin/sh - found > ===> Generating temporary packing list > install -d /compat/linux/usr/share/icons > /bin/ln -fs /usr/local/share/icons/hicolor /compat/linux/usr/share/icons > ln: /compat/linux/usr/share/icons/hicolor: Operation not permitted > *** Error code 1 > > > This happens because I already have > /compat/linux/usr/share/icons/hicolor with sysutils/linux-nero's icons. > > Installing x11-themes/linux-hicolor-icon-theme first then > sysutils/linux-nero's "fixes" the problem. > > While I'm not sure this is the right fix, making sysutils/linux-nero's > RUN_DEPEND on x11-themes/linux-hicolor-icon-theme will fix this. Won't that cause the linux-nero port to install it's icon files into /usr/local/share/icons (through the sym link), but leave the plist relative to LINUXBASE? The problem is that linux-hicolor-icon-theme assumes it owns everything under share/icons/hicolor. Has anyone ever considered using unionfs for /compat/linux/usr/share? One problem I can see is that 'share' is not the only directory that should be shared. etc? I'm not sure unionfs is up to the job, but I'm wondering if any has considered it or even tried it. From owner-freebsd-emulation@FreeBSD.ORG Sat Sep 20 17:02:05 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B78811065670 for ; Sat, 20 Sep 2008 17:02:05 +0000 (UTC) (envelope-from trebestie@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.170]) by mx1.freebsd.org (Postfix) with ESMTP id 8DD608FC08 for ; Sat, 20 Sep 2008 17:02:05 +0000 (UTC) (envelope-from trebestie@gmail.com) Received: by wf-out-1314.google.com with SMTP id 24so941989wfg.7 for ; Sat, 20 Sep 2008 10:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=899JrI3G4DCstS0nVVbB95RZuyktNablD63SyuF/hi8=; b=W5amzvIW93LQDf3Jaer3EIYLe16Oidvi+8B0PbVToEWav5XfZ1wy4f7zSxrFrsPRIa AbG0dhy8hywPeEvtgyfcUymp1CbEOkxMsOBXKMeePQIGXw/mdvCSqpmQA//BiQ2djezJ RMPTItaWnWhGcEgusuo7CcmrV+8GFwkbuqxxA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=Y3Ik7YBJYfEECpkHbP8PhGSzJiIhHpuvbuZZU70b+DBj9WFDZ7aO4wsOG4fhrdWGYr 1NosQ2JFa7U1q0slCqJ8sAGMDqq3LNHUoZidUmslpJg/Ajq+UpY7i6cOs+tZKUMPQKB+ 2b4pb3p57RZ0FulAlMNpxyq0fmsQYI4+aFvis= Received: by 10.142.180.11 with SMTP id c11mr576502wff.113.1221928235583; Sat, 20 Sep 2008 09:30:35 -0700 (PDT) Received: by 10.142.141.16 with HTTP; Sat, 20 Sep 2008 09:30:35 -0700 (PDT) Message-ID: <83e5fb980809200930v5e9c4a33j5fddb72f6d9304ca@mail.gmail.com> Date: Sat, 20 Sep 2008 18:30:35 +0200 From: "Diego Depaoli" To: freebsd-emulation@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Enemy territory does not run X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2008 17:02:05 -0000 Launching enemy-territory on my CURRENT I get a segmentation fault and that system message: linux_sys_futex: unknown op 798242337 I have linux_base-f8-8_4 installed and a Nvidia card. I don't remember the last time I played that game, so I don't know since it is broken. Regards -- Diego Depaoli