From owner-freebsd-emulation@FreeBSD.ORG Sun Aug 31 11:06:30 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 CC23E1065671 for ; Sun, 31 Aug 2008 11:06:30 +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 344618FC16 for ; Sun, 31 Aug 2008 11:06:29 +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 F1E6918C55E for ; Sun, 31 Aug 2008 15:06:27 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.dialup.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1044354815 for freebsd-emulation@freebsd.org; Sun, 31 Aug 2008 15:06:27 +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 m7VB6FOo002534 for ; Sun, 31 Aug 2008 15:06:15 +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 m7VB6AYd002533 for freebsd-emulation@freebsd.org; Sun, 31 Aug 2008 15:06:10 +0400 (MSD) (envelope-from root) Date: Sun, 31 Aug 2008 15:06:10 +0400 From: Chagin Dmitry To: freebsd-emulation@freebsd.org Message-ID: <20080831110610.GA2380@dchagin.dialup.corbina.ru> Mail-Followup-To: freebsd-emulation@freebsd.org References: <20080822112927.GZ99951@hoeg.nl> <20080822112946.GA97526@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080822112946.GA97526@freebsd.org> User-Agent: Mutt/1.4.2.3i Subject: Re: MPSAFE TTY: Linux PTY's 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, 31 Aug 2008 11:06:30 -0000 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.. diff --git a/src/sys/compat/linux/linux_socket.c b/src/sys/compat/linux/linux_socket.c index 7202944..41556bb 100644 --- a/src/sys/compat/linux/linux_socket.c +++ b/src/sys/compat/linux/linux_socket.c @@ -421,6 +421,65 @@ 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 = lhdr->msg_flags; + return (0); +} + +static int +bsd_to_linux_msghdr(const struct msghdr *bhdr, struct l_msghdr *lhdr) +{ + lhdr->msg_name = bhdr->msg_name; + lhdr->msg_namelen = bhdr->msg_namelen; + lhdr->msg_iov = bhdr->msg_iov; + lhdr->msg_iovlen = bhdr->msg_iovlen; + lhdr->msg_control = bhdr->msg_control; + lhdr->msg_controllen = bhdr->msg_controllen; + return (0); +} + +#define CMSGHDR_SIZE CMSG_LEN(0) +#define L_CMSGHDR_SIZE LINUX_CMSG_LEN(0) + +static int linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, enum uio_seg segflg) { @@ -437,25 +496,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(CMSGHDR_SIZE, 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_CMSGHDR_SIZE; + cmsg->cmsg_len = CMSG_LEN(datalen); + data = LINUX_CMSG_DATA(ptr_cmsg); + + error = ENOBUFS; + if (!m_append(control, CMSGHDR_SIZE, (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); @@ -1014,17 +1105,15 @@ struct linux_sendmsg_args { static int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) { - struct linux_sendmsg_args linux_args; struct msghdr msg; + struct l_msghdr linux_msg; struct iovec *iov; int error; - /* XXXTJR sendmsg is broken on amd64 */ - - error = copyin(args, &linux_args, sizeof(linux_args)); + error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); if (error) return (error); - error = copyin(PTRIN(linux_args.msg), &msg, sizeof(msg)); + error = linux_to_bsd_msghdr(&msg, &linux_msg); if (error) return (error); @@ -1042,8 +1131,7 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) return (error); msg.msg_iov = iov; msg.msg_flags = 0; - error = linux_sendit(td, linux_args.s, &msg, linux_args.flags, - UIO_USERSPACE); + error = linux_sendit(td, args->s, &msg, args->flags, UIO_USERSPACE); free(iov, M_IOV); return (error); } @@ -1057,48 +1145,116 @@ struct linux_recvmsg_args { static int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) { - struct linux_recvmsg_args linux_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 iovec *uiov, *iov; + struct mbuf *control = NULL; + struct mbuf **controlp; + struct l_cmsghdr *cmsg = NULL; int error; - /* XXXTJR recvmsg is broken on amd64 */ - - if ((error = copyin(args, &linux_args, sizeof(linux_args)))) + 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 = linux_args.s; - bsd_args.msg = PTRIN(linux_args.msg); - bsd_args.flags = linux_to_bsd_msg_flags(linux_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); + error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); 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); + uiov = msg.msg_iov; + msg.msg_iov = iov; + msg.msg_flags = linux_to_bsd_msg_flags(linux_msg.msg_flags); + + if (msg.msg_name) { + error = linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name, + msg.msg_namelen); + if (error) + goto bad; } - error = copyin(PTRIN(linux_args.msg), &msg, sizeof(msg)); + controlp = (msg.msg_control != NULL) ? &control : NULL; + error = kern_recvit(td, args->s, &msg, UIO_USERSPACE, controlp); if (error) - return (error); - if (msg.msg_name && msg.msg_namelen > 2) - error = linux_sa_put(msg.msg_name); + goto bad; + + msg.msg_iov = uiov; + + error = bsd_to_linux_msghdr(&msg, &linux_msg); + if (error) + goto bad; + + if (linux_msg.msg_name) + bsd_to_linux_sockaddr((struct sockaddr *)linux_msg.msg_name); + if (linux_msg.msg_name && linux_msg.msg_namelen > 2) { + error = linux_sa_put(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; + + cmsg = malloc(L_CMSGHDR_SIZE, M_TEMP, M_WAITOK | M_ZERO); + outbuf = linux_msg.msg_control; + cm = mtod(control, struct cmsghdr *); + outlen = 0; + clen = control->m_len; + + while (cm != NULL) { + data = CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; + + outlen += LINUX_CMSG_LEN(datalen); + if (outlen > linux_msg.msg_controllen) { + linux_msg.msg_flags |= LINUX_MSG_CTRUNC; + break; + } + + /* + * XXX here special handler of SCM_CREDS + */ + + cmsg->cmsg_len = LINUX_CMSG_LEN(datalen); + cmsg->cmsg_type = bsd_to_linux_cmsg_type(cm->cmsg_type); + cmsg->cmsg_level = + bsd_to_linux_sockopt_level(cm->cmsg_level); + + error = copyout(cmsg, outbuf, L_CMSGHDR_SIZE); + if (error) + goto bad; + outbuf += L_CMSGHDR_SIZE; + + error = copyout(data, outbuf, datalen); + if (error) + goto bad; + outbuf += LINUX_CMSG_ALIGN(datalen); + linux_msg.msg_controllen = outlen; + + if (CMSG_SPACE(datalen) < clen) { + clen -= CMSG_SPACE(datalen); + cm = (struct cmsghdr *) + ((caddr_t)cm + CMSG_SPACE(datalen)); + } else + cm = NULL; + } + } + + error = copyout(&linux_msg, PTRIN(args->msg), sizeof(linux_msg)); + +bad: + free(iov, M_IOV); + + if (control != NULL) + m_freem(control); + if (cmsg != NULL) + free(cmsg, M_TEMP); return (error); } diff --git a/src/sys/compat/linux/linux_socket.h b/src/sys/compat/linux/linux_socket.h index 074e8e0..668ec7f 100644 --- a/src/sys/compat/linux/linux_socket.h +++ b/src/sys/compat/linux/linux_socket.h @@ -49,4 +49,49 @@ #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 + +struct l_msghdr { + void *msg_name; + l_int msg_namelen; + struct iovec *msg_iov; + l_size_t msg_iovlen; + void *msg_control; + l_size_t msg_controllen; + unsigned msg_flags; +}; + +struct l_cmsghdr { + l_size_t cmsg_len; + l_int cmsg_level; + l_int cmsg_type; +}; + +/* Ancilliary data object information macros */ + +#define LINUX_CMSG_ALIGN(len) (((len) + sizeof(long)-1) & ~(sizeof(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))) + #endif /* _LINUX_SOCKET_H_ */ -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Mon Sep 1 00:44:06 2008 Return-Path: Delivered-To: freebsd-emulation@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66AAB106566B; Mon, 1 Sep 2008 00:44:06 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3CB6F8FC27; Mon, 1 Sep 2008 00:44:06 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m810i62k078335; Mon, 1 Sep 2008 00:44:06 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m810i5sC078331; Mon, 1 Sep 2008 00:44:05 GMT (envelope-from linimon) Date: Mon, 1 Sep 2008 00:44:05 GMT Message-Id: <200809010044.m810i5sC078331@freefall.freebsd.org> To: ganael.laplanche@martymac.com, linimon@FreeBSD.org, freebsd-emulation@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: ports/123960: Port fix: archivers/linux-par2cmdline - better handling of NOPORTDOCS 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, 01 Sep 2008 00:44:06 -0000 Synopsis: Port fix: archivers/linux-par2cmdline - better handling of NOPORTDOCS State-Changed-From-To: open->closed State-Changed-By: linimon State-Changed-When: Mon Sep 1 00:43:48 UTC 2008 State-Changed-Why: Should be taken care of by the commit in ports/123964. http://www.freebsd.org/cgi/query-pr.cgi?pr=123960 From owner-freebsd-emulation@FreeBSD.ORG Mon Sep 1 11:06:53 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 F16921065672 for ; Mon, 1 Sep 2008 11:06:53 +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 E16D28FC1D for ; Mon, 1 Sep 2008 11:06:53 +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 m81B6rxr068397 for ; Mon, 1 Sep 2008 11:06:53 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m81B6rrI068393 for freebsd-emulation@FreeBSD.org; Mon, 1 Sep 2008 11:06:53 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 1 Sep 2008 11:06:53 GMT Message-Id: <200809011106.m81B6rrI068393@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, 01 Sep 2008 11:06:54 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/21463 emulation [linux] Linux compatability mode should not allow setu o kern/97326 emulation [linux] file descriptor leakage in linux emulation o kern/117010 emulation [linux] linux_getdents() get something like buffer ove 3 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/11165 emulation [ibcs2] IBCS2 doesn't work correctly with PID_MAX 9999 o kern/29698 emulation [linux] [patch] linux ipcs doesn'work o kern/39201 emulation [linux] [patch] ptrace(2) and rfork(RFLINUXTHPN) confu o kern/41543 emulation [patch] [request] easier wine/w23 support a kern/72920 emulation [linux]: path "prefixing" is not done on unix domain s o kern/73777 emulation [linux] [patch] linux emulation: root dir special hand o kern/91293 emulation [svr4] [patch] *Experimental* Update to the SVR4 emula o ports/91318 emulation [fix] graphics/linux_dri: works on amd64 too o ports/121800 emulation x11-toolkits/linux-openmotif - OpenMotif upgrade to 2. o kern/122318 emulation [linux] [cmake]: Segmentation fault when running Linux o kern/126232 emulation [linux] Linux ioctl TCGETS (0x5401) always fails 11 problems total. From owner-freebsd-emulation@FreeBSD.ORG Mon Sep 1 19:50:12 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 E633B1065748 for ; Mon, 1 Sep 2008 19:50:12 +0000 (UTC) (envelope-from pav@FreeBSD.org) Received: from raven.customer.vol.cz (raven.customer.vol.cz [195.250.144.108]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7388FC1C for ; Mon, 1 Sep 2008 19:50:11 +0000 (UTC) (envelope-from pav@FreeBSD.org) Received: from [192.168.0.23] (r5af140.net.upc.cz [86.49.39.140]) (authenticated bits=0) by raven.customer.vol.cz (8.14.1/8.14.1) with ESMTP id m81JN4ij043653 for ; Mon, 1 Sep 2008 21:23:05 +0200 (CEST) (envelope-from pav@FreeBSD.org) From: Pav Lucistnik To: freebsd-emulation@FreeBSD.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Qyc38/Z5P1ZodAzF62wy" Date: Mon, 01 Sep 2008 21:23:03 +0200 Message-Id: <1220296983.73021.2.camel@ikaros.oook.cz> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 FreeBSD GNOME Team Port X-Spam-Score: -2.132 () AWL,BAYES_00 X-Scanned-By: MIMEDefang 2.64 on 195.250.144.108 X-Milter: Spamilter (Reciever: raven.customer.vol.cz; Sender-ip: 86.49.39.140; Sender-helo: [192.168.0.23]; ) Cc: Subject: [Fwd: linux_kdump-1.5_2 failed on amd64 7] X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pav@FreeBSD.org List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 19:50:13 -0000 --=-Qyc38/Z5P1ZodAzF62wy Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable -------- P=F8eposlan=E1 zpr=E1va -------- > Od: User Ports-amd64 > Komu: cvs@oook.cz > P=F8edm=ECt: linux_kdump-1.5_2 failed on amd64 7 > Datum: Sun, 31 Aug 2008 06:55:26 GMT >=20 > You can also find this build log at >=20 > http://pointyhat.FreeBSD.org/errorlogs/amd64-errorlogs/a.7.200808291444= 48/linux_kdump-1.5_2.log >=20 > building linux_kdump-1.5_2 on hammer1.isc.gumbysoft.com > in directory /usr2/pkgbuild/7/20080829144448/chroot/3142 > building for: 7.1-PRERELEASE amd64 > maintained by: freebsd-emulation@FreeBSD.org > port directory: /usr/ports/devel/linux_kdump > Makefile ident: $FreeBSD: ports/devel/linux_kdump/Makefile,v 1.30 2007/10= /04 00:41:08 edwin Exp $ > build started at Sun Aug 31 06:50:34 UTC 2008 > FETCH_DEPENDS=3D > PATCH_DEPENDS=3D > EXTRACT_DEPENDS=3D > BUILD_DEPENDS=3Dlinux_base-gentoo-stage3-2006.0_2.tbz > RUN_DEPENDS=3D > prefixes: LOCALBASE=3Dusr/local X11BASE=3Dusr/local > add_pkg > =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=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> Using the FreeBSD source tree under /usr/src > =3D=3D=3D> Set SRCDIR to use an alternate source tree > =3D> linux_kdump-1.5.tar.gz doesn't seem to exist in /tmp/distfiles/. > =3D> Attempting to fetch from ftp://freebsd.isc.org/pub/FreeBSD/ports/dis= tfiles/. > linux_kdump-1.5.tar.gz 6166 B 54 kBps > =3D> MD5 Checksum OK for linux_kdump-1.5.tar.gz. > =3D> SHA256 Checksum OK for linux_kdump-1.5.tar.gz. > =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=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 > add_pkg > =3D=3D=3D> Using the FreeBSD source tree under /usr/src > =3D=3D=3D> Set SRCDIR to use an alternate source tree > =3D=3D=3D> Extracting for linux_kdump-1.5_2 > =3D> MD5 Checksum OK for linux_kdump-1.5.tar.gz. > =3D> SHA256 Checksum OK for linux_kdump-1.5.tar.gz. > =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=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 > add_pkg > =3D=3D=3D> Patching for linux_kdump-1.5_2 > =3D=3D=3D> Applying FreeBSD patches for linux_kdump-1.5_2 > =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=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 > add_pkg linux_base-gentoo-stage3-2006.0_2.tbz > adding dependencies > pkg_add linux_base-gentoo-stage3-2006.0_2.tbz > grep: /etc/fstab: No such file or directory >=20 > +++ Some programs may need the linprocfs, please add it to /etc/fstab! ++= + >=20 > Running linux ldconfig... >=20 > * The port/package has attempted to enable Linux compatibility mode by lo= ading > * the linux.ko kernel module. You can load the module manually as root w= ith the > * command "kldload linux" or have it load automatically at boot time by a= dding > * to /etc/rc.conf the line: > * > * linux_enable=3D"YES" > * > * You may wish to enable emulation of the Linux proc filesystem. See the > * linprocfs(5) man page. > * > * To download Portage, do "chroot /compat/linux/ emerge sync" as root. T= hen you > * may want to do "chroot /compat/linux/ /usr/portage/scripts/bootstrap.sh= " to > * rebuild binutils, gcc, gettext, and glibc. See > * or > * for more comp= lete=20 > * instructions. >=20 > =3D=3D=3D> linux_kdump-1.5_2 depends on file: /compat/linux/usr/bin/gcc= - found > =3D=3D=3D> Configuring for linux_kdump-1.5_2 > =3D=3D=3D> Building for linux_kdump-1.5_2 > Warning: Object directory not changed from original /work/a/ports/devel/l= inux_kdump/work/linux_kdump-1.5 > cc -O2 -fno-strict-aliasing -pipe -I/usr/src/usr.bin/ktrace -I/usr/src/u= sr.bin/kdump -I/usr/src -c kdump.c > kdump.c: In function 'main': > kdump.c:85: error: 'KTRFAC_STRUCT' undeclared (first use in this function= ) > kdump.c:85: error: (Each undeclared identifier is reported only once > kdump.c:85: error: for each function it appears in.) > *** Error code 1 >=20 > Stop in /work/a/ports/devel/linux_kdump/work/linux_kdump-1.5. > *** Error code 1 >=20 > Stop in /a/ports/devel/linux_kdump. > =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 > build of /usr/ports/devel/linux_kdump ended at Sun Aug 31 06:55:27 UTC 20= 08 --=20 Pav Lucistnik You can't expect to wield supreme executive power just 'cause some watery tart threw a sword at you. --=-Qyc38/Z5P1ZodAzF62wy Content-Type: application/pgp-signature; name=signature.asc Content-Description: Toto je =?UTF-8?Q?digit=C3=A1ln=C4=9B?= =?ISO-8859-1?Q?_podepsan=E1?= =?UTF-8?Q?_=C4=8D=C3=A1st?= =?ISO-8859-1?Q?_zpr=E1vy?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAki8QRMACgkQntdYP8FOsoIG9gCgkb/+35OS4uTrrfezLzxhSMmD ljsAnAuTYBGyY4NEL/K30ZAVx3UNctQZ =U3in -----END PGP SIGNATURE----- --=-Qyc38/Z5P1ZodAzF62wy-- From owner-freebsd-emulation@FreeBSD.ORG Tue Sep 2 08:56:12 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 56A0F106567C for ; Tue, 2 Sep 2008 08:56:12 +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 0BB238FC1B for ; Tue, 2 Sep 2008 08:56:12 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 3DCC165B5D9 for ; Tue, 2 Sep 2008 10:56:29 +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 RN+6sr4ZXQes for ; Tue, 2 Sep 2008 10:56:23 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id CE0BE65B47F for ; Tue, 2 Sep 2008 10:56:23 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m828uNSI012457 for freebsd-emulation@freebsd.org; Tue, 2 Sep 2008 10:56:23 +0200 (CEST) (envelope-from rdivacky) Date: Tue, 2 Sep 2008 10:56:23 +0200 From: Roman Divacky To: freebsd-emulation@freebsd.org Message-ID: <20080902085623.GA12395@freebsd.org> References: <20080822112927.GZ99951@hoeg.nl> <20080822112946.GA97526@freebsd.org> <20080831110610.GA2380@dchagin.dialup.corbina.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080831110610.GA2380@dchagin.dialup.corbina.ru> User-Agent: Mutt/1.4.2.3i Subject: Re: MPSAFE TTY: Linux PTY's 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: Tue, 02 Sep 2008 08:56:12 -0000 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? thnx! roman From owner-freebsd-emulation@FreeBSD.ORG Tue Sep 2 20:56:36 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 315A0106564A; Tue, 2 Sep 2008 20:56:36 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (farley.org [67.64.95.201]) by mx1.freebsd.org (Postfix) with ESMTP id EB90F8FC14; Tue, 2 Sep 2008 20:56:35 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (HPooka@thor.farley.org [192.168.1.5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id m82KuXIt095859; Tue, 2 Sep 2008 15:56:33 -0500 (CDT) (envelope-from scf@FreeBSD.org) Date: Tue, 2 Sep 2008 15:56:33 -0500 (CDT) From: "Sean C. Farley" To: Chagin Dmitry In-Reply-To: <20080830113448.GA2152@dchagin.dialup.corbina.ru> Message-ID: References: <20080830113448.GA2152@dchagin.dialup.corbina.ru> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-4.4 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: freebsd-emulation@FreeBSD.org Subject: Re: Linux applications core if running (k)qemu 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: Tue, 02 Sep 2008 20:56:36 -0000 On Sat, 30 Aug 2008, Chagin Dmitry wrote: > On Fri, Aug 29, 2008 at 05:29:09PM -0500, Sean C. Farley wrote: >> I am having trouble with kqemu.ko and linux.ko. If I run qemu with >> the following command, Linux applications (chroot, acroread, ls) will >> start core dumping: >> qemu-system-x86_64 -m 512 \ >> -drive file=/usr/QEMU/WinXP/c.img,if=ide,media=disk -boot c \ >> -std-vga -parallel none -serial none -monitor stdio \ >> -net nic,model=e1000 -net tap,ifname=tap0,script=no -localtime >> >> Loading kqemu.ko does not cause the problem, but the cores start a >> little after WinXP starts running. Unloading kqemu.ko does not help; >> the cores still happen but more randomly. I even tried unloading all >> linux modules and reloading them without luck. It takes a reboot. >> >> Packages: >> qemu-devel-0.9.1s.20080620_1 >> kqemu-kmod-devel-1.4.0.p1 >> linux_base-f8-8_4 >> >> sysctl: >> compat.linux.osrelease: 2.6.16 >> >> dmesg: >> kqemu version 0x00010400 >> kqemu: KQEMU installed, max_locked_mem=1792492kB. >> >> System is 7-STABLE as of r181963 with or without the patch to fix RT >> signals from Chagin. > > Interestingly... Sean, can you provide ktrace/kdump log of coring > apps? thnx! Here they are (good and bad): http://www.farley.org/freebsd/tmp/linuxulator_vs_kqemu/ The good trace is after the bad trace. I just kept running ktrace /compat/linux/bin/date over and over until I got a good trace. Before loading kqemu and running qemu, there were no core dumps. Also, I compared two bad traces and they were basically the same except for PID and a couple of addresses (still very close in value). Sean -- scf@FreeBSD.org From owner-freebsd-emulation@FreeBSD.ORG Wed Sep 3 10:00: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 606FB1065692 for ; Wed, 3 Sep 2008 10:00:31 +0000 (UTC) (envelope-from ghost-sw@yandex.ru) Received: from hosting.e4u.ru (hosting.e4u.ru [87.241.223.134]) by mx1.freebsd.org (Postfix) with ESMTP id 896D28FC19 for ; Wed, 3 Sep 2008 10:00:30 +0000 (UTC) (envelope-from ghost-sw@yandex.ru) Received: (qmail 17037 invoked from network); 3 Sep 2008 13:33:43 +0400 Received: from unknown (HELO SW) (87.241.252.6) by 87.241.223.134 with SMTP; 3 Sep 2008 13:33:43 +0400 Date: Wed, 3 Sep 2008 13:33:49 +0400 From: Mike Sw X-Mailer: The Bat! (v3.85.02) Professional X-Priority: 3 (Normal) Message-ID: <516693407.20080903133349@yandex.ru> To: freebsd-emulation@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SpamTest-Envelope-From: ghost-sw@yandex.ru X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 4977 [Sep 03 2008] X-SpamTest-Info: {received from trusted relay: common white list} X-SpamTest-Method: white ip list X-SpamTest-Rate: 0 X-SpamTest-Status: Trusted X-SpamTest-Status-Extended: trusted X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release Subject: VMware3 from ports on FreeBSD 7.0 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mike Sw List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2008 10:00:31 -0000 Hello There! I have a trouble with installing vmware3 from /usr/ports/emulators/vmware3 on FreeBSD 7.0 When I try to install I see this error: ... ... (some processes) ... ... /usr/ports/emulators/vmware3/work/vmware-distrib/vmmon-only/common/task.c In file included from /usr/ports/emulators/vmware3/work/vmware-distrib/vmmon-only/include/taskswitch.h:25, from /usr/ports/emulators/vmware3/work/vmware-distrib/vmmon-only/common/task.c:54: /usr/ports/emulators/vmware3/work/vmware-distrib/vmmon-only/include/vm_asm.h: In function 'Div643264': /usr/ports/emulators/vmware3/work/vmware-distrib/vmmon-only/include/vm_asm.h:1033: error: memory input 4 is not directly addressable *** Error code 1 Stop in /usr/ports/emulators/vmware3/work/vmware-distrib/vmmon-only. *** Error code 1 Stop in /usr/ports/emulators/vmware3/work/vmware-distrib/vmmon-only. *** Error code 1 Stop in /usr/ports/emulators/vmware3/work/vmware-distrib. *** Error code 1 Stop in /usr/ports/emulators/vmware3. *** Error code 1 Stop in /usr/ports/emulators/vmware3. [sw]# Also I've installed all of packages that VMware requires. Result is same. May be someone knows what is wrong here? Please help me with it or recommend another emulator :) Thank you... Mike From owner-freebsd-emulation@FreeBSD.ORG Sat Sep 6 10:47: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 59858106567E; Sat, 6 Sep 2008 10:47:08 +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 10AC28FC20; Sat, 6 Sep 2008 10:47:07 +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 8EA7119EA4B; Sat, 6 Sep 2008 14:47:05 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.dialup.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1077120508; Sat, 06 Sep 2008 14:47:05 +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 m86Al4k1002150; Sat, 6 Sep 2008 14:47:04 +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 m86Akx9m002149; Sat, 6 Sep 2008 14:46:59 +0400 (MSD) (envelope-from root) Date: Sat, 6 Sep 2008 14:46:59 +0400 From: Chagin Dmitry To: "Sean C. Farley" Message-ID: <20080906104659.GA2113@dchagin.dialup.corbina.ru> Mail-Followup-To: "Sean C. Farley" , freebsd-emulation@freebsd.org References: <20080830113448.GA2152@dchagin.dialup.corbina.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: Linux applications core if running (k)qemu 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, 06 Sep 2008 10:47:08 -0000 On Tue, Sep 02, 2008 at 03:56:33PM -0500, Sean C. Farley wrote: > On Sat, 30 Aug 2008, Chagin Dmitry wrote: > > >On Fri, Aug 29, 2008 at 05:29:09PM -0500, Sean C. Farley wrote: > >>I am having trouble with kqemu.ko and linux.ko. If I run qemu with > >>the following command, Linux applications (chroot, acroread, ls) will > >>start core dumping: > >> qemu-system-x86_64 -m 512 \ > >> -drive file=/usr/QEMU/WinXP/c.img,if=ide,media=disk -boot c \ > >> -std-vga -parallel none -serial none -monitor stdio \ > >> -net nic,model=e1000 -net tap,ifname=tap0,script=no -localtime > >> > >>Loading kqemu.ko does not cause the problem, but the cores start a > >>little after WinXP starts running. Unloading kqemu.ko does not help; > >>the cores still happen but more randomly. I even tried unloading all > >>linux modules and reloading them without luck. It takes a reboot. > >> > >>Packages: > >>qemu-devel-0.9.1s.20080620_1 > >>kqemu-kmod-devel-1.4.0.p1 > >>linux_base-f8-8_4 > >> > >>sysctl: > >>compat.linux.osrelease: 2.6.16 > >> > >>dmesg: > >>kqemu version 0x00010400 > >>kqemu: KQEMU installed, max_locked_mem=1792492kB. > >> > >>System is 7-STABLE as of r181963 with or without the patch to fix RT > >>signals from Chagin. > > > >Interestingly... Sean, can you provide ktrace/kdump log of coring > >apps? thnx! > > Here they are (good and bad): > http://www.farley.org/freebsd/tmp/linuxulator_vs_kqemu/ > > The good trace is after the bad trace. I just kept running ktrace > /compat/linux/bin/date over and over until I got a good trace. Before > loading kqemu and running qemu, there were no core dumps. Also, I > compared two bad traces and they were basically the same except for PID > and a couple of addresses (still very close in value). > Most likely it is a tls problem again, some days ago kib@ has made MFC r182684, probably it will help.. thnx! -- Have fun! chd From owner-freebsd-emulation@FreeBSD.ORG Sat Sep 6 16: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 3C2F31065670; Sat, 6 Sep 2008 16:08:07 +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 CFE708FC14; Sat, 6 Sep 2008 16:08:06 +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 1KbzjB-000HnM-Jv; Sat, 06 Sep 2008 18:29:33 +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 m86FTUEs005990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 6 Sep 2008 18:29:30 +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 m86FTUHE020414; Sat, 6 Sep 2008 18:29:30 +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 m86FTUE8020412; Sat, 6 Sep 2008 18:29:30 +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: Sat, 6 Sep 2008 18:29:30 +0300 From: Kostik Belousov To: "Sean C. Farley" , freebsd-emulation@freebsd.org Message-ID: <20080906152929.GB2038@deviant.kiev.zoral.com.ua> References: <20080830113448.GA2152@dchagin.dialup.corbina.ru> <20080906104659.GA2113@dchagin.dialup.corbina.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FG2vzoPGYsbT0vfz" Content-Disposition: inline In-Reply-To: <20080906104659.GA2113@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 1KbzjB-000HnM-Jv dcf5e33396c93702a2d45d508c02f903 X-Terabit: YES Cc: Subject: Re: Linux applications core if running (k)qemu 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, 06 Sep 2008 16:08:07 -0000 --FG2vzoPGYsbT0vfz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 06, 2008 at 02:46:59PM +0400, Chagin Dmitry wrote: > On Tue, Sep 02, 2008 at 03:56:33PM -0500, Sean C. Farley wrote: > > On Sat, 30 Aug 2008, Chagin Dmitry wrote: > >=20 > > >On Fri, Aug 29, 2008 at 05:29:09PM -0500, Sean C. Farley wrote: > > >>I am having trouble with kqemu.ko and linux.ko. If I run qemu with > > >>the following command, Linux applications (chroot, acroread, ls) will > > >>start core dumping: > > >> qemu-system-x86_64 -m 512 \ > > >> -drive file=3D/usr/QEMU/WinXP/c.img,if=3Dide,media=3Ddisk -boot c= \ > > >> -std-vga -parallel none -serial none -monitor stdio \ > > >> -net nic,model=3De1000 -net tap,ifname=3Dtap0,script=3Dno -localt= ime > > >> > > >>Loading kqemu.ko does not cause the problem, but the cores start a > > >>little after WinXP starts running. Unloading kqemu.ko does not help; > > >>the cores still happen but more randomly. I even tried unloading all > > >>linux modules and reloading them without luck. It takes a reboot. > > >> > > >>Packages: > > >>qemu-devel-0.9.1s.20080620_1 > > >>kqemu-kmod-devel-1.4.0.p1 > > >>linux_base-f8-8_4 > > >> > > >>sysctl: > > >>compat.linux.osrelease: 2.6.16 > > >> > > >>dmesg: > > >>kqemu version 0x00010400 > > >>kqemu: KQEMU installed, max_locked_mem=3D1792492kB. > > >> > > >>System is 7-STABLE as of r181963 with or without the patch to fix RT > > >>signals from Chagin. > > > > > >Interestingly... Sean, can you provide ktrace/kdump log of coring > > >apps? thnx! > >=20 > > Here they are (good and bad): > > http://www.farley.org/freebsd/tmp/linuxulator_vs_kqemu/ > >=20 > > The good trace is after the bad trace. I just kept running ktrace > > /compat/linux/bin/date over and over until I got a good trace. Before > > loading kqemu and running qemu, there were no core dumps. Also, I > > compared two bad traces and they were basically the same except for PID > > and a couple of addresses (still very close in value). > >=20 >=20 > Most likely it is a tls problem again, some days ago kib@ has made MFC > r182684, probably it will help.. I doubt it. This seems to be an ingenious kqemu bug. As far as I remember, it tries to use GDT/LDT. This probably has unwanted interaction with PCB_GS32BIT. --FG2vzoPGYsbT0vfz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjCodkACgkQC3+MBN1Mb4iYxACg0d0rGWlatJiR9+2E1ztZhq61 nsoAn2J3SrQL1vvW+9ChYKoaFTheHtfA =mfmx -----END PGP SIGNATURE----- --FG2vzoPGYsbT0vfz-- From owner-freebsd-emulation@FreeBSD.ORG Sat Sep 6 22:17:29 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 C02D5106566C for ; Sat, 6 Sep 2008 22:17:29 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.freebsd.org (Postfix) with ESMTP id 4CAAC8FC18 for ; Sat, 6 Sep 2008 22:17:29 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: by gwyn.kn-bremen.de (Postfix, from userid 10) id 1B7B3191A30; Sun, 7 Sep 2008 00:17:26 +0200 (CEST) Received: from saturn.kn-bremen.de (nox@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.14.2/8.13.8) with ESMTP id m86MF6GD040798; Sun, 7 Sep 2008 00:15:06 +0200 (CEST) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.14.2/8.13.6/Submit) id m86MF6NS040797; Sun, 7 Sep 2008 00:15:06 +0200 (CEST) (envelope-from nox) Date: Sun, 7 Sep 2008 00:15:06 +0200 (CEST) From: Juergen Lock Message-Id: <200809062215.m86MF6NS040797@saturn.kn-bremen.de> To: kostikbel@gmail.com X-Newsgroups: local.list.freebsd.emulation In-Reply-To: <20080906152929.GB2038@deviant.kiev.zoral.com.ua> References: <20080830113448.GA2152@dchagin.dialup.corbina.ru> <20080906104659.GA2113@dchagin.dialup.corbina.ru> Organization: home Cc: freebsd-emulation@freebsd.org Subject: Re: Linux applications core if running (k)qemu 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, 06 Sep 2008 22:17:29 -0000 In article <20080906152929.GB2038@deviant.kiev.zoral.com.ua> you write: >-=-=-=-=-=- > >On Sat, Sep 06, 2008 at 02:46:59PM +0400, Chagin Dmitry wrote: >> On Tue, Sep 02, 2008 at 03:56:33PM -0500, Sean C. Farley wrote: >> > On Sat, 30 Aug 2008, Chagin Dmitry wrote: >> > >> > >On Fri, Aug 29, 2008 at 05:29:09PM -0500, Sean C. Farley wrote: >> > >>I am having trouble with kqemu.ko and linux.ko. If I run qemu with >> > >>the following command, Linux applications (chroot, acroread, ls) will >> > >>start core dumping: >> > >> qemu-system-x86_64 -m 512 \ >> > >> -drive file=/usr/QEMU/WinXP/c.img,if=ide,media=disk -boot c \ >> > >> -std-vga -parallel none -serial none -monitor stdio \ >> > >> -net nic,model=e1000 -net tap,ifname=tap0,script=no -localtime >> > >> >> > >>Loading kqemu.ko does not cause the problem, but the cores start a >> > >>little after WinXP starts running. Unloading kqemu.ko does not help; >> > >>the cores still happen but more randomly. I even tried unloading all >> > >>linux modules and reloading them without luck. It takes a reboot. >> > >> >> > >>Packages: >> > >>qemu-devel-0.9.1s.20080620_1 >> > >>kqemu-kmod-devel-1.4.0.p1 >> > >>linux_base-f8-8_4 >> > >> >> > >>sysctl: >> > >>compat.linux.osrelease: 2.6.16 >> > >> >> > >>dmesg: >> > >>kqemu version 0x00010400 >> > >>kqemu: KQEMU installed, max_locked_mem=1792492kB. >> > >> >> > >>System is 7-STABLE as of r181963 with or without the patch to fix RT >> > >>signals from Chagin. >> > > >> > >Interestingly... Sean, can you provide ktrace/kdump log of coring >> > >apps? thnx! >> > >> > Here they are (good and bad): >> > http://www.farley.org/freebsd/tmp/linuxulator_vs_kqemu/ >> > >> > The good trace is after the bad trace. I just kept running ktrace >> > /compat/linux/bin/date over and over until I got a good trace. Before >> > loading kqemu and running qemu, there were no core dumps. Also, I >> > compared two bad traces and they were basically the same except for PID >> > and a couple of addresses (still very close in value). >> > >> >> Most likely it is a tls problem again, some days ago kib@ has made MFC >> r182684, probably it will help.. > >I doubt it. This seems to be an ingenious kqemu bug. As far as I remember, >it tries to use GDT/LDT. This probably has unwanted interaction with >PCB_GS32BIT. Wow. That corner of the code had escaped me so far, and yes this (in amd64/linux32) looks like it won't like kqemu's seperating of the gdts on SMP indeed. (it stores a pointer to &gdt[GUGS32_SEL] in pcb_gs32p and lets linux processes manipulate the segment pointed to by it, and when kqemu is (or was) running this won't be used by all cpus, see older threads like http://lists.freebsd.org/pipermail/freebsd-emulation/2008-May/004902.html for the reasons.) What I wonder tho is, won't this also cause problems without kqemu when there are linux processes running on multiple cpus that manipulate this segment because the gdt is then shared between the cpus? (like, linux process on cpu 0 changes the segment, then linux process on cpu 1 comes along and changes it again and then the linux process on cpu 0 will pick it up from cpu 1?) At least I must have somehow assumed the shared gdt wouldn't be changed later because of reasons like this... Anyway, fixing this will require changes to the kernel, I don't see how kqemu could fix it by itself alone. :( Sorry, Juergen