From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 18 13:17:15 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 855DB106566C; Sun, 18 Oct 2009 13:17:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 820628FC08; Sun, 18 Oct 2009 13:17:14 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n9IDGxKG054567 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Oct 2009 16:16:59 +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.3/8.14.3) with ESMTP id n9IDGxSX025562; Sun, 18 Oct 2009 16:16:59 +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 n9IDGu1q025561; Sun, 18 Oct 2009 16:16:56 +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, 18 Oct 2009 16:16:56 +0300 From: Kostik Belousov To: Andrew Gallatin Message-ID: <20091018131656.GP2160@deviant.kiev.zoral.com.ua> References: <4AD79126.8020104@cs.duke.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zROEGoKAXsG5UqGB" Content-Disposition: inline In-Reply-To: <4AD79126.8020104@cs.duke.edu> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, sam@freebsd.org Subject: Re: namei (via firmware_get(9)) from taskq in 7.x X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 13:17:15 -0000 --zROEGoKAXsG5UqGB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 15, 2009 at 05:16:22PM -0400, Andrew Gallatin wrote: > Hi, >=20 > I'm trying to re-initialize a NIC which uses firmware(9) > after a hardware fault. As part of the process, I need > to re-load the firmware using firmware_get(). If the > firmware kld is not resident, then the machine will panic > like this: >=20 > Fatal trap 12: page fault while in kernel mode > cpuid =3D 0; apic id =3D 00 > fault virtual address =3D 0x20 > fault code =3D supervisor read data, page not present > instruction pointer =3D 0x8:0xffffffff805b05d4 > stack pointer =3D 0x10:0xffffff8000080460 > frame pointer =3D 0x10:0xffffff8000080510 > code segment =3D base 0x0, limit 0xfffff, type 0x1b > =3D DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags =3D interrupt enabled, resume, IOPL =3D 0 > current process =3D 21 (swi5: +) > [thread pid 21 tid 100021 ] > Stopped at namei+0x174: movq 0x20(%rbx),%rax > db> bt > Tracing pid 21 tid 100021 td 0xffffff00013c3ae0 > namei() at namei+0x174 > vn_open_cred() at vn_open_cred+0x3a4 > linker_load_module() at linker_load_module+0x1f2 > linker_reference_module() at linker_reference_module+0xae > firmware_get() at firmware_get+0x136 > mxge_load_firmware() at mxge_load_firmware+0x2d > mxge_watchdog_task() at mxge_watchdog_task+0x2f6 > taskqueue_run() at taskqueue_run+0x9d > ithread_loop() at ithread_loop+0x17d > fork_exit() at fork_exit+0x11f > fork_trampoline() at fork_trampoline+0xe >=20 > Looking at it in gdb, it seems like the problem is that namei > is trying to use ndp->ni_cnd.cn_thread->td_proc->p_fd->fd_cdir > which is null in this context. >=20 > Can somebody tell me what kernel context it is safe to > call firmware_get() (and hence namei) from? Is there > a safe way to do it from a taskq? >=20 > FWIW, this seems to work fine (even from a callout context) > in 8 and higher. It is only 7 and earlier where I'm having > this problem. It seems that you want a merge of r178042,183614,184842,188057 (one of which is yours). Property changes on: . ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys:r178042,183614,184842,188057 Index: kern/subr_firmware.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 --- kern/subr_firmware.c (revision 198202) +++ kern/subr_firmware.c (working copy) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005, Sam Leffler + * Copyright (c) 2005-2008, Sam Leffler * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,11 @@ #include #include #include +#include =20 +#include +#include + /* * Loadable firmware support. See sys/sys/firmware.h and firmware(9) * form more details on the subsystem. @@ -89,7 +93,7 @@ /* * 'file' is private info managed by the autoload/unload code. * Set at the end of firmware_get(), cleared only in the - * firmware_task, so the latter can depend on its value even + * firmware_unload_task, so the latter can depend on its value even * while the lock is not held. */ linker_file_t file; /* module file, if autoloaded */ @@ -121,14 +125,16 @@ static struct priv_fw firmware_table[FIRMWARE_MAX]; =20 /* - * module release are handled in a separate task as they might sleep. + * Firmware module operations are handled in a separate task as they + * might sleep and they require directory context to do i/o. */ -struct task firmware_task; +static struct taskqueue *firmware_tq; +static struct task firmware_unload_task; =20 /* * This mutex protects accesses to the firmware table. */ -struct mtx firmware_mtx; +static struct mtx firmware_mtx; MTX_SYSINIT(firmware, &firmware_mtx, "firmware table", MTX_DEF); =20 /* @@ -227,7 +233,7 @@ } else if (fp->refcnt !=3D 0) { /* cannot unregister */ err =3D EBUSY; } else { - linker_file_t x =3D fp->file; /* save value */ + linker_file_t x =3D fp->file; /* save value */ =20 if (fp->parent !=3D NULL) /* release parent reference */ fp->parent->refcnt--; @@ -244,6 +250,47 @@ return err; } =20 +static void +loadimage(void *arg, int npending) +{ + struct thread *td =3D curthread; + char *imagename =3D arg; + struct priv_fw *fp; + linker_file_t result; + int error; + + /* synchronize with the thread that dispatched us */ + mtx_lock(&firmware_mtx); + mtx_unlock(&firmware_mtx); + + if (td->td_proc->p_fd->fd_rdir =3D=3D NULL) { + printf("%s: root not mounted yet, no way to load image\n", + imagename); + goto done; + } + error =3D linker_reference_module(imagename, NULL, &result); + if (error !=3D 0) { + printf("%s: could not load firmware image, error %d\n", + imagename, error); + goto done; + } + + mtx_lock(&firmware_mtx); + fp =3D lookup(imagename, NULL); + if (fp =3D=3D NULL || fp->file !=3D NULL) { + mtx_unlock(&firmware_mtx); + if (fp =3D=3D NULL) + printf("%s: firmware image loaded, " + "but did not register\n", imagename); + (void) linker_release_module(imagename, NULL, NULL); + goto done; + } + fp->file =3D result; /* record the module identity */ + mtx_unlock(&firmware_mtx); +done: + wakeup_one(imagename); /* we're done */ +} + /* * Lookup and potentially load the specified firmware image. * If the firmware is not found in the registry, try to load a kernel @@ -254,9 +301,9 @@ const struct firmware * firmware_get(const char *imagename) { + struct task fwload_task; struct thread *td; struct priv_fw *fp; - linker_file_t result; =20 mtx_lock(&firmware_mtx); fp =3D lookup(imagename, NULL); @@ -265,29 +312,34 @@ /* * Image not present, try to load the module holding it. */ - mtx_unlock(&firmware_mtx); td =3D curthread; if (priv_check(td, PRIV_FIRMWARE_LOAD) !=3D 0 || securelevel_gt(td->td_ucred, 0) !=3D 0) { + mtx_unlock(&firmware_mtx); printf("%s: insufficient privileges to " "load firmware image %s\n", __func__, imagename); return NULL; } - (void) linker_reference_module(imagename, NULL, &result); + /*=20 + * Defer load to a thread with known context. linker_reference_module + * may do filesystem i/o which requires root & current dirs, etc. + * Also we must not hold any mtx's over this call which is problematic. + */ + if (!cold) { + TASK_INIT(&fwload_task, 0, loadimage, __DECONST(void *, + imagename)); + taskqueue_enqueue(firmware_tq, &fwload_task); + msleep(__DECONST(void *, imagename), &firmware_mtx, 0, + "fwload", 0); + } /* - * After loading the module, see if the image is registered now. + * After attempting to load the module, see if the image is registered. */ - mtx_lock(&firmware_mtx); fp =3D lookup(imagename, NULL); if (fp =3D=3D NULL) { mtx_unlock(&firmware_mtx); - printf("%s: failed to load firmware image %s\n", - __func__, imagename); - (void) linker_release_module(imagename, NULL, NULL); return NULL; } - fp->file =3D result; /* record the module identity */ - found: /* common exit point on success */ fp->refcnt++; mtx_unlock(&firmware_mtx); @@ -300,8 +352,8 @@ * to release the resource, but the flag is only advisory. * * If this is the last reference to the firmware image, and this is an - * autoloaded module, wake up the firmware_task to figure out what to do - * with the associated module. + * autoloaded module, wake up the firmware_unload_task to figure out + * what to do with the associated module. */ void firmware_put(const struct firmware *p, int flags) @@ -314,12 +366,53 @@ if (flags & FIRMWARE_UNLOAD) fp->flags |=3D FW_UNLOAD; if (fp->file) - taskqueue_enqueue(taskqueue_thread, &firmware_task); + taskqueue_enqueue(firmware_tq, &firmware_unload_task); } mtx_unlock(&firmware_mtx); } =20 /* + * Setup directory state for the firmware_tq thread so we can do i/o. + */ +static void +set_rootvnode(void *arg, int npending) +{ + struct thread *td =3D curthread; + struct proc *p =3D td->td_proc; + + FILEDESC_XLOCK(p->p_fd); + if (p->p_fd->fd_cdir =3D=3D NULL) { + p->p_fd->fd_cdir =3D rootvnode; + VREF(rootvnode); + } + if (p->p_fd->fd_rdir =3D=3D NULL) { + p->p_fd->fd_rdir =3D rootvnode; + VREF(rootvnode); + } + FILEDESC_XUNLOCK(p->p_fd); + + free(arg, M_TEMP); +} + +/* + * Event handler called on mounting of /; bounce a task + * into the task queue thread to setup it's directories. + */ +static void +firmware_mountroot(void *arg) +{ + struct task *setroot_task; + + setroot_task =3D malloc(sizeof(struct task), M_TEMP, M_NOWAIT); + if (setroot_task !=3D NULL) { + TASK_INIT(setroot_task, 0, set_rootvnode, setroot_task); + taskqueue_enqueue(firmware_tq, setroot_task); + } else + printf("%s: no memory for task!\n", __func__); +} +EVENTHANDLER_DEFINE(mountroot, firmware_mountroot, NULL, 0); + +/* * The body of the task in charge of unloading autoloaded modules * that are not needed anymore. * Images can be cross-linked so we may need to make multiple passes, @@ -383,11 +476,23 @@ firmware_modevent(module_t mod, int type, void *unused) { struct priv_fw *fp; - int i, err =3D EINVAL; + int i, err; =20 switch (type) { case MOD_LOAD: - TASK_INIT(&firmware_task, 0, unloadentry, NULL); + TASK_INIT(&firmware_unload_task, 0, unloadentry, NULL); + firmware_tq =3D taskqueue_create("taskqueue_firmware", M_WAITOK, + taskqueue_thread_enqueue, &firmware_tq); + /* NB: use our own loop routine that sets up context */ + (void) taskqueue_start_threads(&firmware_tq, 1, PWAIT, + "firmware taskq"); + if (rootvnode !=3D NULL) { + /*=20 + * Root is already mounted so we won't get an event; + * simulate one here. + */ + firmware_mountroot(NULL); + } return 0; =20 case MOD_UNLOAD: @@ -398,8 +503,9 @@ fp->flags |=3D FW_UNLOAD;; } mtx_unlock(&firmware_mtx); - taskqueue_enqueue(taskqueue_thread, &firmware_task); - taskqueue_drain(taskqueue_thread, &firmware_task); + taskqueue_enqueue(firmware_tq, &firmware_unload_task); + taskqueue_drain(firmware_tq, &firmware_unload_task); + err =3D 0; for (i =3D 0; i < FIRMWARE_MAX; i++) { fp =3D &firmware_table[i]; if (fp->fw.name !=3D NULL) { @@ -409,6 +515,8 @@ err =3D EINVAL; } } + if (err =3D=3D 0) + taskqueue_free(firmware_tq); return err; } return EINVAL; @@ -417,7 +525,7 @@ static moduledata_t firmware_mod =3D { "firmware", firmware_modevent, - 0 + NULL }; DECLARE_MODULE(firmware, firmware_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); MODULE_VERSION(firmware, 1); Property changes on: kern/subr_firmware.c ___________________________________________________________________ Modified: cvs2svn:cvs-rev - 1.9 + 1.10 Index: kern/subr_prf.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 --- kern/subr_prf.c (revision 198202) +++ kern/subr_prf.c (working copy) @@ -955,7 +955,7 @@ } =20 SYSCTL_PROC(_kern, OID_AUTO, msgbuf, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, sysctl_kern_msgbuf, "A", "Contents of kernel message buffer"); + NULL, 0, sysctl_kern_msgbuf, "A", "Contents of kernel message buffer"); =20 static int msgbuf_clearflag; =20 Property changes on: contrib/pf ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/contrib/pf:r178042,183614,184842,188057 --zROEGoKAXsG5UqGB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrbFUgACgkQC3+MBN1Mb4g+lACfe8ghbHFVpCw/3L365t368NJ8 JpgAoJpaK9a2kKCBSUveUn4CcjsudYcU =pYL2 -----END PGP SIGNATURE----- --zROEGoKAXsG5UqGB-- From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 18 15:59:44 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 171311065741 for ; Sun, 18 Oct 2009 15:59:44 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by mx1.freebsd.org (Postfix) with ESMTP id 9B3638FC16 for ; Sun, 18 Oct 2009 15:59:43 +0000 (UTC) Received: by ewy18 with SMTP id 18so3169078ewy.43 for ; Sun, 18 Oct 2009 08:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:cc:subject:references :organization:from:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=KxC9g/8xOUF8iTbZa4br3aRofIjz+CE0Ju5BqnqtEBc=; b=TOwrxo9r/xC7cnxnfuUaygF7Gws0TD9qIHTwtEt0+F/w6P7DMl5/h4pwPKUjc+cwzc e8cPM1W8Wm/KhuNsU3Hyr4Z35fw7xMH2vDG/d8yF/XNJq9d7G8SU3LLUjuVn+YUt2UPC i5gzI1QvqmjRAImQUIJ72AnyIfmRZp4WRFc+o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:cc:subject:references:organization:from:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=B1xmo6LL5U9VLxK8FmZGDJvK+cc8N2uQHNIFngqc6h2QFeRonMnG3UXRlu8Y2TDTSo Gpv3mTIsB0CJCgTkOt2O5RtsJ4aqu7kM/dEiTm45UAgG83ixbksXfj+Uh/whRzyZ/d7x 3K41aEopUiAiw2wirT/JRWDCJd4WxtmpmIiYg= Received: by 10.210.154.9 with SMTP id b9mr3628574ebe.34.1255881582577; Sun, 18 Oct 2009 08:59:42 -0700 (PDT) Received: from localhost (vpn-193-138-133-202.customer.onet.com.ua [193.138.133.202]) by mx.google.com with ESMTPS id 23sm4547239eya.12.2009.10.18.08.59.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 18 Oct 2009 08:59:41 -0700 (PDT) To: Alexander Best References: Organization: TOA Ukraine From: Mikolaj Golub Date: Sun, 18 Oct 2009 18:59:38 +0300 In-Reply-To: (Alexander Best's message of "Tue\, 13 Oct 2009 22\:50\:44 +0200 \(CEST\)") Message-ID: <86vdicg0b9.fsf@kopusha.onet> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@FreeBSD.org Subject: Re: crashtar X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 15:59:44 -0000 On Tue, 13 Oct 2009 22:50:44 +0200 (CEST) Alexander Best wrote: AB> again: great script. would be great to have this in the ports dir in the near AB> future. I have created separate google project for this script http://code.google.com/p/bsdcrashtar/ And submitted to ports http://www.freebsd.org/cgi/query-pr.cgi?pr=139721 BTW, many things in the script have been improved since I posted it here, and user friendly error output is among them :-). -- Mikolaj Golub From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 18 20:11:11 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A06291065693; Sun, 18 Oct 2009 20:11:11 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id ACFC18FC2B; Sun, 18 Oct 2009 20:11:10 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA17362; Sun, 18 Oct 2009 23:11:08 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Mzc5s-000FSW-8A; Sun, 18 Oct 2009 23:11:08 +0300 Message-ID: <4ADB764C.2010900@icyb.net.ua> Date: Sun, 18 Oct 2009 23:10:52 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090823) MIME-Version: 1.0 To: freebsd-acpi@freebsd.org, freebsd-hackers@freebsd.org X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: SB7xx watchdog: new driver for review and testing X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 20:11:11 -0000 Please review and/or test a new driver for watchdog driver included into AMD SB7xx: http://people.freebsd.org/~avg/amdsbwd.tgz I have tested this driver only with SB700 on Gigabyte GA-MA780G-UD3H motherboard. ichwd driver was used as a starting point for this driver. This can be seen from some function names, general code organization and some small code snippets. Many thanks to ichwd authors and maintainers! Right now I have infrastructure only for building this driver as a module. Things for which that I need the most feedback/ideas: 1. If the driver actually works on your hardware and the hardware description. The driver can be tested by loading the driver and doing 'watchdog -t '. Having debug.bootverbose=1 may provide additional useful info. And better to test this from single-user mode with filesystems mounted r/o. 2. Better name for the driver. amdsbwd stands for "AMD S(outh)B(ridge) WatchDog", but this abbreviation could be cryptic to decipher. 3. Proper location for this driver. At least on my system this driver needs resources (I/O ports and MEM range) that are claimed by ACPI, thus I've made it a child of acpi bus. But this driver doesn't have anything else ACPI-ish in it, so I decided that it doesn't belong under acpica/ or acpi_support/. Am I correct about this? Anything else you would like to report or comment or advise to me. Thank you very much for your help. -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 18 20:15:10 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 243BA1065698; Sun, 18 Oct 2009 20:15:10 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1A8448FC15; Sun, 18 Oct 2009 20:15:08 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA17430; Sun, 18 Oct 2009 23:15:07 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Mzc9j-000FSr-7B; Sun, 18 Oct 2009 23:15:07 +0300 Message-ID: <4ADB773C.8090600@freebsd.org> Date: Sun, 18 Oct 2009 23:14:52 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090823) MIME-Version: 1.0 To: freebsd-acpi@freebsd.org, freebsd-hackers@freebsd.org References: <4ADB764C.2010900@icyb.net.ua> In-Reply-To: <4ADB764C.2010900@icyb.net.ua> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: SB7xx watchdog: new driver for review and testing X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 20:15:10 -0000 on 18/10/2009 23:10 Andriy Gapon said the following: > Please review and/or test a new driver for watchdog driver included into AMD ^^^^^^^^^-hardware Oh, and please note things marked with XXX and TODO in the code. -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 18 20:28:43 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD781106566B for ; Sun, 18 Oct 2009 20:28:43 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id CED3F8FC19 for ; Sun, 18 Oct 2009 20:28:42 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA17611; Sun, 18 Oct 2009 23:28:40 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1MzcMq-000FTs-89; Sun, 18 Oct 2009 23:28:40 +0300 Message-ID: <4ADB7A68.9090906@icyb.net.ua> Date: Sun, 18 Oct 2009 23:28:24 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090823) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Ed Schouten Subject: special key (combo) for switching to K_XLATE X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 20:28:43 -0000 Guys, please take a look at the following hackish ugly code. This is just a proof of concept. It allows me to use an extended multimedia key (that generates 0xe0 0x32 code sequence) on my keyboard to break out of K_RAW into K_XLATE. The code is slightly tested and seems to work. It allowed me to switch out of X terminal to a normal console terminal when X server hanged. Then I could kill X and relatively easily recover from the situation that previously require either a remote access (e.g. through network) or a reboot. What do you think about having such a capability in syscons? Of course, the mode switch should be triggered by some key combination is possible to produce on any/most supported keyboards and also should be hard to press by accident. Note that I haven't (again) checked this code with WITNESS. diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index d158f85..e543765 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -3127,6 +3127,7 @@ scgetc(sc_softc_t *sc, u_int flags) #endif u_int c; int this_scr; + static int e0 = 0; int f; int i; @@ -3159,8 +3160,22 @@ next_code: if (!(flags & SCGETC_CN)) random_harvest(&c, sizeof(c), 1, 0, RANDOM_KEYBOARD); - if (scp->kbd_mode != K_XLATE) + if (scp->kbd_mode != K_XLATE) { + if (scp->kbd_mode == K_RAW) { + if (e0) { + e0 = 0; + if (KEYCHAR(c) == 0x32) { + printf("kbd_mode: %d => %d\n", scp->kbd_mode, K_XLATE); + scp->kbd_mode = K_XLATE; + kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + return NOKEY; + } + } + else if (KEYCHAR(c) == 0xe0) + e0 = 1; + } return KEYCHAR(c); + } /* if scroll-lock pressed allow history browsing */ if (!ISGRAPHSC(scp) && scp->history && scp->status & SLKED) { -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 11:17:26 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D04411065679; Mon, 19 Oct 2009 11:17:26 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by mx1.freebsd.org (Postfix) with ESMTP id 38E558FC18; Mon, 19 Oct 2009 11:17:25 +0000 (UTC) Received: by fxm18 with SMTP id 18so4902497fxm.37 for ; Mon, 19 Oct 2009 04:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=2XJ3S1ZDhInOZK5OjBecgSoAnc3Q5PuamF509Z4i/EU=; b=KUKSTbRJazWtkcLoRppIzS4Ct3VNEp3V2cOmdJ03C99lh7kpxnaZApx0lC6GflVrRH IzMKFhlDj0PTmWIpt8YKRQ6r7a9pBHUIy80I+BRthzmh+KTYzLkdhvj1E5URq11FiIWh RyAHd4bfV3ri6xm5c3GcasPi3HLDGDHynTfxo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=Oj1Qu6bu+xFa/1BrOx13hcZcPmIbwJRJ+TJJb/ErM5av6NBRQd+L99CFPPgU+uVnfX wfruC0pQbjlRwUxM2xtvjYz+b+iukQtp3etxQLee9wuE5cwyuc7pGR69NCqs5QAGT1CB s5hfZGXn8zV3KeLcJvqy8e6EkLMhaGj6mQSWQ= Received: by 10.204.15.3 with SMTP id i3mr4744738bka.71.1255951045080; Mon, 19 Oct 2009 04:17:25 -0700 (PDT) Received: from mac-mini.lan (bl6-159-136.dsl.telepac.pt [82.155.159.136]) by mx.google.com with ESMTPS id 13sm589223bwz.14.2009.10.19.04.17.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Oct 2009 04:17:24 -0700 (PDT) Sender: Rui Paulo Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Rui Paulo In-Reply-To: <4ADB764C.2010900@icyb.net.ua> Date: Mon, 19 Oct 2009 12:17:22 +0100 Content-Transfer-Encoding: 7bit Message-Id: <5E0DD277-CAA3-4F01-8561-35CF6C511718@freebsd.org> References: <4ADB764C.2010900@icyb.net.ua> To: Andriy Gapon X-Mailer: Apple Mail (2.1076) Cc: freebsd-hackers@freebsd.org, freebsd-acpi@freebsd.org Subject: Re: SB7xx watchdog: new driver for review and testing X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 11:17:27 -0000 On 18 Oct 2009, at 21:10, Andriy Gapon wrote: > Please review and/or test a new driver for watchdog driver included > into AMD SB7xx: > http://people.freebsd.org/~avg/amdsbwd.tgz > I have tested this driver only with SB700 on Gigabyte GA-MA780G-UD3H > motherboard. > > ichwd driver was used as a starting point for this driver. This can > be seen from > some function names, general code organization and some small code > snippets. > Many thanks to ichwd authors and maintainers! > > Right now I have infrastructure only for building this driver as a > module. > > Things for which that I need the most feedback/ideas: > 1. If the driver actually works on your hardware and the hardware > description. > The driver can be tested by loading the driver and doing 'watchdog - > t number>'. Having debug.bootverbose=1 may provide additional useful > info. > And better to test this from single-user mode with filesystems > mounted r/o. > > 2. Better name for the driver. amdsbwd stands for "AMD S(outh)B(ridge) > WatchDog", but this abbreviation could be cryptic to decipher. > > 3. Proper location for this driver. > At least on my system this driver needs resources (I/O ports and MEM > range) that > are claimed by ACPI, thus I've made it a child of acpi bus. But this > driver > doesn't have anything else ACPI-ish in it, so I decided that it > doesn't belong > under acpica/ or acpi_support/. Am I correct about this? > > Anything else you would like to report or comment or advise to me. > Thank you very much for your help. The driver looks good in general. A few questions: - Can you make the magic numbers a define ? Where did they come from ? - Are you missing a device_set_desc() call ? - If this is what you want to commit, C++ comments are not allowed per- style Regards, -- Rui Paulo From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 11:23:43 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5391106566B; Mon, 19 Oct 2009 11:23:43 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8DEBB8FC21; Mon, 19 Oct 2009 11:23:42 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA01763; Mon, 19 Oct 2009 14:23:40 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4ADC4C3C.3000007@icyb.net.ua> Date: Mon, 19 Oct 2009 14:23:40 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Rui Paulo References: <4ADB764C.2010900@icyb.net.ua> <5E0DD277-CAA3-4F01-8561-35CF6C511718@freebsd.org> In-Reply-To: <5E0DD277-CAA3-4F01-8561-35CF6C511718@freebsd.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-acpi@freebsd.org Subject: Re: SB7xx watchdog: new driver for review and testing X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 11:23:43 -0000 on 19/10/2009 14:17 Rui Paulo said the following: > On 18 Oct 2009, at 21:10, Andriy Gapon wrote: > >> Please review and/or test a new driver for watchdog driver included >> into AMD SB7xx: >> http://people.freebsd.org/~avg/amdsbwd.tgz >> I have tested this driver only with SB700 on Gigabyte GA-MA780G-UD3H >> motherboard. >> >> ichwd driver was used as a starting point for this driver. This can be >> seen from >> some function names, general code organization and some small code >> snippets. >> Many thanks to ichwd authors and maintainers! >> >> Right now I have infrastructure only for building this driver as a >> module. >> >> Things for which that I need the most feedback/ideas: >> 1. If the driver actually works on your hardware and the hardware >> description. >> The driver can be tested by loading the driver and doing 'watchdog -t >> > number>'. Having debug.bootverbose=1 may provide additional useful info. >> And better to test this from single-user mode with filesystems mounted >> r/o. >> >> 2. Better name for the driver. amdsbwd stands for "AMD S(outh)B(ridge) >> WatchDog", but this abbreviation could be cryptic to decipher. >> >> 3. Proper location for this driver. >> At least on my system this driver needs resources (I/O ports and MEM >> range) that >> are claimed by ACPI, thus I've made it a child of acpi bus. But this >> driver >> doesn't have anything else ACPI-ish in it, so I decided that it >> doesn't belong >> under acpica/ or acpi_support/. Am I correct about this? >> >> Anything else you would like to report or comment or advise to me. >> Thank you very much for your help. > > The driver looks good in general. A few questions: > - Can you make the magic numbers a define ? Where did they come from ? Yes, will do this. The numbers are from register definitions in AMD SB700/710/750 Register Reference Guide: http://developer.amd.com/assets/43009_sb7xx_rrg_pub_1.00.pdf I will add a link to the document too. > - Are you missing a device_set_desc() call ? Yes, I missed this. Thanks! > - If this is what you want to commit, C++ comments are not allowed > per-style Those lines were a result of quick hacking. I will remove them altogether, -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 12:41:29 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 829891065695; Mon, 19 Oct 2009 12:41:29 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 380DE8FC18; Mon, 19 Oct 2009 12:41:29 +0000 (UTC) Received: from [172.31.193.10] (cpe-069-134-110-200.nc.res.rr.com [69.134.110.200]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id n9JCfSH6003343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Oct 2009 08:41:28 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu n9JCfSH6003343 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1255956088; bh=tDq9VFpajHOZdv+qfUFfMLluzYNvSGBcSupjVVqSt04=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=HGelsTKdh84QAtei/WdewqQUlbqJv7y5GgNx21/wbrvcI7bMvAO7QIzvgP1DCupxM 0Y0BaTgHngzt/QS90uefYb9x3K9bKGwOC59jWmT//PyoVc9onk+FRpq+Sve6yWTUva i/yhtiq/aAnuMPXLAWp20lNJhMSPZFtLVmpf6UzU= Message-ID: <4ADC5E71.7090501@cs.duke.edu> Date: Mon, 19 Oct 2009 08:41:21 -0400 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Kostik Belousov References: <4AD79126.8020104@cs.duke.edu> <20091018131656.GP2160@deviant.kiev.zoral.com.ua> In-Reply-To: <20091018131656.GP2160@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Sam Leffler Subject: Re: namei (via firmware_get(9)) from taskq in 7.x X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 12:41:29 -0000 Kostik Belousov wrote: > It seems that you want a merge of r178042,183614,184842,188057 (one of Yes, I finally figured this out on Fri. I probably should have posted a response to this thread to avoid others wasting time on this. Drew From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 13:52:47 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F9DE106566B for ; Mon, 19 Oct 2009 13:52:47 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 4F1BF8FC13 for ; Mon, 19 Oct 2009 13:52:47 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MzsfD-000695-FX for freebsd-hackers@freebsd.org; Mon, 19 Oct 2009 15:52:43 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Oct 2009 15:52:43 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Oct 2009 15:52:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Mon, 19 Oct 2009 15:52:30 +0200 Lines: 11 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.23 (X11/20090928) Sender: news Subject: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 13:52:47 -0000 I have a small patch that makes "make" display percentage complete in process title, which can be retrieved in "top" in the form of: 71466 root 1 76 0 7008K 5696K select 0 0:00 0.00% make: 95% (55 more targets out of 1360) (make) The patch is here and I'm inviting reviews and suggestions: http://people.freebsd.org/~ivoras/diffs/make.c.patch if nobody objects, I'll commit it :) From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 14:24:16 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E7F71065676; Mon, 19 Oct 2009 14:24:16 +0000 (UTC) (envelope-from rink@rink.nu) Received: from mx1.rink.nu (gloom.rink.nu [213.34.49.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2244F8FC15; Mon, 19 Oct 2009 14:24:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx1.rink.nu (Postfix) with ESMTP id 6A12C6D423; Mon, 19 Oct 2009 16:08:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at rink.nu Received: from mx1.rink.nu ([213.34.49.2]) by localhost (gloom.rink.nu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zjKi7NPwjTMc; Mon, 19 Oct 2009 16:08:06 +0200 (CEST) Received: by mx1.rink.nu (Postfix, from userid 1000) id A218E6D42B; Mon, 19 Oct 2009 16:08:06 +0200 (CEST) Date: Mon, 19 Oct 2009 16:08:06 +0200 From: Rink Springer To: Ivan Voras Message-ID: <20091019140806.GB95902@rink.nu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 14:24:16 -0000 Hi Ivan, On Mon, Oct 19, 2009 at 03:52:30PM +0200, Ivan Voras wrote: > if nobody objects, I'll commit it :) I seem to recall that setproctitle() is quite expensive to call; perhaps it would make sense offer a flag to prevent make(1) from calling it? [1] Anyway, the feature looks nice! I'd like to have it... [1] I'm unsure how expensive it is compared to fork(1)-ing etc; I'd expect it's negligable but who knows... -- Rink P.W. Springer - http://rink.nu "Beauty often seduces us on the road to truth." - Dr. Wilson From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 14:35:30 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 596151065676 for ; Mon, 19 Oct 2009 14:35:30 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by mx1.freebsd.org (Postfix) with ESMTP id BC78E8FC0C for ; Mon, 19 Oct 2009 14:35:29 +0000 (UTC) Received: by ewy5 with SMTP id 5so977710ewy.36 for ; Mon, 19 Oct 2009 07:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=uzLJea7rn6EJvPlbdcIyqEjxShrq+zZ/mZ/HspWVFwU=; b=IfQ9WeNI/iJjh315V7R4KwHmvF5w9jmi6XPIjvzNrcdarUjzpqqahBgyBNWzjvwbej suftP2t1t3yKKDRyNTITVcV6C3ieCaySYU6hReoD51h3rThSSrEucDT3t1+OUxX3l8go hwiOqLEdK0BSX69mxYUabPqnX5s3bmOcbyrQM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=WxKw18W//K4cyaX0pLGGkrmkutgAHjhEoXGWkW1c4YwhbLO7+4j37r0T6P3RTabmdk x+pnKW+e8GbR/bCOrOjgkuGU+Aihq54t+pNdEhz6L6CvQbtiJ1AFp9LS9TAAVKLl96Vw aEuwRE1MyyhQSsjUQGJ0xfepQcHtmhpYltjFE= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.89.14 with SMTP id b14mr1895681wef.76.1255962928619; Mon, 19 Oct 2009 07:35:28 -0700 (PDT) In-Reply-To: <20091019140806.GB95902@rink.nu> References: <20091019140806.GB95902@rink.nu> From: Ivan Voras Date: Mon, 19 Oct 2009 16:35:08 +0200 X-Google-Sender-Auth: afc2a6724a026c16 Message-ID: <9bbcef730910190735t5847e765j16337092b354ec29@mail.gmail.com> To: Rink Springer Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 14:35:30 -0000 2009/10/19 Rink Springer : > Hi Ivan, > > On Mon, Oct 19, 2009 at 03:52:30PM +0200, Ivan Voras wrote: >> if nobody objects, I'll commit it :) > > I seem to recall that setproctitle() is quite expensive to call; perhaps > it would make sense offer a flag to prevent make(1) from calling it? [1] > > Anyway, the feature looks nice! I'd like to have it... > > [1] I'm unsure how expensive it is compared to fork(1)-ing etc; I'd > =C2=A0 =C2=A0expect it's negligable but who knows... The loop it's called in is not processed bazillion times per second (though it *is* called surprisingly often; small, fast jobs can result in somewhere in the order of magnitude of 100 iterations per second on a fast CPU). As you said - I expect it's negligable compared to fork() and the work jobs themselves do. From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 14:40:53 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDEB3106568F for ; Mon, 19 Oct 2009 14:40:53 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 9B5DA8FC08 for ; Mon, 19 Oct 2009 14:40:53 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MztPj-0006H0-HJ for freebsd-hackers@freebsd.org; Mon, 19 Oct 2009 16:40:47 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Oct 2009 16:40:47 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Oct 2009 16:40:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Mon, 19 Oct 2009 16:40:34 +0200 Lines: 11 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.23 (X11/20090928) In-Reply-To: Sender: news Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 14:40:53 -0000 Ivan Voras wrote: > I have a small patch that makes "make" display percentage complete in > process title, which can be retrieved in "top" in the form of: > > 71466 root 1 76 0 7008K 5696K select 0 0:00 0.00% > make: 95% (55 more targets out of 1360) (make) Also: is there someone here more familiar with "make" who can tell me if the "current" top level target (i.e. the one taken from the command line) is kept track of somewhere? For example "clean" in "make clean install". From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 15:39:24 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77D9C1065741; Mon, 19 Oct 2009 15:39:24 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Received: from istc.kiev.ua (wolf.istc.kiev.ua [193.108.236.1]) by mx1.freebsd.org (Postfix) with ESMTP id 11DB58FC0A; Mon, 19 Oct 2009 15:39:23 +0000 (UTC) Received: from ravenloft.kiev.ua ([91.123.146.100]) by istc.kiev.ua with esmtp (Exim 4.69) (envelope-from ) id 1MztQV-0008Gg-Ly; Mon, 19 Oct 2009 17:41:35 +0300 Date: Mon, 19 Oct 2009 17:41:35 +0300 From: Alex Kozlov To: Ivan Voras , freebsd-hackers@freebsd.org, spam@rm-rf.kiev.ua Message-ID: <20091019144135.GA91918@ravenloft.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Cc: Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 15:39:24 -0000 On Mon, Oct 19, 2009 at 04:35:08PM +0200, Ivan Voras wrote: > >> if nobody objects, I'll commit it :) > > > > I seem to recall that setproctitle() is quite expensive to call; perhaps > > it would make sense offer a flag to prevent make(1) from calling it? [1] > > > > Anyway, the feature looks nice! I'd like to have it... > > > > [1] I'm unsure how expensive it is compared to fork(1)-ing etc; I'd > >    expect it's negligable but who knows... > > The loop it's called in is not processed bazillion times per second > (though it *is* called surprisingly often; small, fast jobs can result > in somewhere in the order of magnitude of 100 iterations per second on > a fast CPU). As you said - I expect it's negligable compared to fork() > and the work jobs themselves do. How about add this statistic to make info handler? -- Adios From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 15:41:50 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BD4B106568D; Mon, 19 Oct 2009 15:41:50 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0085C8FC20; Mon, 19 Oct 2009 15:41:48 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA06646; Mon, 19 Oct 2009 18:41:47 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4ADC88BA.10507@icyb.net.ua> Date: Mon, 19 Oct 2009 18:41:46 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Rui Paulo , freebsd-acpi@freebsd.org, freebsd-hackers@freebsd.org References: <4ADB764C.2010900@icyb.net.ua> <5E0DD277-CAA3-4F01-8561-35CF6C511718@freebsd.org> In-Reply-To: <5E0DD277-CAA3-4F01-8561-35CF6C511718@freebsd.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: SB7xx watchdog: new driver for review and testing X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 15:41:50 -0000 I have put updated version of the driver (C file only) here: http://people.freebsd.org/~avg/amdsbwd.c Please let me know how it looks now. Thank you! -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 15:47:38 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE6391065679; Mon, 19 Oct 2009 15:47:38 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-fx0-f222.google.com (mail-fx0-f222.google.com [209.85.220.222]) by mx1.freebsd.org (Postfix) with ESMTP id 26F078FC14; Mon, 19 Oct 2009 15:47:37 +0000 (UTC) Received: by fxm22 with SMTP id 22so4937946fxm.36 for ; Mon, 19 Oct 2009 08:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=TaKQMhcMEoAa1c00xmYh8DIE+AMCnoDPwyEyRHebS3Y=; b=mZn/R0iA53B4ExJs8Y4ngAr1NSw07TP43c6oEeYt12JctuKeSUvxZokH177A7RiRzn szZxeyC2dggxH3bwYd4piy8yCtxDSH+BgEfhMB8UDcIgvsFTckX+HGbN3SpEKMty5cFu eNYiozbcmUwwwXvS5JAOD0Liwqd0sv57FUK/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=NnE94l9cMrT2HMx0uY3sgSDam8+h7g/n2Egk5rE9pG53rqgXJc9pcSAHmjH7RXW4h4 Si1pSkNWw2B3nQE0PUVlV4GfvxlfOBg83h3Q1frJd7fHO9D/tboeEl/z/zHSk52a7igo 4AjPNM8DtmuUF0XoDN2YPmcAeLZtJ9K0SZEik= Received: by 10.204.25.66 with SMTP id y2mr4992622bkb.59.1255967256601; Mon, 19 Oct 2009 08:47:36 -0700 (PDT) Received: from mac-mini.lan (bl9-152-74.dsl.telepac.pt [85.242.152.74]) by mx.google.com with ESMTPS id 16sm666313bwz.3.2009.10.19.08.47.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Oct 2009 08:47:35 -0700 (PDT) Sender: Rui Paulo Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed From: Rui Paulo In-Reply-To: <4ADC88BA.10507@icyb.net.ua> Date: Mon, 19 Oct 2009 16:47:34 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <4ADB764C.2010900@icyb.net.ua> <5E0DD277-CAA3-4F01-8561-35CF6C511718@freebsd.org> <4ADC88BA.10507@icyb.net.ua> To: Andriy Gapon X-Mailer: Apple Mail (2.1076) Cc: freebsd-hackers@freebsd.org, freebsd-acpi@freebsd.org Subject: Re: SB7xx watchdog: new driver for review and testing X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 15:47:38 -0000 On 19 Oct 2009, at 16:41, Andriy Gapon wrote: > > I have put updated version of the driver (C file only) here: > http://people.freebsd.org/~avg/amdsbwd.c Looks good to me. -- Rui Paulo From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 15:52:04 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54CD41065672 for ; Mon, 19 Oct 2009 15:52:04 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by mx1.freebsd.org (Postfix) with ESMTP id DE1FF8FC1D for ; Mon, 19 Oct 2009 15:52:03 +0000 (UTC) Received: by ewy5 with SMTP id 5so1058560ewy.36 for ; Mon, 19 Oct 2009 08:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=ZUzF2n6sm2Y8hVypEHHDB2gcQ1XXhwLFgmMxOj6OD5w=; b=KwHzuPCMOQe4EYDTPgCAkPhpH/dZqCKj7fy4PQrUxGURHoNdrC3Az2Nv0hSzQP72i0 8gA8IfIVBuvv7yYawySVVuEItd29cQs0FE67VQ8CQ5rImo8ns4+mI/khte2X/VlVAxxo /zzefyt9HleuOXxpSMDnWSzmOWhSgvNpU2XCg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=hERYmh2Ia1gmUqk88mykNS8+ZGlNdEC9FueBjCDvj92B0+Tw2TwCDtGJAlmUI3Cy21 AZgWXvvtij4n1jVfxudJ6/Gnj/uTi9R+aopJkKmfe/LnoDyUK46TuHGgAgovslM/TJnu tpS6D6DabNXmSL1ro2Wql5iY3ugCZ8odWx3dw= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.90.77 with SMTP id d55mr2045484wef.164.1255967522926; Mon, 19 Oct 2009 08:52:02 -0700 (PDT) In-Reply-To: <20091019144135.GA91918@ravenloft.kiev.ua> References: <20091019144135.GA91918@ravenloft.kiev.ua> From: Ivan Voras Date: Mon, 19 Oct 2009 17:51:42 +0200 X-Google-Sender-Auth: b468beaee624ff3e Message-ID: <9bbcef730910190851m7e82bd1aqc0bc55106c8a5d37@mail.gmail.com> To: Alex Kozlov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 15:52:04 -0000 2009/10/19 Alex Kozlov : > On Mon, Oct 19, 2009 at 04:35:08PM +0200, Ivan Voras wrote: >> >> if nobody objects, I'll commit it :) >> > >> > I seem to recall that setproctitle() is quite expensive to call; perha= ps >> > it would make sense offer a flag to prevent make(1) from calling it? [= 1] >> > >> > Anyway, the feature looks nice! I'd like to have it... >> > >> > [1] I'm unsure how expensive it is compared to fork(1)-ing etc; I'd >> > =C2=A0 =C2=A0expect it's negligable but who knows... >> >> The loop it's called in is not processed bazillion times per second >> (though it *is* called surprisingly often; small, fast jobs can result >> in somewhere in the order of magnitude of 100 iterations per second on >> a fast CPU). As you said - I expect it's negligable compared to fork() >> and the work jobs themselves do. > How about add this statistic to make info handler? You mean SIGINFO? From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 16:20:18 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76A41106568B; Mon, 19 Oct 2009 16:20:18 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Received: from istc.kiev.ua (wolf.istc.kiev.ua [193.108.236.1]) by mx1.freebsd.org (Postfix) with ESMTP id 336428FC21; Mon, 19 Oct 2009 16:20:18 +0000 (UTC) Received: from ravenloft.kiev.ua ([91.123.146.100]) by istc.kiev.ua with esmtp (Exim 4.69) (envelope-from ) id 1Mzuy0-00023C-Pw; Mon, 19 Oct 2009 19:20:16 +0300 Date: Mon, 19 Oct 2009 19:20:16 +0300 From: Alex Kozlov To: Ivan Voras , freebsd-hackers@freebsd.org, spam@rm-rf.kiev.ua Message-ID: <20091019162016.GA96201@ravenloft.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Cc: Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 16:20:18 -0000 On Mon, Oct 19, 2009 at 05:51:42PM +0200, Ivan Voras wrote: > 2009/10/19 Alex Kozlov : > > On Mon, Oct 19, 2009 at 04:35:08PM +0200, Ivan Voras wrote: > >> >> if nobody objects, I'll commit it :) > >> > > >> > I seem to recall that setproctitle() is quite expensive to call; perhaps > >> > it would make sense offer a flag to prevent make(1) from calling it? [1] > >> > > >> > Anyway, the feature looks nice! I'd like to have it... > >> > > >> > [1] I'm unsure how expensive it is compared to fork(1)-ing etc; I'd > >> >    expect it's negligable but who knows... > >> > >> The loop it's called in is not processed bazillion times per second > >> (though it *is* called surprisingly often; small, fast jobs can result > >> in somewhere in the order of magnitude of 100 iterations per second on > >> a fast CPU). As you said - I expect it's negligable compared to fork() > >> and the work jobs themselves do. > > How about add this statistic to make info handler? > You mean SIGINFO? Yes -- Adios From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 16:12:35 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C47E106568B for ; Mon, 19 Oct 2009 16:12:35 +0000 (UTC) (envelope-from forensixs@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id D4A408FC0A for ; Mon, 19 Oct 2009 16:12:34 +0000 (UTC) Received: (qmail 16936 invoked by uid 0); 19 Oct 2009 15:45:54 -0000 Received: from 78.53.195.204 by www061.gmx.net with HTTP; Mon, 19 Oct 2009 17:45:51 +0200 (CEST) Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1" Date: Mon, 19 Oct 2009 17:45:50 +0200 From: "Manuel Gebele" Message-ID: <20091019154550.163560@gmx.net> MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Authenticated: #52019271 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1+BhEdjmgSBRC4UrrL2/n/btobN1Ouw1w2E69/wUb KX5OleO5gnTQHSd7Czf9bne6QiwhyqcchTQA== X-GMX-UID: n7v6Ys2YLi50F2/kc2hpae5rZml1ZNh/ X-FuHaFi: 0.67 X-Mailman-Approved-At: Mon, 19 Oct 2009 16:28:29 +0000 Subject: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 16:12:35 -0000 Hi folks, some time ago, I decided to start working on an FreeBSD implementation for data acquisition support. Now I've published a very first Pre-Alpha version of the project. To become a more precisely overview take a look at http://freebsd-dcf.sourceforge.net/ Please notice that the project -as already mentioned- is in an early development stage. For that reason, we've only a skeleton driver which gives a guide about the ``DCF based'' low-level driver development. The ``DCF core'' source code needs a cleanup -I'll do that time permitting. The projects website needs also an update, especially the documentation part. In the foreseeable future I plan to add two USB drivers for two (DAQ) USB plug-in boards. But at this time the main focus is that the DCF project becomes a usable form. I hope that all this would be useful to our beloved FreeBSD =) It would be great to hear about some of other people's opinions. Thanks, Manuel Gebele -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 19 19:43:57 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 543D9106568B; Mon, 19 Oct 2009 19:43:57 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2E0258FC1E; Mon, 19 Oct 2009 19:43:55 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA09959; Mon, 19 Oct 2009 22:43:54 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Mzy94-000JVK-21; Mon, 19 Oct 2009 22:43:54 +0300 Message-ID: <4ADCC16A.1080203@icyb.net.ua> Date: Mon, 19 Oct 2009 22:43:38 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090823) MIME-Version: 1.0 To: Rui Paulo , freebsd-acpi@freebsd.org, freebsd-hackers@freebsd.org References: <4ADB764C.2010900@icyb.net.ua> <5E0DD277-CAA3-4F01-8561-35CF6C511718@freebsd.org> <4ADC88BA.10507@icyb.net.ua> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: SB7xx watchdog: new driver for review and testing X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 19:43:57 -0000 on 19/10/2009 18:47 Rui Paulo said the following: > On 19 Oct 2009, at 16:41, Andriy Gapon wrote: > >> >> I have put updated version of the driver (C file only) here: >> http://people.freebsd.org/~avg/amdsbwd.c > > Looks good to me. Thank you for the review and the help! I have now produced a diff against the main tree for full integration of this driver: http://people.freebsd.org/~avg/amdsbwd.diff -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 02:09:52 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8EE1065672 for ; Tue, 20 Oct 2009 02:09:52 +0000 (UTC) (envelope-from grarpamp@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by mx1.freebsd.org (Postfix) with ESMTP id BD83B8FC17 for ; Tue, 20 Oct 2009 02:09:51 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 9so1122589eyd.9 for ; Mon, 19 Oct 2009 19:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=USE8qqPgLMuDLNV3i2evFfp6pIElbHEDFqTUTxQ8Gn8=; b=AUMvY0iw30LNsr6dztETkpAEDt8H16ip8Tu68264a3NjpqnggD06FX7BBgkiqySHVW eLbLyTe3ci8WNxlwDHux5mNRsdHa5XzGcHp75ubwCImkjJ4tkGxzzQg7qSoIFy9AWVkA JOpICkXVChUo+ocPi7vQK66JhRvNE34yum31Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=qNC1t92pyX09D4GxrGjSVy8/kX6zNWQ24uFQr+YmehvCWa9bXN8c/sueWTNljtOBeL pzO8iX5B8DoyAAsux78b0g+S7PffWr9fVeEHGylOyRXWBZQl816/6TAzibYEILwOorUv dbEIuncd1gCHlBMFInr6sg8FjtWq9BmW5bJZ4= MIME-Version: 1.0 Received: by 10.211.173.11 with SMTP id a11mr6426162ebp.42.1256002859643; Mon, 19 Oct 2009 18:40:59 -0700 (PDT) Date: Mon, 19 Oct 2009 21:40:59 -0400 Message-ID: From: grarpamp To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Mailman-Approved-At: Tue, 20 Oct 2009 03:02:49 +0000 Subject: vm: kvm_free max_wired X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 02:09:52 -0000 Is this telling me I should be able to set kmem_size to around 740MiB before the kernel panics during boot? Any runtime issues with doing that? # sysctl hw.physmem hw.realmem vm.kvm_size vm.kvm_free vm.kmem_size hw.physmem: 1055293440 hw.realmem: 1072627712 vm.kvm_size: 1073737728 vm.kvm_free: 205516800 vm.kmem_size: 536870912 # sysctl -d hw.physmem vm.kvm_size vm.kvm_free vm.kmem_size hw.physmem: hw.realmem: vm.kvm_size: Size of KVM vm.kvm_free: Amount of KVM free vm.kmem_size: Size of kernel memory This doesn't seem to autosize. Is that expected? Should one care about this sysctl? vm.max_wired: System-wide limit to wired page count vm.max_wired: 83211 83211*4096/2^20 = ~325 Also, these are obviously broken / curious: debug.boothowto: -2147481598 net.inet.tcp.inflight.max: 1073725440 Running RELENG_8. From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 08:24:43 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A70E106566C for ; Tue, 20 Oct 2009 08:24:43 +0000 (UTC) (envelope-from lars.engels@0x20.net) Received: from mail.0x20.net (mail.0x20.net [217.69.67.217]) by mx1.freebsd.org (Postfix) with ESMTP id 193A68FC08 for ; Tue, 20 Oct 2009 08:24:42 +0000 (UTC) Received: from mail.0x20.net (mail.0x20.net [217.69.67.217]) by mail.0x20.net (Postfix) with ESMTP id 46DCA398B1 for ; Tue, 20 Oct 2009 10:07:07 +0200 (CEST) Received: from 62.225.72.179 ([62.225.72.179]) by 0x20.net (Horde MIME library) with HTTP; Tue, 20 Oct 2009 10:07:07 +0200 Message-ID: <20091020100707.60jfc16iskcgcccg@0x20.net> X-Priority: 3 (Normal) Date: Tue, 20 Oct 2009 10:07:07 +0200 From: Lars Engels To: freebsd-hackers@freebsd.org References: <20091019162016.GA96201@ravenloft.kiev.ua> In-Reply-To: <20091019162016.GA96201@ravenloft.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_1161ozjsc8tc"; protocol="application/pgp-signature"; micalg="pgp-sha1" Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.1.3) X-Mailman-Approved-At: Tue, 20 Oct 2009 11:28:33 +0000 Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 08:24:43 -0000 This message is in MIME format and has been PGP signed. --=_1161ozjsc8tc Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting Alex Kozlov : > On Mon, Oct 19, 2009 at 05:51:42PM +0200, Ivan Voras wrote: >> 2009/10/19 Alex Kozlov : >> > On Mon, Oct 19, 2009 at 04:35:08PM +0200, Ivan Voras wrote: >> >> >> if nobody objects, I'll commit it :) >> >> > >> >> > I seem to recall that setproctitle() is quite expensive to =20 >> call; perhaps >> >> > it would make sense offer a flag to prevent make(1) from =20 >> calling it? [1] >> >> > >> >> > Anyway, the feature looks nice! I'd like to have it... >> >> > >> >> > [1] I'm unsure how expensive it is compared to fork(1)-ing etc; I'd >> >> > expect it's negligable but who knows... >> >> >> >> The loop it's called in is not processed bazillion times per second >> >> (though it *is* called surprisingly often; small, fast jobs can result >> >> in somewhere in the order of magnitude of 100 iterations per second on >> >> a fast CPU). As you said - I expect it's negligable compared to fork() >> >> and the work jobs themselves do. >> > How about add this statistic to make info handler? >> You mean SIGINFO? > Yes Using SIGINFO sounds nice, but make produces so much output that =20 normally you won't see the result because it is scrolled up just after =20 sending the signal. --=_1161ozjsc8tc Content-Type: application/pgp-signature Content-Description: PGP Digital Signature Content-Disposition: inline Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkrdb6sACgkQKc512sD3afjJ5ACdF5tILIQ89zrl0VU0x1jXWLsS +jcAn21Q3qTIX11uoV0CLu9NcuqBP0j7 =urXJ -----END PGP SIGNATURE----- --=_1161ozjsc8tc-- From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 10:30:00 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66F1610656C2 for ; Tue, 20 Oct 2009 10:30:00 +0000 (UTC) (envelope-from forensixs@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id B1DD58FC08 for ; Tue, 20 Oct 2009 10:29:59 +0000 (UTC) Received: (qmail 31985 invoked by uid 0); 20 Oct 2009 10:29:58 -0000 Received: from 78.53.192.150 by www068.gmx.net with HTTP; Tue, 20 Oct 2009 12:29:55 +0200 (CEST) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" Date: Tue, 20 Oct 2009 12:29:55 +0200 From: "Manuel Gebele" Message-ID: <20091020102955.309160@gmx.net> MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Authenticated: #52019271 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX19YxhBqnnlYqoRonmblfrINxrMdFwSt8CJIqNvpGh gVY404FWmfeSw1rqPKMy27nlrZGiXIhRaBZg== X-GMX-UID: Eajlf/gLbmwofjWycTRL8IRPUzc4chF/ X-FuHaFi: 0.75 X-Mailman-Approved-At: Tue, 20 Oct 2009 11:29:10 +0000 Subject: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 10:30:00 -0000 Finally I've updated the documentation part from the FreeBSD DCF project site: http://freebsd-dcf.sourceforge.net/docu.html I hope that helps to get a better overview. Thanks, Manuel Gebele -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 12:08:13 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58A3A106566B for ; Tue, 20 Oct 2009 12:08:12 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8F28FC15 for ; Tue, 20 Oct 2009 12:08:11 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 1898B6D41C; Tue, 20 Oct 2009 12:08:10 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id C6E8484503; Tue, 20 Oct 2009 14:08:09 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Manuel Gebele" References: <20091020102955.309160@gmx.net> Date: Tue, 20 Oct 2009 14:08:09 +0200 In-Reply-To: <20091020102955.309160@gmx.net> (Manuel Gebele's message of "Tue, 20 Oct 2009 12:29:55 +0200") Message-ID: <86eioytgie.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 12:08:13 -0000 "Manuel Gebele" writes: > Finally I've updated the documentation part from the FreeBSD DCF > project site: What made you choose the name "DCF"? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 12:25:21 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4F49106566B for ; Tue, 20 Oct 2009 12:25:21 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Received: from istc.kiev.ua (wolf.istc.kiev.ua [193.108.236.1]) by mx1.freebsd.org (Postfix) with ESMTP id 91F668FC21 for ; Tue, 20 Oct 2009 12:25:21 +0000 (UTC) Received: from ravenloft.kiev.ua ([91.123.146.100]) by istc.kiev.ua with esmtp (Exim 4.69) (envelope-from ) id 1N0DmA-00083B-RO; Tue, 20 Oct 2009 15:25:18 +0300 Date: Tue, 20 Oct 2009 15:24:32 +0300 From: Alex Kozlov To: Lars Engels , freebsd-hackers@freebsd.org, spam@rm-rf.kiev.ua Message-ID: <20091020122432.GA50817@ravenloft.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Cc: Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 12:25:21 -0000 On Tue, Oct 20, 2009 at 10:07:07AM +0200, Lars Engels wrote: > Quoting Alex Kozlov : > > > On Mon, Oct 19, 2009 at 05:51:42PM +0200, Ivan Voras wrote: > >> 2009/10/19 Alex Kozlov : > >> > On Mon, Oct 19, 2009 at 04:35:08PM +0200, Ivan Voras wrote: > >> >> >> if nobody objects, I'll commit it :) > >> >> > > >> >> > I seem to recall that setproctitle() is quite expensive to > >> call; perhaps > >> >> > it would make sense offer a flag to prevent make(1) from > >> calling it? [1] > >> >> > > >> >> > Anyway, the feature looks nice! I'd like to have it... > >> >> > > >> >> > [1] I'm unsure how expensive it is compared to fork(1)-ing etc; I'd > >> >> > expect it's negligable but who knows... > >> >> > >> >> The loop it's called in is not processed bazillion times per second > >> >> (though it *is* called surprisingly often; small, fast jobs can result > >> >> in somewhere in the order of magnitude of 100 iterations per second on > >> >> a fast CPU). As you said - I expect it's negligable compared to fork() > >> >> and the work jobs themselves do. > >> > How about add this statistic to make info handler? > >> You mean SIGINFO? > > Yes > > Using SIGINFO sounds nice, but make produces so much output that > normally you won't see the result because it is scrolled up just after > sending the signal. Of course ps or top output much more convenient, but if setproctitle so expencive and will be called so often, then SIGINFO may be good compromise. -- Adios From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 12:42:54 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E588B1065672 for ; Tue, 20 Oct 2009 12:42:54 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id A2FFC8FC16 for ; Tue, 20 Oct 2009 12:42:54 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N0E31-000652-G3 for freebsd-hackers@freebsd.org; Tue, 20 Oct 2009 14:42:43 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Oct 2009 14:42:43 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Oct 2009 14:42:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Tue, 20 Oct 2009 14:42:17 +0200 Lines: 53 Message-ID: References: <20091020122432.GA50817@ravenloft.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.23 (X11/20090928) In-Reply-To: <20091020122432.GA50817@ravenloft.kiev.ua> Sender: news Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 12:42:55 -0000 Alex Kozlov wrote: > Of course ps or top output much more convenient, but if setproctitle so > expencive and will be called so often, then SIGINFO may be good > compromise. Regarding speed of setproctitle(), here are some microbenchmark results from the attached test source: getpid: 3661124.75 iterations/s setproctitle: 591357.56 iterations/s Meaning, setprocitle() is around 6 times more expensive than getpid(), meaning it can only be pulled off nearly 600,000 calls/s on a 2.3 GHz Core 2 CPU. I really want to be enlightened about how it could affect wallclock time in make(1). ---- #include #include #include #include #include #define NITER 1e7 double now() { struct timeval tp; gettimeofday(&tp, NULL); return tp.tv_sec + (double)tp.tv_usec / 1e6f; } int main() { double t1, t2, t3; int i; t1 = now(); for (i = 0; i < NITER; i++) getpid(); t2 = now() - t1; printf("getpid: %0.2f iterations/s\n", (float)(NITER/t2)); t1 = now(); for (i = 0; i < NITER; i++) setproctitle("t%d", i); t3 = now() - t1; printf("setproctitle: %0.2f iterations/s\n", (float)(NITER/t3)); } From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 12:49:15 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F269D106566C for ; Tue, 20 Oct 2009 12:49:15 +0000 (UTC) (envelope-from ady@ady.ro) Received: from mail-ew0-f206.google.com (mail-ew0-f206.google.com [209.85.219.206]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8CF8FC0C for ; Tue, 20 Oct 2009 12:49:15 +0000 (UTC) Received: by ewy2 with SMTP id 2so5103006ewy.7 for ; Tue, 20 Oct 2009 05:49:14 -0700 (PDT) MIME-Version: 1.0 Sender: ady@ady.ro Received: by 10.210.152.4 with SMTP id z4mr7189920ebd.7.1256042954291; Tue, 20 Oct 2009 05:49:14 -0700 (PDT) In-Reply-To: References: From: Adrian Penisoara Date: Tue, 20 Oct 2009 14:48:54 +0200 X-Google-Sender-Auth: 39eb26c2cb6ffb4a Message-ID: <78cb3d3f0910200548p60fd32e5tc525899391e37f41@mail.gmail.com> To: Ivan Voras Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 12:49:16 -0000 Hi, On Mon, Oct 19, 2009 at 4:40 PM, Ivan Voras wrote: > Ivan Voras wrote: >> >> I have a small patch that makes "make" display percentage complete in >> process title, which can be retrieved in "top" in the form of: >> >> 71466 root =A0 =A0 =A0 =A0 =A0 =A0 1 =A076 =A0 =A00 =A07008K =A05696K se= lect =A00 =A0 0:00 =A00.00% >> make: 95% (55 more targets out of 1360) (make) > > Also: is there someone here more familiar with "make" who can tell me if = the > "current" top level target (i.e. the one taken from the command line) is > kept track of somewhere? For example "clean" in "make clean install". > gmake does show the nesting level in its output and indeed it's a valuable information if setproctitle is to be used... gmake appears to use a MAKELEVEL environment variable to keep track in between parent/child runs. I see a similar mechanism in our make (using the __MKLVL__ environment variable) but it's restricted only to the check_make_level() function that is checking the nesting level, thus no global variable is available to use. Regards, Adrian Penisoara EnterpriseBSD.com From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 12:38:23 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00EBA106568B for ; Tue, 20 Oct 2009 12:38:23 +0000 (UTC) (envelope-from forensixs@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 9078F8FC08 for ; Tue, 20 Oct 2009 12:38:22 +0000 (UTC) Received: (qmail 30446 invoked by uid 0); 20 Oct 2009 12:38:20 -0000 Received: from 78.53.192.150 by www062.gmx.net with HTTP; Tue, 20 Oct 2009 14:38:19 +0200 (CEST) Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1" Date: Tue, 20 Oct 2009 14:38:19 +0200 From: "Manuel Gebele" Message-ID: <20091020123819.30560@gmx.net> MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Authenticated: #52019271 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX18/IpZmlmA/cjeaciOQLZxCRA38nhk2Qj5XMWKfmb R+mFtWeZiddSs0/bYbpU3C9CQFL3TmwO8vYQ== X-GMX-UID: A5jofoVMTiE+OjShfmdwBE99ZUVSRNfr X-FuHaFi: X-Mailman-Approved-At: Tue, 20 Oct 2009 12:49:35 +0000 Subject: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 12:38:23 -0000 The acronym stands for DAQ (Data AcQuisition) Card Facility MG -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 12:43:09 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF1011065692 for ; Tue, 20 Oct 2009 12:43:09 +0000 (UTC) (envelope-from forensixs@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 261C28FC22 for ; Tue, 20 Oct 2009 12:43:08 +0000 (UTC) Received: (qmail 19374 invoked by uid 0); 20 Oct 2009 12:43:07 -0000 Received: from 78.53.192.150 by www046.gmx.net with HTTP; Tue, 20 Oct 2009 14:43:04 +0200 (CEST) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" Date: Tue, 20 Oct 2009 14:43:04 +0200 From: "Manuel Gebele" Message-ID: <20091020124304.30560@gmx.net> MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Authenticated: #52019271 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX186OvICF3Y6fo7OXQQCopxSDFtRbPx2KHyQVvfPJz ow5ruuLLvAamNCGtcmVsSmaUqGgnIZrxindw== X-GMX-UID: OdmoecQ+ODB6KC2hamdMPg09Ji9SWhJR X-FuHaFi: 0.8100000000000001 X-Mailman-Approved-At: Tue, 20 Oct 2009 12:58:14 +0000 Subject: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 12:43:09 -0000 If you take a look at my site on sourceforge you should know why that acronym. But I'm flexible, so maybe there is a better name for that. Thanks, MG -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 13:22:36 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AF161065679 for ; Tue, 20 Oct 2009 13:22:36 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195]) by mx1.freebsd.org (Postfix) with ESMTP id E7C1E8FC16 for ; Tue, 20 Oct 2009 13:22:35 +0000 (UTC) Received: from [192.168.1.4] (adsl-154-198-93.ard.bellsouth.net [72.154.198.93]) (authenticated bits=0) by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id n9KDMWb4071870 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 20 Oct 2009 09:22:33 -0400 (EDT) (envelope-from rnoland@FreeBSD.org) From: Robert Noland To: Ivan Voras In-Reply-To: References: <20091020122432.GA50817@ravenloft.kiev.ua> Content-Type: text/plain Organization: FreeBSD Date: Tue, 20 Oct 2009 08:22:26 -0500 Message-Id: <1256044946.2386.28.camel@balrog.2hip.net> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_PBL, RCVD_IN_SORBS_DUL, RDNS_DYNAMIC, SPF_SOFTFAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net Cc: freebsd-hackers@freebsd.org Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:22:36 -0000 On Tue, 2009-10-20 at 14:42 +0200, Ivan Voras wrote: > Alex Kozlov wrote: > > > Of course ps or top output much more convenient, but if setproctitle so > > expencive and will be called so often, then SIGINFO may be good > > compromise. > > Regarding speed of setproctitle(), here are some microbenchmark results > from the attached test source: > > getpid: 3661124.75 iterations/s > setproctitle: 591357.56 iterations/s > > Meaning, setprocitle() is around 6 times more expensive than getpid(), > meaning it can only be pulled off nearly 600,000 calls/s on a 2.3 GHz > Core 2 CPU. > > I really want to be enlightened about how it could affect wallclock time > in make(1). What is the relative difference in buildworld time with and without? robert. > ---- > > #include > #include > #include > #include > #include > > #define NITER 1e7 > > double now() { > struct timeval tp; > gettimeofday(&tp, NULL); > return tp.tv_sec + (double)tp.tv_usec / 1e6f; > } > > int main() { > double t1, t2, t3; > int i; > > t1 = now(); > for (i = 0; i < NITER; i++) > getpid(); > t2 = now() - t1; > > printf("getpid: %0.2f iterations/s\n", (float)(NITER/t2)); > > t1 = now(); > for (i = 0; i < NITER; i++) > setproctitle("t%d", i); > t3 = now() - t1; > > printf("setproctitle: %0.2f iterations/s\n", (float)(NITER/t3)); > } > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- Robert Noland FreeBSD From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 13:24:57 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 261D01065676 for ; Tue, 20 Oct 2009 13:24:57 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id DDEF98FC19 for ; Tue, 20 Oct 2009 13:24:56 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id EB40D6D41B; Tue, 20 Oct 2009 13:24:55 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id A56C884503; Tue, 20 Oct 2009 15:24:55 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Manuel Gebele" References: <20091020123819.30560@gmx.net> Date: Tue, 20 Oct 2009 15:24:55 +0200 In-Reply-To: <20091020123819.30560@gmx.net> (Manuel Gebele's message of "Tue, 20 Oct 2009 14:38:19 +0200") Message-ID: <863a5etcyg.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:24:57 -0000 "Manuel Gebele" writes: > The acronym stands for DAQ (Data AcQuisition) Card Facility [...] If > you take a look at my site on sourceforge you should know why that > acronym. But I'm flexible, so maybe there is a better name for that. First, when you answer a question on a mailing list, it is customary to use your MUA's "reply" function and to quote the question. Otherwise, there is nothing to tie the answer to the question, and nobody will understand anything, except possibly the person who asked the question in the first place. It is also customary to answer once, not twice. That being taken care of - the reason I asked is that to me (and to many other time boffins and NTP fundamentalists), DCF is a longwave radio station in Frankfurt which is commonly used as an external reference for NTP servers. I would have just called it DAQ, which as you know is an established abbreviation for "Data Acquisition". The "card" part is meaningless; FreeBSD runs on plenty of hardware with integrated DAQ facilities, such as the Soekris, or pretty much anything built around a MIPS or ARM or (soon) AVR32 microcontroller. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 13:33:43 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BE3C106566C for ; Tue, 20 Oct 2009 13:33:43 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) by mx1.freebsd.org (Postfix) with ESMTP id 82C988FC16 for ; Tue, 20 Oct 2009 13:33:42 +0000 (UTC) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.14.3/8.14.3) with ESMTP id n9KDXb7S078258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 20 Oct 2009 15:33:38 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.14.3/8.14.3/Submit) with ESMTP id n9KDXbDQ078255 for ; Tue, 20 Oct 2009 15:33:37 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Tue, 20 Oct 2009 15:33:37 +0200 (CEST) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: freebsd-hackers@freebsd.org In-Reply-To: <863a5etcyg.fsf@ds4.des.no> Message-ID: References: <20091020123819.30560@gmx.net> <863a5etcyg.fsf@ds4.des.no> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) Organization: =?ISO-8859-1?Q?Fagskolen_i_Gj=F8vik?= OpenPGP: url=http://fagskolen.gjovik.no/~trond/trond.key MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="2055831798-1479816709-1256045617=:41390" X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.fig.ol.no Subject: Re: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:33:43 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2055831798-1479816709-1256045617=:41390 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, 20 Oct 2009 15:24+0200, Dag-Erling Smørgrav wrote: > "Manuel Gebele" writes: > > The acronym stands for DAQ (Data AcQuisition) Card Facility [...] If > > you take a look at my site on sourceforge you should know why that > > acronym. But I'm flexible, so maybe there is a better name for that. [...] > That being taken care of - the reason I asked is that to me (and to many > other time boffins and NTP fundamentalists), DCF is a longwave radio > station in Frankfurt which is commonly used as an external reference for > NTP servers. The call sign is really DCF77. Trond. - -- - ---------------------------------------------------------------------- Trond Endrestøl | Trond.Endrestol@fagskolen.gjovik.no ACM, NAS, NUUG, SAGE, USENIX | FreeBSD 7.2-STABLE & Alpine 2.00 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkrdvDEACgkQbYWZalUoElugNACbBgWAVm2EUd6QRE7pA07oVrP6 ldcAn1YmYbFfpdu/z+bIT1eyj0cd1KiG =Gjqa -----END PGP SIGNATURE----- --2055831798-1479816709-1256045617=:41390-- From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 13:33:49 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46E11106566B; Tue, 20 Oct 2009 13:33:49 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Received: from istc.kiev.ua (wolf.istc.kiev.ua [193.108.236.1]) by mx1.freebsd.org (Postfix) with ESMTP id D0BC28FC1B; Tue, 20 Oct 2009 13:33:47 +0000 (UTC) Received: from ravenloft.kiev.ua ([91.123.146.100]) by istc.kiev.ua with esmtp (Exim 4.69) (envelope-from ) id 1N0EqP-0002PP-5d; Tue, 20 Oct 2009 16:33:45 +0300 Date: Tue, 20 Oct 2009 16:33:43 +0300 From: Alex Kozlov To: Ivan Voras , freebsd-hackers@freebsd.org, spam@rm-rf.kiev.ua Message-ID: <20091020133343.GA53941@ravenloft.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Cc: Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:33:49 -0000 On Tue, Oct 20, 2009 at 02:42:17PM +0200, Ivan Voras wrote: > Alex Kozlov wrote: > > > Of course ps or top output much more convenient, but if setproctitle so > > expencive and will be called so often, then SIGINFO may be good > > compromise. > > Regarding speed of setproctitle(), here are some microbenchmark results > from the attached test source: > > getpid: 3661124.75 iterations/s > setproctitle: 591357.56 iterations/s > > Meaning, setprocitle() is around 6 times more expensive than getpid(), > meaning it can only be pulled off nearly 600,000 calls/s on a 2.3 GHz > Core 2 CPU. > > I really want to be enlightened about how it could affect wallclock time > in make(1). make universe few times with and without patch? -- Adios From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 13:39:28 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D52F3106566B for ; Tue, 20 Oct 2009 13:39:28 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 95EF78FC13 for ; Tue, 20 Oct 2009 13:39:28 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id D122D6D41C; Tue, 20 Oct 2009 13:39:27 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id A193F84503; Tue, 20 Oct 2009 15:39:27 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Trond =?utf-8?Q?Endrest=C3=B8l?= References: <20091020123819.30560@gmx.net> <863a5etcyg.fsf@ds4.des.no> Date: Tue, 20 Oct 2009 15:39:27 +0200 In-Reply-To: ("Trond =?utf-8?Q?Endrest=C3=B8l=22's?= message of "Tue, 20 Oct 2009 15:33:37 +0200 (CEST)") Message-ID: <86y6n6rxps.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 13:39:28 -0000 Trond Endrest=C3=B8l writes: > The call sign is really DCF77. ...and it's not really in Frankfurt. True, but irrelevant. See RFC2030. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 17:33:21 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D0F1106566B; Tue, 20 Oct 2009 17:33:21 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 1533E8FC1A; Tue, 20 Oct 2009 17:33:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 714959CB068; Tue, 20 Oct 2009 19:14:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iH6Id6IgtVqv; Tue, 20 Oct 2009 19:13:55 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 09FD79CB513; Tue, 20 Oct 2009 19:13:55 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n9KHDscm092615; Tue, 20 Oct 2009 19:13:54 +0200 (CEST) (envelope-from rdivacky) Date: Tue, 20 Oct 2009 19:13:54 +0200 From: Roman Divacky To: Ivan Voras Message-ID: <20091020171354.GA92192@freebsd.org> References: <20091020122432.GA50817@ravenloft.kiev.ua> 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-hackers@freebsd.org Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 17:33:21 -0000 On Tue, Oct 20, 2009 at 02:42:17PM +0200, Ivan Voras wrote: > Alex Kozlov wrote: > > >Of course ps or top output much more convenient, but if setproctitle so > >expencive and will be called so often, then SIGINFO may be good > >compromise. > > Regarding speed of setproctitle(), here are some microbenchmark results > from the attached test source: > > getpid: 3661124.75 iterations/s > setproctitle: 591357.56 iterations/s > > Meaning, setprocitle() is around 6 times more expensive than getpid(), > meaning it can only be pulled off nearly 600,000 calls/s on a 2.3 GHz > Core 2 CPU. what about contention? setproctitle() is an sysctl so it will prevent other sysctl's from working when being executed.. From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 20:29:04 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAFFB106568D for ; Tue, 20 Oct 2009 20:29:04 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by mx1.freebsd.org (Postfix) with ESMTP id 1FDB78FC0C for ; Tue, 20 Oct 2009 20:29:03 +0000 (UTC) Received: by ewy5 with SMTP id 5so2548391ewy.36 for ; Tue, 20 Oct 2009 13:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type; bh=t5b2o84XMMARxASgDXPiuwUhcm32GWhAm+Qm9QN3xpQ=; b=qLn9Cefo5ihMB1agbNG9boQ46i2ja0CgQbsegug8eLcz+OKBWAarR2+6MvM+nS/0+W MQpeW8ya+yXxnTb9K+smt3/B9P4U1z35wIuKiOauukIru59Etv82WJO772XrfYtaGgqY zo8Y0i1W3yZFSLTSVjwGMgFS2+yqMZdlPzIW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=LBoPhlz0ENsVo7whkXTSX7j5bPwtTDXp/gZs5H6vtbU1apL1A+xhPrYBcmrIQfAXo0 0JIrMfoHKAP2q9JnGJgg0Qtc/5arGKMmJ87GJGOhXgDPLHXbrlScW3T0LCyu3LzZjp0S Dml+Ods+YD4geGW08OFAQuKbIXnT0i2N1XNZk= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.86.137 with SMTP id w9mr2438269wee.104.1256070542946; Tue, 20 Oct 2009 13:29:02 -0700 (PDT) In-Reply-To: <20091020171354.GA92192@freebsd.org> References: <20091020122432.GA50817@ravenloft.kiev.ua> <20091020171354.GA92192@freebsd.org> From: Ivan Voras Date: Tue, 20 Oct 2009 22:27:36 +0200 X-Google-Sender-Auth: c1b6e9855ef68ced Message-ID: <9bbcef730910201327h3bbcc526ja7a8283addfe2667@mail.gmail.com> To: Roman Divacky Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 20:29:04 -0000 2009/10/20 Roman Divacky : > On Tue, Oct 20, 2009 at 02:42:17PM +0200, Ivan Voras wrote: >> Alex Kozlov wrote: >> >> >Of course ps or top output much more convenient, but if setproctitle so >> >expencive and will be called so often, then SIGINFO may be good >> >compromise. >> >> Regarding speed of setproctitle(), here are some microbenchmark results >> from the attached test source: >> >> getpid: 3661124.75 iterations/s >> setproctitle: 591357.56 iterations/s >> >> Meaning, setprocitle() is around 6 times more expensive than getpid(), >> meaning it can only be pulled off nearly 600,000 calls/s on a 2.3 GHz >> Core 2 CPU. > > what about contention? setproctitle() is an sysctl so it will prevent > other sysctl's from working when being executed.. Others sysctls... for that particular process (since it modifies process-global data) which happens to be single-threaded :P From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 23:44:32 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C28C106566C for ; Tue, 20 Oct 2009 23:44:32 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 0BB488FC14 for ; Tue, 20 Oct 2009 23:44:31 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id A6575EB47BC; Wed, 21 Oct 2009 02:44:26 +0300 (EEST) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 84CB8451B2; Wed, 21 Oct 2009 02:44:26 +0300 (EEST) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yaNh98Pob8Lg; Wed, 21 Oct 2009 02:44:26 +0300 (EEST) Received: from kobe.laptop (adsl93-117.kln.forthnet.gr [77.49.60.117]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 4C08045152; Wed, 21 Oct 2009 02:44:26 +0300 (EEST) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n9KNiPl5011844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Oct 2009 02:44:25 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n9KNiM6e011843; Wed, 21 Oct 2009 02:44:23 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Ivan Voras References: <20091019144135.GA91918@ravenloft.kiev.ua> <9bbcef730910190851m7e82bd1aqc0bc55106c8a5d37@mail.gmail.com> Date: Wed, 21 Oct 2009 02:44:22 +0300 In-Reply-To: <9bbcef730910190851m7e82bd1aqc0bc55106c8a5d37@mail.gmail.com> (Ivan Voras's message of "Mon, 19 Oct 2009 17:51:42 +0200") Message-ID: <87tyxtbpgp.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org, Alex Kozlov Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 23:44:32 -0000 On Mon, 19 Oct 2009 17:51:42 +0200, Ivan Voras wrote: >2009/10/19 Alex Kozlov : >> How about add this statistic to make info handler? > > You mean SIGINFO? Yes, that's the ``info handler''. While printing something on SINGINFO arrival is a nice idea, it may not be extremely useful for make(1). With dd(1) this is very useful to see, but with long-running make jobs that write tons of output to stderr any information from SIGINFO may be lost in the noise. From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 00:57:11 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B571C106566B for ; Wed, 21 Oct 2009 00:57:11 +0000 (UTC) (envelope-from spawk@acm.poly.edu) Received: from acm.poly.edu (acm.poly.edu [128.238.9.200]) by mx1.freebsd.org (Postfix) with ESMTP id 51DFB8FC0A for ; Wed, 21 Oct 2009 00:57:11 +0000 (UTC) Received: (qmail 1893 invoked from network); 21 Oct 2009 00:30:29 -0000 Received: from unknown (HELO ?192.168.0.2?) (spawk@69.123.45.64) by acm.poly.edu with AES256-SHA encrypted SMTP; 21 Oct 2009 00:30:29 -0000 Message-ID: <4ADE55B8.3080100@acm.poly.edu> Date: Tue, 20 Oct 2009 20:28:40 -0400 From: Boris Kochergin User-Agent: Thunderbird 2.0.0.23 (X11/20090910) MIME-Version: 1.0 To: Giorgos Keramidas References: <20091019144135.GA91918@ravenloft.kiev.ua> <9bbcef730910190851m7e82bd1aqc0bc55106c8a5d37@mail.gmail.com> <87tyxtbpgp.fsf@kobe.laptop> In-Reply-To: <87tyxtbpgp.fsf@kobe.laptop> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Alex Kozlov , Ivan Voras Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 00:57:11 -0000 Giorgos Keramidas wrote: > On Mon, 19 Oct 2009 17:51:42 +0200, Ivan Voras wrote: > >> 2009/10/19 Alex Kozlov : >> >>> How about add this statistic to make info handler? >>> >> You mean SIGINFO? >> > > Yes, that's the ``info handler''. > > While printing something on SINGINFO arrival is a nice idea, it may not > be extremely useful for make(1). With dd(1) this is very useful to see, > but with long-running make jobs that write tons of output to stderr any > information from SIGINFO may be lost in the noise. > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > The SIGINFO handler could be made to put the make process to sleep for, say, a second to give the user some time to read the statistics, but I'm sure there are lots of objections to be made to that, too. -Boris From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 01:11:44 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E39F0106568B for ; Wed, 21 Oct 2009 01:11:44 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by mx1.freebsd.org (Postfix) with ESMTP id 75E028FC0A for ; Wed, 21 Oct 2009 01:11:44 +0000 (UTC) Received: from vampire.homelinux.org (dslb-088-066-018-172.pools.arcor-ip.net [88.66.18.172]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MDF9A-1N1WD51Irc-00GgKG; Wed, 21 Oct 2009 03:11:43 +0200 Received: (qmail 23180 invoked from network); 21 Oct 2009 01:11:42 -0000 Received: from kvm.laiers.local (HELO kvm.localnet) (192.168.4.200) by mx.laiers.local with SMTP; 21 Oct 2009 01:11:42 -0000 From: Max Laier Organization: FreeBSD To: freebsd-hackers@freebsd.org Date: Wed, 21 Oct 2009 03:11:53 +0200 User-Agent: KMail/1.12.1 (Linux/2.6.30-ARCH; KDE/4.3.1; x86_64; ; ) References: <20091019140806.GB95902@rink.nu> In-Reply-To: <20091019140806.GB95902@rink.nu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200910210311.54871.max@love2party.net> X-Provags-ID: V01U2FsdGVkX18pb56dh00ih8tje1jbVVtvfQwMaYjURR9hzAP Uj1fcdOwayTyblEX32SwZwpMIxtn6/Q20JNXKM6gOaCzLaVFaS SvRTR0+cGV9bqktaIf7Lg== Cc: Rink Springer , Ivan Voras Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 01:11:45 -0000 On Monday 19 October 2009 16:08:06 Rink Springer wrote: > Hi Ivan, > > On Mon, Oct 19, 2009 at 03:52:30PM +0200, Ivan Voras wrote: > > if nobody objects, I'll commit it :) > > I seem to recall that setproctitle() is quite expensive to call; perhaps > it would make sense offer a flag to prevent make(1) from calling it? [1] Just rate-limit the setproctitle() call to once/sec or once/percentage-step and be done with it. I must say that trying it out on a kernel build didn't proof too useful as the targets have vastly different runtimes, but I think it's a good addition nonetheless. So please, go for it Ivan. > Anyway, the feature looks nice! I'd like to have it... > > [1] I'm unsure how expensive it is compared to fork(1)-ing etc; I'd > expect it's negligable but who knows... > -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 01:23:21 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35EDF106566C; Wed, 21 Oct 2009 01:23:21 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 9E2B28FC0C; Wed, 21 Oct 2009 01:23:20 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id C97DEEB4725; Wed, 21 Oct 2009 04:23:17 +0300 (EEST) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id BB948451B2; Wed, 21 Oct 2009 04:23:17 +0300 (EEST) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zf8QrbjFRJ-z; Wed, 21 Oct 2009 04:23:17 +0300 (EEST) Received: from kobe.laptop (adsl93-117.kln.forthnet.gr [77.49.60.117]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 78DF945152; Wed, 21 Oct 2009 04:23:17 +0300 (EEST) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n9L1NGxO062318 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Oct 2009 04:23:16 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n9L1NFcP062315; Wed, 21 Oct 2009 04:23:15 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Boris Kochergin References: <20091019144135.GA91918@ravenloft.kiev.ua> <9bbcef730910190851m7e82bd1aqc0bc55106c8a5d37@mail.gmail.com> <87tyxtbpgp.fsf@kobe.laptop> <4ADE55B8.3080100@acm.poly.edu> Date: Wed, 21 Oct 2009 04:23:15 +0300 In-Reply-To: <4ADE55B8.3080100@acm.poly.edu> (Boris Kochergin's message of "Tue, 20 Oct 2009 20:28:40 -0400") Message-ID: <87hbtt4k1o.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: freebsd-hackers@freebsd.org, Alex Kozlov , Ivan Voras Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 01:23:21 -0000 --=-=-= On Tue, 20 Oct 2009 20:28:40 -0400, Boris Kochergin wrote: >Giorgos Keramidas wrote: >>On Mon, 19 Oct 2009 17:51:42 +0200, Ivan Voras wrote: >>>2009/10/19 Alex Kozlov : >>>> How about add this statistic to make info handler? >>> >>> You mean SIGINFO? >> >> Yes, that's the ``info handler''. >> >> While printing something on SINGINFO arrival is a nice idea, it may >> not be extremely useful for make(1). With dd(1) this is very useful >> to see, but with long-running make jobs that write tons of output to >> stderr any information from SIGINFO may be lost in the noise. > > The SIGINFO handler could be made to put the make process to sleep > for, say, a second to give the user some time to read the statistics, > but I'm sure there are lots of objections to be made to that, too. That would be bad, indeed. David Wolfskill has emailed me, in the meantime, that it's probably ok to `lose' SIGINFO output in the noise of build output, as long as it is easy to grep for it. So I still like the idea, but without a delay please :) --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkreYoMACgkQ1g+UGjGGA7YB1gCfWK8p62e+gyaPN3FXG4bhxTdL QksAoLc1IIEJNYQOk3Pg1RBhxe6hG1jQ =m9Bt -----END PGP SIGNATURE----- --=-=-=-- From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 01:41:23 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 226F7106566B for ; Wed, 21 Oct 2009 01:41:23 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay3.uni-muenster.de (ZIVM-EXRELAY3.UNI-MUENSTER.DE [128.176.192.20]) by mx1.freebsd.org (Postfix) with ESMTP id A8E728FC1F for ; Wed, 21 Oct 2009 01:41:22 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,594,1249250400"; d="txt'?scan'208";a="16369594" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 21 Oct 2009 03:41:20 +0200 Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459) id C4BFA1B07BD; Wed, 21 Oct 2009 03:41:20 +0200 (CEST) Date: Wed, 21 Oct 2009 03:41:14 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=+permail-2009102101411480e26a0b00003712-a_best01+ Cc: Subject: mmap(2) segaults with certain len values and MAP_ANON|MAP_FIXED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 01:41:23 -0000 This is a MIME encoded multipart message. --+permail-2009102101411480e26a0b00003712-a_best01+ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit hi there, just a little mmap(2) related question. running the following code causes a segfault: mmap( (void*)0x1000, 0x80047000, PROT_NONE, MAP_ANON|MAP_FIXED, -1, 0 ); while the following doesn't: mmap( (void*)0x1000, 0xffffffff, PROT_NONE, MAP_ANON|MAP_FIXED, -1, 0 ); is this a known problem? seems reproducible on all branches. cheers alex --+permail-2009102101411480e26a0b00003712-a_best01+ Content-Type: text/plain Content-Transfer-Encoding: Base64 Content-Disposition: attachment; filename="mmaptest.c.txt" I2luY2x1ZGUgPHN5cy9tbWFuLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0ZGlv Lmg+CgppbnQgbWFpbigpCnsKCXByaW50ZigibW1hcDogJXBcbiIsIG1tYXAoICh2b2lkKikweDEw MDAsIDB4ZmZmZmZmZmYsIFBST1RfTk9ORSwgTUFQX0FOT058TUFQX0ZJWEVELCAtMSwgMCApKTsK CXByaW50ZigibW1hcDogJXBcbiIsIG1tYXAoICh2b2lkKikweDEwMDAsIDB4ODAwNDcwMDAsIFBS T1RfTk9ORSwgTUFQX0FOT058TUFQX0ZJWEVELCAtMSwgMCApKTsKCglyZXR1cm4gMDsKfQo= --+permail-2009102101411480e26a0b00003712-a_best01+-- From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 02:38:26 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C32A10656C5 for ; Wed, 21 Oct 2009 02:38:26 +0000 (UTC) (envelope-from nate@thatsmathematics.com) Received: from euclid.ucsd.edu (euclid.ucsd.edu [132.239.145.52]) by mx1.freebsd.org (Postfix) with ESMTP id 2DAD68FC22 for ; Wed, 21 Oct 2009 02:38:25 +0000 (UTC) Received: from zeno.ucsd.edu (zeno.ucsd.edu [132.239.145.22]) by euclid.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id n9L2cPo26716; Tue, 20 Oct 2009 19:38:25 -0700 (PDT) Received: from localhost (neldredg@localhost) by zeno.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id n9L2cPq19058; Tue, 20 Oct 2009 19:38:25 -0700 (PDT) X-Authentication-Warning: zeno.ucsd.edu: neldredg owned process doing -bs Date: Tue, 20 Oct 2009 19:38:24 -0700 (PDT) From: Nate Eldredge X-X-Sender: neldredg@zeno.ucsd.edu To: Alexander Best In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: mmap(2) segaults with certain len values and MAP_ANON|MAP_FIXED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 02:38:26 -0000 On Wed, 21 Oct 2009, Alexander Best wrote: > hi there, This is on a 32-bit platform I take it? > just a little mmap(2) related question. running the following code causes a > segfault: > > mmap( (void*)0x1000, 0x80047000, PROT_NONE, MAP_ANON|MAP_FIXED, -1, 0 ); I don't doubt it. You mapped over a big chunk of your address space with memory that's inaccessible (PROT_NONE). This probably includes your program's code. So when the mmap call returns from the kernel and tries to execute the next instruction of your program, it finds that the instruction pointer is pointing to inaccessible memory. Result: segfault. This is quite normal. What are you actually trying to accomplish with this? > while the following doesn't: > > mmap( (void*)0x1000, 0xffffffff, PROT_NONE, MAP_ANON|MAP_FIXED, -1, 0 ); Did you check whether the mmap actually succeeded? I bet it didn't. You have a length that isn't a multiple of the page size and wraps around 32 bits. I bet you got an EINVAL, and the mmap call didn't actually do anything. > is this a known problem? seems reproducible on all branches. Not a problem at all, I suspect. -- Nate Eldredge nate@thatsmathematics.com From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 09:03:43 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F00B1065698; Wed, 21 Oct 2009 09:03:43 +0000 (UTC) (envelope-from ady@ady.ro) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id DBC3F8FC2F; Wed, 21 Oct 2009 09:03:42 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 9so1433692eyd.9 for ; Wed, 21 Oct 2009 02:03:41 -0700 (PDT) MIME-Version: 1.0 Sender: ady@ady.ro Received: by 10.210.7.24 with SMTP id 24mr2457930ebg.53.1256115821251; Wed, 21 Oct 2009 02:03:41 -0700 (PDT) In-Reply-To: <200910210311.54871.max@love2party.net> References: <20091019140806.GB95902@rink.nu> <200910210311.54871.max@love2party.net> From: Adrian Penisoara Date: Wed, 21 Oct 2009 11:03:21 +0200 X-Google-Sender-Auth: f153f60b47a3b80a Message-ID: <78cb3d3f0910210203n66b0b08bl1bbfb3db7ec7e024@mail.gmail.com> To: Max Laier Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Rink Springer , Ivan Voras Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 09:03:43 -0000 Hi, On Wed, Oct 21, 2009 at 3:11 AM, Max Laier wrote: > On Monday 19 October 2009 16:08:06 Rink Springer wrote: >> Hi Ivan, >> >> On Mon, Oct 19, 2009 at 03:52:30PM +0200, Ivan Voras wrote: >> > if nobody objects, I'll commit it :) >> >> I seem to recall that setproctitle() is quite expensive to call; perhaps >> it would make sense offer a flag to prevent make(1) from calling it? [1] > > Just rate-limit the setproctitle() call to once/sec or once/percentage-st= ep > and be done with it. Rather try to setproctitle() in the same make process every second with a one second initial delay (so that short lived make processes won't be bogged down by this expensive call). And preferentially do the timing check after returning from exec() of a child make. This way the stats won't be "perturbed" by the short lived make's and only one make process will call setproctitle() at any time (except when running "make -j" ?). > > I must say that trying it out on a kernel build didn't proof too useful a= s the > targets have vastly different runtimes, but I think it's a good addition > nonetheless. =A0So please, go for it Ivan. > If you implement it, please use a control mechanism like, say, an environment variable MAKE_TRACK_PROGRESS, which, for performance and POLA sake, might default to disabled (including when environment is not defined). My 5cents, Adrian Penisoara EnterpriseBSD.com From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 10:20:28 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEB13106566B for ; Wed, 21 Oct 2009 10:20:28 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 831B88FC0A for ; Wed, 21 Oct 2009 10:20:28 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 4DD8C6D41C; Wed, 21 Oct 2009 10:20:27 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 1C682844CC; Wed, 21 Oct 2009 12:20:27 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Manuel Gebele" References: <20091021100451.98450@gmx.net> Date: Wed, 21 Oct 2009 12:20:27 +0200 In-Reply-To: <20091021100451.98450@gmx.net> (Manuel Gebele's message of "Wed, 21 Oct 2009 12:04:51 +0200") Message-ID: <863a5dt5ec.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 10:20:28 -0000 "Manuel Gebele" writes: > Dag-Erling Sm=C3=B8rgrav writes: > > I would have just called it DAQ, which as you know is an established > > abbreviation for "Data Acquisition". [...] > I have no objection to that naming. Maybe I should call it just > ``FreeBSD DAQ Facility'' (FDF). I don't understand why it has to be so complicated. What's wrong with just "DAQ"? (not that any of this really matters in the big picture...) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 12:01:22 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA8C91065672 for ; Wed, 21 Oct 2009 12:01:22 +0000 (UTC) (envelope-from forensixs@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 577EB8FC12 for ; Wed, 21 Oct 2009 12:01:21 +0000 (UTC) Received: (qmail 18753 invoked by uid 0); 21 Oct 2009 12:01:21 -0000 Received: from 78.53.193.141 by www024.gmx.net with HTTP; Wed, 21 Oct 2009 14:01:20 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-1" Date: Wed, 21 Oct 2009 14:01:20 +0200 From: "Manuel Gebele" In-Reply-To: <863a5dt5ec.fsf@ds4.des.no> Message-ID: <20091021120120.163550@gmx.net> MIME-Version: 1.0 References: <20091021100451.98450@gmx.net> <863a5dt5ec.fsf@ds4.des.no> To: =?iso-8859-1?Q?=22Dag-Erling_Sm=F8rgrav=22?= X-Authenticated: #52019271 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1+lpEJOL0uldLbEjUQpjVehCurABbuobqYxl+0vqW 3fOpZnBsEuVn4B5x3V43izPqCmwfHeQqRYTg== Content-Transfer-Encoding: 8bit X-GMX-UID: KcDoA6t4QEV/BnD2cHZpNjdCNzg2NUIa X-FuHaFi: 0.51 Cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 12:01:23 -0000 on 21/10/2009 12:20 Dag-Erling Smørgrav said the following: > I don't understand why it has to be so complicated. > What's wrong with just "DAQ"? [...] What please is complicated in ``FreeBSD DAQ Facility''? Whats about KLD ``Dynamic Kernel Linker Facility''? BTW, if I send you a private email and you answer to the list, it would be great if you could put in all of the email content: on 20/10/2009 15:24 Dag-Erling Smørgrav said the following: > First, when you answer a question on a mailing list, > it is customary to use your MUA's "reply" function and > to quote the question. Otherwise, there is nothing to > tie the answer to the question, and nobody will understand > anything, except possibly the person who asked the question > in the first place. [...] Oh, my mistake sorry for that. I'm not an ML expert at all, and that was my first message to a list (in that 'reply' context). > That being taken care of - the reason I asked is that > to me (and to many other time boffins and NTP > fundamentalists), DCF is a longwave radio station in > Frankfurt which is commonly used as an external reference > for NTP servers. DCF(77) is in the near of "Frankfurt am Main (not Oder)" thats true. On the other side, there are so many definitions for DCF; Data Capture Facility, Data Compression Facility and so on (look at http://www.acronymfinder.com/DCF.html). We get problems if we open ``/dev/dcf77'' --maybe =) Whats about the MSF station in Rugby --england? MSF - Microsoft Solutions Framework (please no jokes about $MS) MSF - Metasploit Framework Whats about code with an 'VLF' acronym =) ? --better not But I understand your point, maybe we should exclude any misunderstandings. > I would have just called it DAQ, which as you know is > an established abbreviation for "Data Acquisition". [...] I have no objection to that naming. Maybe I should call it just ``FreeBSD DAQ Facility'' (FDF). Thanks, Manuel Gebele -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 13:53:13 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E29791065697 for ; Wed, 21 Oct 2009 13:53:13 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay2.uni-muenster.de (ZIVM-EXRELAY2.UNI-MUENSTER.DE [128.176.192.15]) by mx1.freebsd.org (Postfix) with ESMTP id 758168FC08 for ; Wed, 21 Oct 2009 13:53:12 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,597,1249250400"; d="scan'208";a="226843881" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER03.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 21 Oct 2009 15:53:11 +0200 Received: by ZIVMAILUSER03.UNI-MUENSTER.DE (Postfix, from userid 149459) id 7405B1B0750; Wed, 21 Oct 2009 15:53:11 +0200 (CEST) Date: Wed, 21 Oct 2009 15:53:10 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Nate Eldredge Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: mmap(2) segaults with certain len values and MAP_ANON|MAP_FIXED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 13:53:14 -0000 Nate Eldredge schrieb am 2009-10-21: > On Wed, 21 Oct 2009, Alexander Best wrote: > >hi there, > This is on a 32-bit platform I take it? yes. > >just a little mmap(2) related question. running the following code > >causes a > >segfault: > >mmap( (void*)0x1000, 0x80047000, PROT_NONE, MAP_ANON|MAP_FIXED, -1, > >0 ); > I don't doubt it. You mapped over a big chunk of your address space > with memory that's inaccessible (PROT_NONE). This probably includes > your program's code. So when the mmap call returns from the kernel > and tries to execute the next instruction of your program, it finds > that the instruction pointer is pointing to inaccessible memory. > Result: segfault. This is quite normal. > What are you actually trying to accomplish with this? this code serves only one purpose: to trigger a segfault. i don't use the code for any other purpose. i was under the impression that mmap() should either succeed or fail (tertium non datur). mmap's manual doesn't say anything about mmap() causing segfaults. from your description of the problem i don't think there's a quick fix to it. so it might be a good idea to add this case to the mmap(2) bug section. > >while the following doesn't: > >mmap( (void*)0x1000, 0xffffffff, PROT_NONE, MAP_ANON|MAP_FIXED, -1, > >0 ); > Did you check whether the mmap actually succeeded? I bet it didn't. > You have a length that isn't a multiple of the page size and wraps > around 32 bits. I bet you got an EINVAL, and the mmap call didn't > actually do anything. > >is this a known problem? seems reproducible on all branches. > Not a problem at all, I suspect. > -- indeed the mmap() call fails with EINVAL but it doesn't segfault. to make this clear: i don't expect either one of the mmap() calls to succeed. > Nate Eldredge > nate@thatsmathematics.com From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 15:06:05 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A31B9106568D for ; Wed, 21 Oct 2009 15:06:05 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7B7F98FC1A for ; Wed, 21 Oct 2009 15:06:05 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 1A96A46B2C; Wed, 21 Oct 2009 11:06:05 -0400 (EDT) Date: Wed, 21 Oct 2009 16:06:04 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Best In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Nate Eldredge Subject: Re: mmap(2) segaults with certain len values and MAP_ANON|MAP_FIXED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 15:06:05 -0000 On Wed, 21 Oct 2009, Alexander Best wrote: > this code serves only one purpose: to trigger a segfault. i don't use the > code for any other purpose. i was under the impression that mmap() should > either succeed or fail (tertium non datur). mmap's manual doesn't say > anything about mmap() causing segfaults. Have you tried ktracing the application? I think you'll find that mmap(2) system call succeeded fine, and that the segfault comes from attempting to execute the address in libc on return to userspace, as a result of libc not being at that address anymore (since you removed its mapping). You can use procstat -v to inspect address space use by processes, but as a general rule you don't want to pass anything other than an address of 0x0 to mmap(2) unless you're very carefully managing the address space of the process. Many userspace libraries are involved in using that address space, but especially the runtime linker which begins execution in userspace when a binary is started. Robert N M Watson Computer Laboratory University of Cambridge From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 15:30:54 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 193EF106566B; Wed, 21 Oct 2009 15:30:54 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay2.uni-muenster.de (ZIVM-EXRELAY2.UNI-MUENSTER.DE [128.176.192.15]) by mx1.freebsd.org (Postfix) with ESMTP id 6C0658FC08; Wed, 21 Oct 2009 15:30:53 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,597,1249250400"; d="scan'208";a="226853123" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 21 Oct 2009 17:30:52 +0200 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 455031B0766; Wed, 21 Oct 2009 17:30:52 +0200 (CEST) Date: Wed, 21 Oct 2009 17:30:51 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Robert Watson Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Nate Eldredge Subject: Re: mmap(2) segaults with certain len values and MAP_ANON|MAP_FIXED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 15:30:54 -0000 Robert Watson schrieb am 2009-10-21: > On Wed, 21 Oct 2009, Alexander Best wrote: > >this code serves only one purpose: to trigger a segfault. i don't > >use the code for any other purpose. i was under the impression that > >mmap() should either succeed or fail (tertium non datur). mmap's > >manual doesn't say anything about mmap() causing segfaults. > Have you tried ktracing the application? I think you'll find that > mmap(2) system call succeeded fine, and that the segfault comes from > attempting to execute the address in libc on return to userspace, as > a result of libc not being at that address anymore (since you > removed its mapping). You can use procstat -v to inspect address > space use by processes, but as a general rule you don't want to pass > anything other than an address of 0x0 to mmap(2) unless you're very > carefully managing the address space of the process. Many userspace > libraries are involved in using that address space, but especially > the runtime linker which begins execution in userspace when a binary > is started. > Robert N M Watson > Computer Laboratory > University of Cambridge you're right. this kdump shows that the segfault isn't being caused by the mmap() call: 88343 mmap_test CALL mmap(0x1000,0x80047000,PROT_NONE,MAP_FIXED|MAP_ANON,0xffffffff,0,0) 88343 mmap_test RET mmap 4096/0x1000 88343 mmap_test PSIG SIGSEGV SIG_DFL 88343 mmap_test NAMI "mmap_test.core" thanks for clearing things up. however i stil think mentioning this situation in the mmap(2) manual (maybe in section MAP_FIXED) would be a good idea. cheers. alex From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 15:51:13 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 896F7106566B for ; Wed, 21 Oct 2009 15:51:13 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay3.uni-muenster.de (ZIVM-EXRELAY3.UNI-MUENSTER.DE [128.176.192.20]) by mx1.freebsd.org (Postfix) with ESMTP id 175A08FC1A for ; Wed, 21 Oct 2009 15:51:12 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,597,1249250400"; d="txt'?scan'208";a="16434001" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER03.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 21 Oct 2009 17:51:11 +0200 Received: by ZIVMAILUSER03.UNI-MUENSTER.DE (Postfix, from userid 149459) id 8ADC61B0750; Wed, 21 Oct 2009 17:51:11 +0200 (CEST) Date: Wed, 21 Oct 2009 17:51:04 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=+permail-200910211551041e86ffa80000182a-a_best01+ Cc: Subject: mmap(2) with MAP_ANON honouring offset although it shouldn't X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 15:51:13 -0000 This is a MIME encoded multipart message. --+permail-200910211551041e86ffa80000182a-a_best01+ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit although the mmap(2) manual states in section MAP_ANON: "The offset argument is ignored." this doesn't seem to be true. running printf("%p\n", mmap((void*)0x1000, 0x1000, PROT_NONE, MAP_ANON, -1, 0x12345678)); and printf("%p\n", mmap((void*)0x1000, 0x1000, PROT_NONE, MAP_ANON, -1, 0)); produces different outputs. i've attached a patch to solve the problem. the patch is similar to the one proposed in this PR, but should apply cleanly to CURRENT: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/71258 cheers. alex --+permail-200910211551041e86ffa80000182a-a_best01+ Content-Type: text/plain Content-Transfer-Encoding: Base64 Content-Disposition: attachment; filename="vmmmap.c.patch.txt" LS0tIHNyYy9zeXMvdm0vdm1fbW1hcC5jCTIwMDktMTAtMjEgMDQ6MTM6MjQuMDAwMDAwMDAwICsw MjAwCisrKyBzcmMvc3lzL3ZtL3ZtX21tYXAuYwkyMDA5LTEwLTIxIDA0OjEzOjQzLjAwMDAwMDAw MCArMDIwMApAQCAtMjQ1LDE1ICsyNDUsMTggQEAKIAl9CiAKIAkvKgotCSAqIEFsaWduIHRoZSBm aWxlIHBvc2l0aW9uIHRvIGEgcGFnZSBib3VuZGFyeSwKLQkgKiBhbmQgc2F2ZSBpdHMgcGFnZSBv ZmZzZXQgY29tcG9uZW50LgorCSAqIFVubGVzcyB0aGUgTUFQX0FOT04gZmxhZyBpcyBzZXQsIGFs aWduIHRoZSBmaWxlIHBvc2l0aW9uCisJICogdG8gYSBwYWdlIGJvdW5kYXJ5IGFuZCBzYXZlIGl0 cyBwYWdlIG9mZnNldCBjb21wb25lbnQuCiAJICovCi0JcGFnZW9mZiA9IChwb3MgJiBQQUdFX01B U0spOwotCXBvcyAtPSBwYWdlb2ZmOwotCi0JLyogQWRqdXN0IHNpemUgZm9yIHJvdW5kaW5nIChv biBib3RoIGVuZHMpLiAqLwotCXNpemUgKz0gcGFnZW9mZjsJCQkvKiBsb3cgZW5kLi4uICovCi0J c2l6ZSA9ICh2bV9zaXplX3QpIHJvdW5kX3BhZ2Uoc2l6ZSk7CS8qIGhpIGVuZCAqLworCWlmIChm bGFncyAmIE1BUF9BTk9OKSB7CisJCXBhZ2VvZmYgPSBwb3MgPSAwOworCX0gZWxzZSB7CisJCXBh Z2VvZmYgPSAocG9zICYgUEFHRV9NQVNLKTsKKwkJcG9zIC09IHBhZ2VvZmY7CisJCS8qIEFkanVz dCBzaXplIGZvciByb3VuZGluZyAob24gYm90aCBlbmRzKS4gKi8KKwkJc2l6ZSArPSBwYWdlb2Zm OwkJCS8qIGxvdyBlbmQuLi4gKi8KKwkJc2l6ZSA9ICh2bV9zaXplX3QpIHJvdW5kX3BhZ2Uoc2l6 ZSk7CS8qIGhpIGVuZCAqLworCX0KIAogCS8qCiAJICogQ2hlY2sgZm9yIGlsbGVnYWwgYWRkcmVz c2VzLiAgV2F0Y2ggb3V0IGZvciBhZGRyZXNzIHdyYXAuLi4gTm90ZQpAQCAtMzAwLDcgKzMwMyw2 IEBACiAJCWhhbmRsZSA9IE5VTEw7CiAJCWhhbmRsZV90eXBlID0gT0JKVF9ERUZBVUxUOwogCQlt YXhwcm90ID0gVk1fUFJPVF9BTEw7Ci0JCXBvcyA9IDA7CiAJfSBlbHNlIHsKIAkJLyoKIAkJICog TWFwcGluZyBmaWxlLCBnZXQgZnAgZm9yIHZhbGlkYXRpb24gYW5kCg== --+permail-200910211551041e86ffa80000182a-a_best01+-- From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 17:16:51 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7D24106566B for ; Wed, 21 Oct 2009 17:16:51 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 9ABB48FC17 for ; Wed, 21 Oct 2009 17:16:51 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id C5D336D41B; Wed, 21 Oct 2009 17:16:50 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 55541844CC; Wed, 21 Oct 2009 19:16:50 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Manuel Gebele" References: <20091021100451.98450@gmx.net> <863a5dt5ec.fsf@ds4.des.no> <20091021120120.163550@gmx.net> Date: Wed, 21 Oct 2009 19:16:50 +0200 In-Reply-To: <20091021120120.163550@gmx.net> (Manuel Gebele's message of "Wed, 21 Oct 2009 14:01:20 +0200") Message-ID: <86y6n4sm4d.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD DAQ Card Facility [DCF] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 17:16:51 -0000 "Manuel Gebele" writes: > BTW, if I send you a private email and you answer to the list, I answered to an email you sent to the list. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 16:42:47 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECB31106566C for ; Wed, 21 Oct 2009 16:42:47 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-fx0-f210.google.com (mail-fx0-f210.google.com [209.85.220.210]) by mx1.freebsd.org (Postfix) with ESMTP id 8670E8FC20 for ; Wed, 21 Oct 2009 16:42:47 +0000 (UTC) Received: by fxm6 with SMTP id 6so7588014fxm.43 for ; Wed, 21 Oct 2009 09:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=/MxZ0LzQ3CpbORNUzrpa9zjzzUq/MTPzsUCM8DBW61A=; b=rhaV0MfflolRnESWbw4HsQJS915kp6htYr0tleMyGbIvbtOQ1ekzZhWdUesm1KrTCs q06T5Khhx7PoT+WxXK5xq2FR5PEQal7akEj0qHZFS3nz68+mUC39bRwjalWxsyMAAAfu Q0BiX/nIM2FKR3ZhkEFH8Gj+3bWh/PJqlLwBo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=apKi5EPzGkT7YLpXC4wNkz4mqGOb78b2n26rGTb7rBAIIiVDhd75BcPcD7ORnedvGB vLmQn+BrkHiUCyRf/ICsURLn9jATSNbn9YweAx2Cfn2IRHkOKZzy6CTc3f3ruElQbHrO 0l0vU1eiFFZNLsQ/Heke/dDZkOD0zEMumY7iQ= MIME-Version: 1.0 Received: by 10.223.143.73 with SMTP id t9mr1575837fau.89.1256142075691; Wed, 21 Oct 2009 09:21:15 -0700 (PDT) Date: Wed, 21 Oct 2009 11:21:15 -0500 Message-ID: <2d1264630910210921w4a2fabb1h86e12658a3f7c714@mail.gmail.com> From: Jason Harmening To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Mailman-Approved-At: Wed, 21 Oct 2009 17:29:42 +0000 Subject: multi-seg bus_dmamem_alloc? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 16:42:48 -0000 Hi everyone, It seems like there are starting to be some drivers that need to allocate large chunks of DMA-able memory, and since bus_dmamem_alloc() on most architectures is always physically contiguous, it may not work for them. It seems like we could use the new sglist routines to help us here: --Define 2 new functions: int bus_dmamem_alloc_sglist(bus_dma_tag_t dmat, size_t size, struct sglist *sg, int flags, bus_dmamap_t *mapp) void bus_dmamem_free_sglist(bus_dma_tag_t dmat, struct sglist *sg, bus_dmamap_t map); --For sparc64 (or anywhere else we want to use an IOMMU): malloc() the buffer, feed it to sglist_build(), program the IOMMU to meet the constraints in dmat--Isn't this what we already do for sparc64, minus the sglist part? --For direct-mapped architectures: If the constraints in dmat are lenient enough, do malloc() and sglist_build(). Otherwise, do contigmalloc(M_NOWAIT) in a loop, in which we try to allocate as much of the buffer as possible. Anytime an allocation fails, we divide the allocation size by (roughly) 2 until the allocation succeeds, and continue allocating until either we've allocated enough space, or the allocation size drops below PAGE_SIZE, or we exceed dmat->maxsegs. --Some other things we'd need: --bus_dmamap_load_sglist()--I think jhb already did this as part of the sglist work, at least for amd64 --Structures in the busdma map to track allocated buffers so we could free them later. --Are there lower-level calls we could make to just allocate the physical pages instead of malloc()/contigmalloc()? The kva mapping for each allocated buffer segment isn't necessary. A lot of drivers would probably just want to mmap the sglist to userspace anyway. --Could we instead just integrate this multi-seg functionality into the default bus_dmamem_alloc()? We'd at least have to be able map the physical segments into a contiguous kva area--we wouldn't necessarily have to use an sglist in this case either. Let me know if this idea has any potential--if it does, I'd love to try implementing it:) --Jason From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 17:51:10 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78A111065692 for ; Wed, 21 Oct 2009 17:51:10 +0000 (UTC) (envelope-from alan.l.cox@gmail.com) Received: from mail-pw0-f44.google.com (mail-pw0-f44.google.com [209.85.160.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4C3558FC0C for ; Wed, 21 Oct 2009 17:51:10 +0000 (UTC) Received: by pwj1 with SMTP id 1so1257432pwj.3 for ; Wed, 21 Oct 2009 10:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=B+NG30OGs+ik45l73KN8DH0bXhwGM0Z/w6YueASDgPE=; b=pSPbYtzF4UpO22e37YMb1eppce2QkjC0AuR4o/d6d2QGlaZGCMXCrFJGHVU4Z0DynQ 1w/KhUy193L7W113bQkTHPoxBEnTtVAItHk/yAeunfuJCF1VKVxxDBtBtXSx0Y933DAZ txxHWy58C5LwZKibNbbo44uy/ERBt0/yVFEs0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; b=LtO2zfph/FxXrJoEiKEo8+Djmlz95H93CMpeeXdyYXCQGJBmslGs4VRTsu+Ls8xbht IRDp+9TimIz/W3tAJLToIUER2BP/vskR6Kj1ZJtnkf+yzADzxu9pmRyXpOFLhPbbQOC7 YK7CW3LOFIlPRIXvKy1gchUg9MecMNSmpjL4Y= MIME-Version: 1.0 Received: by 10.143.129.7 with SMTP id g7mr579544wfn.336.1256147469959; Wed, 21 Oct 2009 10:51:09 -0700 (PDT) In-Reply-To: References: Date: Wed, 21 Oct 2009 12:51:09 -0500 Message-ID: From: Alan Cox To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: mmap(2) with MAP_ANON honouring offset although it shouldn't X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: alc@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 17:51:10 -0000 On Wed, Oct 21, 2009 at 10:51 AM, Alexander Best < alexbestms@math.uni-muenster.de> wrote: > although the mmap(2) manual states in section MAP_ANON: > > "The offset argument is ignored." > > this doesn't seem to be true. running > > printf("%p\n", mmap((void*)0x1000, 0x1000, PROT_NONE, MAP_ANON, -1, > 0x12345678)); > > and > > printf("%p\n", mmap((void*)0x1000, 0x1000, PROT_NONE, MAP_ANON, -1, 0)); > > produces different outputs. i've attached a patch to solve the problem. the > patch is similar to the one proposed in this PR, but should apply cleanly > to > CURRENT: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/71258 > The standards for mmap(2) actually disallow values of "off" that are not a multiple of the page size. See http://www.opengroup.org/onlinepubs/000095399/functions/mmap.html for the following: [EINVAL]The *addr* argument (if MAP_FIXED was specified) or *off* is not a multiple of the page size as returned by *sysconf*(), or is considered invalid by the implementation.Both Solaris and Linux enforce this restriction. I'm not convinced that the ability to specify a value for "off" that is not a multiple of the page size is a useful differentiating feature of FreeBSD versus Solaris or Linux. Does anyone have a compelling argument (or use case) to motivate us being different in this respect? If you disallow values for "off" that are not a multiple of the page size, then you are effectively ignoring "off" for MAP_ANON. Regards, Alan From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 17:51:16 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 622051065672; Wed, 21 Oct 2009 17:51:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3243E8FC13; Wed, 21 Oct 2009 17:51:16 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id AE2B146B06; Wed, 21 Oct 2009 13:51:15 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 85E598A021; Wed, 21 Oct 2009 13:51:14 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 21 Oct 2009 13:40:39 -0400 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910211340.39872.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 21 Oct 2009 13:51:14 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Alexander Best , Robert Watson , Nate Eldredge Subject: Re: mmap(2) segaults with certain len values and MAP_ANON|MAP_FIXED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 17:51:16 -0000 On Wednesday 21 October 2009 11:30:51 am Alexander Best wrote: > Robert Watson schrieb am 2009-10-21: > > > On Wed, 21 Oct 2009, Alexander Best wrote: > > > >this code serves only one purpose: to trigger a segfault. i don't > > >use the code for any other purpose. i was under the impression that > > >mmap() should either succeed or fail (tertium non datur). mmap's > > >manual doesn't say anything about mmap() causing segfaults. > > > Have you tried ktracing the application? I think you'll find that > > mmap(2) system call succeeded fine, and that the segfault comes from > > attempting to execute the address in libc on return to userspace, as > > a result of libc not being at that address anymore (since you > > removed its mapping). You can use procstat -v to inspect address > > space use by processes, but as a general rule you don't want to pass > > anything other than an address of 0x0 to mmap(2) unless you're very > > carefully managing the address space of the process. Many userspace > > libraries are involved in using that address space, but especially > > the runtime linker which begins execution in userspace when a binary > > is started. > > > Robert N M Watson > > Computer Laboratory > > University of Cambridge > > > you're right. this kdump shows that the segfault isn't being caused by the > mmap() call: > > 88343 mmap_test CALL > mmap(0x1000,0x80047000,PROT_NONE,MAP_FIXED|MAP_ANON,0xffffffff,0,0) > 88343 mmap_test RET mmap 4096/0x1000 > 88343 mmap_test PSIG SIGSEGV SIG_DFL > 88343 mmap_test NAMI "mmap_test.core" > > thanks for clearing things up. > > however i stil think mentioning this situation in the mmap(2) manual (maybe in > section MAP_FIXED) would be a good idea. I'm not sure it is useful to attempt to enumerate all the possible ways one can shoot one's own foot using mmap(2) in the manual page. The list would be quite long and would require a large amount of imagination. In effect, you are asking for a manual page to document all the possible bugs one could have and manual pages in general do not do that. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 21 17:51:17 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E010106566B for ; Wed, 21 Oct 2009 17:51:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id F365C8FC14 for ; Wed, 21 Oct 2009 17:51:16 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A62D546B38; Wed, 21 Oct 2009 13:51:16 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E07B18A024; Wed, 21 Oct 2009 13:51:15 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 21 Oct 2009 13:49:09 -0400 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910211349.10174.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 21 Oct 2009 13:51:16 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Alexander Best Subject: Re: mmap(2) with MAP_ANON honouring offset although it shouldn't X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 17:51:17 -0000 On Wednesday 21 October 2009 11:51:04 am Alexander Best wrote: > although the mmap(2) manual states in section MAP_ANON: > > "The offset argument is ignored." > > this doesn't seem to be true. running > > printf("%p\n", mmap((void*)0x1000, 0x1000, PROT_NONE, MAP_ANON, -1, > 0x12345678)); > > and > > printf("%p\n", mmap((void*)0x1000, 0x1000, PROT_NONE, MAP_ANON, -1, 0)); > > produces different outputs. i've attached a patch to solve the problem. the > patch is similar to the one proposed in this PR, but should apply cleanly to > CURRENT: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/71258 A simpler patch would be to simply set pos = 0 below the MAP_STACK line if MAP_ANON is set. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 09:52:39 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6695A106566B; Thu, 22 Oct 2009 09:52:38 +0000 (UTC) (envelope-from ben.crowhurst@beatsystems.com) Received: from mail.beatsystems.com (mail.beatsystems.com [213.123.115.107]) by mx1.freebsd.org (Postfix) with ESMTP id C049B8FC1A; Thu, 22 Oct 2009 09:52:37 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.beatsystems.com (Postfix) with ESMTP id 1BC8CFA6C; Thu, 22 Oct 2009 10:38:29 +0100 (BST) X-Virus-Scanned: amavisd-new at beatsystems.com Received: from mail.beatsystems.com ([127.0.0.1]) by localhost (mail.beatsystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2My8UAiOyAiz; Thu, 22 Oct 2009 10:38:28 +0100 (BST) Received: from [192.168.0.116] (kohlrabi.beatsystems.com [192.168.0.116]) by mail.beatsystems.com (Postfix) with ESMTP id 9BBCBFA6B; Thu, 22 Oct 2009 10:38:27 +0100 (BST) Message-ID: <4AE02815.2010103@beatsystems.com> Date: Thu, 22 Oct 2009 10:38:29 +0100 From: Ben Crowhurst User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: alc@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Alexander Best Subject: Re: mmap(2) with MAP_ANON honouring offset although it shouldn't X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ben.crowhurst@beatsystems.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 09:52:39 -0000 Alan Cox wrote: > On Wed, Oct 21, 2009 at 10:51 AM, Alexander Best < > alexbestms@math.uni-muenster.de> wrote: > > >> although the mmap(2) manual states in section MAP_ANON: >> >> "The offset argument is ignored." >> >> this doesn't seem to be true. running >> >> printf("%p\n", mmap((void*)0x1000, 0x1000, PROT_NONE, MAP_ANON, -1, >> 0x12345678)); >> >> and >> >> printf("%p\n", mmap((void*)0x1000, 0x1000, PROT_NONE, MAP_ANON, -1, 0)); >> >> produces different outputs. i've attached a patch to solve the problem. the >> patch is similar to the one proposed in this PR, but should apply cleanly >> to >> CURRENT: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/71258 >> >> > > The standards for mmap(2) actually disallow values of "off" that are not a > multiple of the page size. > > See http://www.opengroup.org/onlinepubs/000095399/functions/mmap.html for > the following: > [EINVAL]The *addr* argument (if MAP_FIXED was specified) or *off* is not a > multiple of the page size as returned by > *sysconf*(), > or is considered invalid by the implementation.Both Solaris and Linux > enforce this restriction. > > I'm not convinced that the ability to specify a value for "off" that is not > a multiple of the page size is a useful differentiating feature of FreeBSD > versus Solaris or Linux. Does anyone have a compelling argument (or use > case) to motivate us being different in this respect? > > If you disallow values for "off" that are not a multiple of the page size, > then you are effectively ignoring "off" for MAP_ANON. > > Regards, > Alan > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > would it be such a bad idea as to round up the addr/off arguments to the next page size? This was most likely the intention of the caller anyway. Cheers, Ben From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 08:38:45 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03F8B106568B for ; Thu, 22 Oct 2009 08:38:45 +0000 (UTC) (envelope-from yeqing.yan@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx1.freebsd.org (Postfix) with ESMTP id D8D088FC1A for ; Thu, 22 Oct 2009 08:38:44 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 22 Oct 2009 01:25:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,604,1249282800"; d="scan'208,217";a="739130715" Received: from pgsmsx603.gar.corp.intel.com ([10.221.43.87]) by fmsmga001.fm.intel.com with ESMTP; 22 Oct 2009 01:25:15 -0700 Received: from pdsmsx601.ccr.corp.intel.com (172.16.12.94) by pgsmsx603.gar.corp.intel.com (10.221.43.87) with Microsoft SMTP Server (TLS) id 8.1.358.0; Thu, 22 Oct 2009 16:21:09 +0800 Received: from pdsmsx501.ccr.corp.intel.com ([172.16.12.89]) by pdsmsx601.ccr.corp.intel.com ([172.16.12.94]) with mapi; Thu, 22 Oct 2009 16:20:32 +0800 From: "Yan, Yeqing" To: "hackers@freebsd.org" Date: Thu, 22 Oct 2009 16:20:32 +0800 Thread-Topic: About FreeBSD syscall usage Thread-Index: AcpS6Xfn+umalv0TRVGsIZ2MSSiqJQABuluw Message-ID: <95608CFE3D0C064B8468DB61F8403BE04A0D4A1C5E@PDSMSX501.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 22 Oct 2009 11:31:32 +0000 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: About FreeBSD syscall usage X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 08:38:45 -0000 SGk6DQoNCkmhr20gZnJvbSBJbnRlbCBDaGluYS4gT3VyIHByb2plY3QgdXNlIEZyZWVCU0QgNy4w LiBJIGhhdmUgc29tZSBxdWVzdGlvbiBhYm91dCBzeXNjYWxsIHVzYWdlIGJ1dCBJIHRoaW5rIG1h aWwgdG8gdGhlIHdyb25nIGFkZHJlc3MgYmVmb3JlLg0KDQpJcyB0aGVyZSBoYXZpbmcgYW55IGRv YyBvciBleGFtcGxlIGFib3V0IGhvdyB0byB1c2UgdGhlc2Ugc3lzY2FsbD8NCg0KDQoNCmtzZV9l eGl0DQoNCmtzZV93YWtldXANCg0Ka3NlX2NyZWF0ZQ0KDQprc2VfdGhyX2ludGVycnVwdA0KDQpr c2VfcmVsZWFzZQ0KDQprc2Vfc3dpdGNoaW4NCg0KSSByZWFkICRtYW4ga3NlLCBidXQgSSBjYW4g bm90IGZpbmQgYW55IGV4YW1wbGUgYWJvdXQgaG93IHRvIHVzZSBpdC4gSSB3cml0ZSBzb21lIHRl c3QgY29kZXMgdG8gY2FsbCB0aGVzZSBmdW5jdGlvbiBidXQgYWxsIHRoZXNlIGNvZGVzIGFyZSBm YWlsZWQuDQoNCg0KDQptYWNfc3lzY2FsbA0KDQpJIHJlYWQgJG1hbiAzIG1hYywgYnV0IEkgY2Fu IG5vdCBmaW5kIHRoZSB1c2FnZSBhYm91dCBtYWNfc3lzY2FsbCBmdW5jdGlvbi4NCg0KDQoNCnRo cl9jcmVhdGUNCg0KdGhyX3N1c3BlbmQNCg0KdGhyX2tpbGwyDQoNCg0KDQpCeSB0aGUgd2F5LCBp dCBpcyBzYWlkIKGwSSB0aGluayB0aGF0IEtTRSB3YXMgdXNlZCBpbiA1LnggYW5kIDYueCBhbmQg dGhlbiBkcm9wcGVkIGluIGZhdm9yIG9mIGEgMToxIHRocmVhZGluZyBtb2RlbCB3aGVuIDcuMCB3 YXMgcmVsZWFzZWShsQ0KDQpEb2VzIGl0IG1lYW4gdGhlIEtTRSBzeXNjYWxsIGNhbiBiZSByZW1v dmVkIGZyb20gRnJlZUJTRCA3LjA/DQoNCg0KDQpUaGFuayB5b3UgdmVyeSBtdWNoIQ0KDQoNCg0K LS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCkZyb206IEtldmluIEtpbnNleSBbbWFpbHRvOmtk a0BkYWxlY28uYml6XQ0KU2VudDogMjAwOcTqMTDUwjIxyNUgMjI6MTgNClRvOiBZYW4sIFllcWlu Zw0KQ2M6IGZyZWVic2QtcXVlc3Rpb25zQEZyZWVCU0Qub3JnDQpTdWJqZWN0OiBSZTogUXVlc3Rp b24gYWJvdXQgRnJlZUJTRCBzeXNjYWxsIHVzYWdlDQoNCg0KDQpZYW4sIFllcWluZyB3cm90ZToN Cg0KPiBIaToNCg0KPiBJJ20gZnJvbSBJbnRlbCBDaGluYS4gT3VyIHByb2plY3QgdXNlIEZyZWVC U0QgNy4wDQoNCiA+IGFuZCBJIGhhdmUgc29tZSBxdWVzdGlvbnMgYWJvdXQgdGhlIEZyZWVCU0Qg c3lzY2FsbC4NCg0KPiBJIGRvbid0IGtub3cgaG93IHRvIHVzZSB0aGVzZSBzeXNjYWxsIGJlbG93 Lg0KDQo+IElzIHRoZXJlIGhhdmluZyBzb21lIGRvYyBvciBleGFtcGxlIGFib3V0IGhvdyB0byB1 c2UgdGhlc2Ugc3lzY2FsbD8NCg0KPg0KDQo+IGtzZV9leGl0DQoNCj4ga3NlX3dha2V1cA0KDQo+ IGtzZV9jcmVhdGUNCg0KPiBrc2VfdGhyX2ludGVycnVwdA0KDQo+IGtzZV9yZWxlYXNlDQoNCj4g a3NlX3N3aXRjaGluDQoNCj4NCg0KPiBtYWNfc3lzY2FsbA0KDQo+DQoNCj4gdGhyX2NyZWF0ZQ0K DQo+IHRocl9zdXNwZW5kDQoNCj4gdGhyX2tpbGwyDQoNCj4NCg0KPiBUaGFuayB5b3UgdmVyeSBt dWNoIQ0KDQo+DQoNCj4gQmVzdCBSZWdhcmRzDQoNCj4gWWFuLCBZZXFpbmcNCg0KDQoNCkhlbGxv IFllcWluZywNCg0KDQoNCllvdSBtaWdodCB3YW50IHRvIHdyaXRlIHRvICJoYWNrZXJzQGZyZWVi c2Qub3JnIiAuLi4NCg0KLi4uIHNvbWUgb2YgdGhvc2UgZ3V5cyAqd3JvdGUqIHRoZXNlIHN5c2Nh bGxzLiAgSG93ZXZlciwNCg0Kc2luY2UgaXQncyBhIHF1ZXN0aW9uLCBJJ2xsIHRha2UgYSBzdGFi IGF0IGl0Lg0KDQoNCg0KSGF2ZSB5b3UgcmVhZDoNCg0KDQoNCiRtYW4ga3NlDQoNCiRtYW4gMyBt YWMNCg0KJG1hbiBsaWJ0aHIgID8NCg0KDQoNCkFsc28sIHNlZSB3d3cuZnJlZWJzZC5vcmcva3Nl Lw0KDQoNCg0KSG93ZXZlciwgSSB0aGluayB0aGF0IEtTRSB3YXMgdXNlZCBpbiA1LnggYW5kIDYu eA0KDQphbmQgdGhlbiBkcm9wcGVkIGluIGZhdm9yIG9mIGEgMToxIHRocmVhZGluZyBtb2RlbA0K DQp3aGVuIDcuMCB3YXMgcmVsZWFzZWQgKEknbSBzdXJlIHNvbWUgImhhY2tlckAiIGNhbg0KDQpj b3JyZWN0IHRoaXMgaW5mb3JtYXRpb24gaWYgSSdtIHdyb25nKS4NCg0KDQoNCkkgaG9wZSB0aGlz IGlzIGhlbHBmdWwgdG8geW91Lg0KDQoNCg0KS2V2aW4gS2luc2V5DQoNCg0KQmVzdCBSZWdhcmRz DQoNCllhbiwgWWVxaW5nDQoNCg== From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 12:41:52 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C8BA1065672 for ; Thu, 22 Oct 2009 12:41:52 +0000 (UTC) (envelope-from stas@deglitch.com) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 176C98FC12 for ; Thu, 22 Oct 2009 12:41:52 +0000 (UTC) Received: from stasss.yandex.ru (dhcp170-227-red.yandex.net [95.108.170.227]) by mx0.deglitch.com (Postfix) with ESMTPSA id 2198C8FC4F; Thu, 22 Oct 2009 16:41:50 +0400 (MSD) Date: Thu, 22 Oct 2009 16:41:44 +0400 From: Stanislav Sedov To: "Yan, Yeqing" Message-Id: <20091022164144.064b916b.stas@deglitch.com> In-Reply-To: <95608CFE3D0C064B8468DB61F8403BE04A0D4A1C5E@PDSMSX501.ccr.corp.intel.com> References: <95608CFE3D0C064B8468DB61F8403BE04A0D4A1C5E@PDSMSX501.ccr.corp.intel.com> Organization: Deglitch Networks X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Thu__22_Oct_2009_16_41_44_+0400_UCsdJ1VUlGggUdW6" Cc: "hackers@freebsd.org" Subject: Re: About FreeBSD syscall usage X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 12:41:52 -0000 --Signature=_Thu__22_Oct_2009_16_41_44_+0400_UCsdJ1VUlGggUdW6 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 22 Oct 2009 16:20:32 +0800 "Yan, Yeqing" mentioned: > kse_exit >=20 > kse_wakeup >=20 > kse_create >=20 > kse_thr_interrupt >=20 > kse_release >=20 > kse_switchin >=20 > I read $man kse, but I can not find any example about how to use it. I wr= ite some test codes to call these function but all these codes are failed. >=20 >=20 >=20 > mac_syscall >=20 > I read $man 3 mac, but I can not find the usage about mac_syscall functio= n. >=20 >=20 >=20 > thr_create >=20 > thr_suspend >=20 > thr_kill2 >=20 I fear there's no documentation on these syscalls exists. So for use infor= mation you'll have to refer to the actual source code of these syscalls/or and lib= c/libthr source code which makes uses of them. =20 >=20 > By the way, it is said =E2=80=9CI think that KSE was used in 5.x and 6.x = and then dropped in favor of a 1:1 threading model when 7.0 was released=E2= =80=9D >=20 > Does it mean the KSE syscall can be removed from FreeBSD 7.0? >=20 libkse (M:N threading) was default threading library on FreeBSD versions pr= ior to 7.0, and the default has changed to libthr (1:1 threading in FreeBSD 7). l= ibkse was completely removed in FreeBSD 8, but it is still functional on FreeBSD = 7.x. --=20 Stanislav Sedov ST4096-RIPE --Signature=_Thu__22_Oct_2009_16_41_44_+0400_UCsdJ1VUlGggUdW6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJK4FMNAAoJEKN82nOYvCd0Od4P/3Ka5/o3OF89/JIWKA/QmaYw aIYjLeFARk3zfbrC54ujArniQw4OmbU8peTEWCjZowL556ix03QCISUjBvgmOBln 7Sc2+w1tmwRgunW4RKa6b0qMfp2SMx2xR/YFqaJ7lahNonumZF4e4AtGsVnB9IWK QtwPITNvMAaa9JJiCbmjyT3NLJFvGm+Ewm6nSfo+5nSbU0Uw+PyueW5A2667pYAA 3ZeYCtAQksIfF0309qRbq5XsR+S2Ot4HmNBCgYdjUUWfV3XIgYfft5gh/NjRQecX taX8BTWgkAW+WDG9KfBRz4JMu9sh6f0tWaPXzRiV3WPni3UTEtdRnaZhzwLaHID/ gPQnSlxm86Ay3ZvRzX1cOJGtNHZKC2rFua0KP3fBYDG+cCPRr9XE/OiEWN4WT33F HbsUZvuy1gHAq5DAwVHmg+qP8MHsvtGwU3cHQ8ZtUaGBjBEVWepptLkSGl6XLcqr IYmZxyWS0QCOIGFQqHvT7rRfkXOE44S+A5kvJyscgU6QFD3+GhhQyYPLt/swgzTb KahwHyMOz9wvzPNAutXWT8QcRNSNbIgRZ66UcukQffulACbqlvv+08YYFVc2BmHJ xzX6PIYnUCmVVwPoWnM94Eo2BCumsl6ZcTZuRwvgPQf8vPuQUbUsZlAvVfFdlN0B raU/I5hXaCiVKY9q5NnH =vqQ4 -----END PGP SIGNATURE----- --Signature=_Thu__22_Oct_2009_16_41_44_+0400_UCsdJ1VUlGggUdW6-- From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 12:47:06 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56DDB106566B; Thu, 22 Oct 2009 12:47:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 295F28FC1C; Thu, 22 Oct 2009 12:47:06 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D49A046B52; Thu, 22 Oct 2009 08:47:05 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 1FE1E8A020; Thu, 22 Oct 2009 08:47:05 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 22 Oct 2009 08:34:31 -0400 User-Agent: KMail/1.9.7 References: <95608CFE3D0C064B8468DB61F8403BE04A0D4A1C5E@PDSMSX501.ccr.corp.intel.com> In-Reply-To: <95608CFE3D0C064B8468DB61F8403BE04A0D4A1C5E@PDSMSX501.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200910220834.32082.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 22 Oct 2009 08:47:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: "Yan, Yeqing" , "hackers@freebsd.org" Subject: Re: About FreeBSD syscall usage X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 12:47:06 -0000 On Thursday 22 October 2009 4:20:32 am Yan, Yeqing wrote: > Hi: >=20 > I=E2=80=99m from Intel China. Our project use FreeBSD 7.0. I have some qu= estion=20 about syscall usage but I think mail to the wrong address before. >=20 > Is there having any doc or example about how to use these syscall? >=20 >=20 >=20 > kse_exit >=20 > kse_wakeup >=20 > kse_create >=20 > kse_thr_interrupt >=20 > kse_release >=20 > kse_switchin These are used internally to implement pthreads when using KSE. Probably t= he=20 only useful documentation would be the source for libkse. > I read $man kse, but I can not find any example about how to use it. I wr= ite=20 some test codes to call these function but all these codes are failed. >=20 >=20 >=20 > mac_syscall >=20 > I read $man 3 mac, but I can not find the usage about mac_syscall functio= n. This one I am not sure of. > thr_create >=20 > thr_suspend >=20 > thr_kill2 These are used by libpthread to implement pthreads (libthr in < 7.x). The= =20 best documentation for these would be the source to libpthread as well. > By the way, it is said =E2=80=9CI think that KSE was used in 5.x and 6.x = and then=20 dropped in favor of a 1:1 threading model when 7.0 was released=E2=80=9D >=20 > Does it mean the KSE syscall can be removed from FreeBSD 7.0? It has been removed entirely from 8.0. It is still present in 7, but it is= =20 deprecated and not the default. =2D-=20 John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 12:47:06 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56DDB106566B; Thu, 22 Oct 2009 12:47:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 295F28FC1C; Thu, 22 Oct 2009 12:47:06 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D49A046B52; Thu, 22 Oct 2009 08:47:05 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 1FE1E8A020; Thu, 22 Oct 2009 08:47:05 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 22 Oct 2009 08:34:31 -0400 User-Agent: KMail/1.9.7 References: <95608CFE3D0C064B8468DB61F8403BE04A0D4A1C5E@PDSMSX501.ccr.corp.intel.com> In-Reply-To: <95608CFE3D0C064B8468DB61F8403BE04A0D4A1C5E@PDSMSX501.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200910220834.32082.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 22 Oct 2009 08:47:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: "Yan, Yeqing" , "hackers@freebsd.org" Subject: Re: About FreeBSD syscall usage X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 12:47:06 -0000 On Thursday 22 October 2009 4:20:32 am Yan, Yeqing wrote: > Hi: >=20 > I=E2=80=99m from Intel China. Our project use FreeBSD 7.0. I have some qu= estion=20 about syscall usage but I think mail to the wrong address before. >=20 > Is there having any doc or example about how to use these syscall? >=20 >=20 >=20 > kse_exit >=20 > kse_wakeup >=20 > kse_create >=20 > kse_thr_interrupt >=20 > kse_release >=20 > kse_switchin These are used internally to implement pthreads when using KSE. Probably t= he=20 only useful documentation would be the source for libkse. > I read $man kse, but I can not find any example about how to use it. I wr= ite=20 some test codes to call these function but all these codes are failed. >=20 >=20 >=20 > mac_syscall >=20 > I read $man 3 mac, but I can not find the usage about mac_syscall functio= n. This one I am not sure of. > thr_create >=20 > thr_suspend >=20 > thr_kill2 These are used by libpthread to implement pthreads (libthr in < 7.x). The= =20 best documentation for these would be the source to libpthread as well. > By the way, it is said =E2=80=9CI think that KSE was used in 5.x and 6.x = and then=20 dropped in favor of a 1:1 threading model when 7.0 was released=E2=80=9D >=20 > Does it mean the KSE syscall can be removed from FreeBSD 7.0? It has been removed entirely from 8.0. It is still present in 7, but it is= =20 deprecated and not the default. =2D-=20 John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 17:43:51 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD9D1065676 for ; Thu, 22 Oct 2009 17:43:51 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outX.internet-mail-service.net (rly7.mx.aerioconnect.net [216.240.35.231]) by mx1.freebsd.org (Postfix) with ESMTP id A4AE38FC08 for ; Thu, 22 Oct 2009 17:43:51 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id B8CFF2437; Thu, 22 Oct 2009 10:30:31 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 20B7F2D6015; Thu, 22 Oct 2009 10:30:31 -0700 (PDT) Message-ID: <4AE096B6.2080701@elischer.org> Date: Thu, 22 Oct 2009 10:30:30 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Stanislav Sedov References: <95608CFE3D0C064B8468DB61F8403BE04A0D4A1C5E@PDSMSX501.ccr.corp.intel.com> <20091022164144.064b916b.stas@deglitch.com> In-Reply-To: <20091022164144.064b916b.stas@deglitch.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: "Yan, Yeqing" , "hackers@freebsd.org" Subject: Re: About FreeBSD syscall usage X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 17:43:51 -0000 Stanislav Sedov wrote: > On Thu, 22 Oct 2009 16:20:32 +0800 > "Yan, Yeqing" mentioned: > >> kse_exit >> >> kse_wakeup >> >> kse_create >> >> kse_thr_interrupt >> >> kse_release >> >> kse_switchin >> >> I read $man kse, but I can not find any example about how to use it. I write some test codes to call these function but all these codes are failed. >> The kse man page documents the syscalls but they are intended to be used only by the libkse library. there was some early test code in /usr/src/tools/KSE but it probably doesn't eve n compile any more. >> >> >> mac_syscall >> >> I read $man 3 mac, but I can not find the usage about mac_syscall function. >> >> >> >> thr_create >> >> thr_suspend >> >> thr_kill2 Once again, these calls are meant to be only accessed from the threading library. (though man pages should be written) >> > > I fear there's no documentation on these syscalls exists. So for use information > you'll have to refer to the actual source code of these syscalls/or and libc/libthr > source code which makes uses of them. > >> By the way, it is said “I think that KSE was used in 5.x and 6.x and then dropped in favor of a 1:1 threading model when 7.0 was released” >> >> Does it mean the KSE syscall can be removed from FreeBSD 7.0? it will remain oin all 7.x kernels but is removed from 8.x >> > > libkse (M:N threading) was default threading library on FreeBSD versions prior to > 7.0, and the default has changed to libthr (1:1 threading in FreeBSD 7). libkse > was completely removed in FreeBSD 8, but it is still functional on FreeBSD 7.x. KSE based threading, while theoretically useful introduces a number of annoying complications to the kernel and was "holding up" other developement. Since Linux has gone with 1:1 threading, nearly all applications a re now written with 1:1 threading in mind so it made little sense to maintain all the extra complexity for no reason. > From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 19:08:16 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89C67106568D for ; Thu, 22 Oct 2009 19:08:16 +0000 (UTC) (envelope-from anti_spamsys@yahoo.com) Received: from web113208.mail.gq1.yahoo.com (web113208.mail.gq1.yahoo.com [98.136.164.161]) by mx1.freebsd.org (Postfix) with SMTP id 49F998FC13 for ; Thu, 22 Oct 2009 19:08:16 +0000 (UTC) Received: (qmail 71421 invoked by uid 60001); 22 Oct 2009 18:41:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1256236896; bh=z1iJwC9beAZs3SMFOLdibtMyMb5FtommPDLQbpgx6bY=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=gwfgnVJi/DQd/X2WQfxVWR+M5rw/Tq8narUIRYaavhey0687z7/TEC5Gu3c5oVKZ9v33we3hML94drh51HU0zZ0dTLpDOgXeFBkZpSdbNbxCsDfyj9oy6jRrOIxt+07Xlni6DZqj9knip+no7b1b7rKrHfQQwZNzFDxdD3uCSDs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=MEyDuVtIjfeBegu6+d65GUwxrJihMOthhi362YaTft9kimH0R5sl9CCvyQ4VZxHsds67uZaKs0/SnVLUDfG9dKflFyeDVsS6C2i3fvvJmGNaR2ZKfe27xisxDTS75/hXPamOpYcpNHCC+LBq2K1iTkf8m1HBX1iaMrMLnyik0oM=; Message-ID: <204698.71349.qm@web113208.mail.gq1.yahoo.com> X-YMail-OSG: H5L_0XEVM1m7tivk3CDteaW5ctJsbRUjACwXvTsXML9j4LYZ4ufmMASR_5LdjFZPNiiqk0g295563SIt99bsaduRbFYR0QSYwLAzL3PTkHhe0hAqNXkTKN5kqmuYx74aLsAuOy.KKFwNVB3fGW3sVJLYn9marAHpIVXiB0.FbK8I_7hnCHGZFoqbEx_Zbl4D22AMuwLlO7yWY6l0mARWg09wxQAOtQrqUD19AomsMRKSArU1PbJDpniOjNAva9NlAdjL2B0n0oCooT0001LEDRqkLc9Ds95V0sMUSA4KZxGmO7BU2Km7C2Givsysqck- Received: from [128.55.19.49] by web113208.mail.gq1.yahoo.com via HTTP; Thu, 22 Oct 2009 11:41:35 PDT X-Mailer: YahooMailClassic/8.0.7 YahooMailWebService/0.7.347.3 Date: Thu, 22 Oct 2009 11:41:35 -0700 (PDT) From: Trever To: freebsd-hackers@freebsd.org MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 22 Oct 2009 19:52:38 +0000 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: bug in pkg_add ? doesn't fetch dependencies from set path X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 19:08:16 -0000 Does anyone else have this problem? # env | grep PACKAGEPACKAGESITE=3Dftp://ftp.ourdomain.gov/FBSD/# pkg_add -r= subversion-1.6.5Fetching ftp://ftp.ourdomain.gov/FBSD/subversion-1.6.5.tbz= ... Done.Error: FTP Unable to get ftp://ftp.ourdomain.gov/All/pkg-config-0.= 23_1.tbz: File unavailable (e.g., file not found, no access)Error: FTP Unab= le to get ftp://ftp.ourdomain.gov/All/sqlite3-3.6.14.2.tbz: File unavailabl= e (e.g., file not found, no access)Error: FTP Unable to get ftp://ftp.ourdo= main.gov/All/gettext-0.17_1.tbz: File unavailable (e.g., file not found, no= access)Error: FTP Unable to get ftp://ftp.ourdomain.gov/All/neon28-0.28.4.= tbz: File unavailable (e.g., file not found, no access) In plain English:pkg_add -r goes to the correct domain and path (per enviro= nment variable I set) to fetch the package I want to install, but when it g= oes to get the dependencies for the package it just correctly fetched, it s= ubsequently fetches to the wrong path (goes to /All instead of /FBSD), thou= gh it does fetch to the correct domain. This is a pain because our ftp server has many uses, and having an "All" di= rectory in the root is ugliness (whether All is a link to FBSD or whatever,= I don't want "All", I just want "FBSD"). I have tried various combinations of setting both or one of PACKAGESITE and= /or PACKAGEROOT, just in case that would somehow help, but to no avail. =A0= Of course it would seem that PACKAGESITE alone is what I want (but that and= nothing else I have tried works). Thank you much. -T=0A=0A=0A From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 20:08:20 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D13891065670 for ; Thu, 22 Oct 2009 20:08:20 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 89B8B8FC2A for ; Thu, 22 Oct 2009 20:08:20 +0000 (UTC) Received: from [172.31.193.10] (cpe-069-134-110-200.nc.res.rr.com [69.134.110.200]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id n9MK8GAn021878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Oct 2009 16:08:17 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu n9MK8GAn021878 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1256242097; bh=q/u17qhFm1JqbTdrpC7exkccQiQcaIX53ImC+mPWaV0=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:Content-Type: Content-Transfer-Encoding; b=iNpBb8rYYuUAPJIn5ADyLeuomRhqeRAVPwkaOzaWvJfgKPBTV9j94qia+ENRsfBkt UhRPXe6TzEPFCPpDAuJXMK4gwqueuf248WsrJb0P+G+Ootq7ZYpCXeU1j4gzjZN7Kd TmDJDx5LFC/fwBHq2fGXdQObTOZciiyOlrts9duM= Message-ID: <4AE0BBAB.3040807@cs.duke.edu> Date: Thu, 22 Oct 2009 16:08:11 -0400 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Christian Bell Subject: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 20:08:20 -0000 Hi, We're designing some software which has to lock access to shared memory pages between several processes, and has to run on Linux, Solaris, and FreeBSD. We were planning to have the lock be a pthread_mutex_t residing in the shared memory page. This works well on Linux and Solaris, but FreeBSD (at least 7-stable) does not support PTHREAD_PROCESS_SHARED mutexes. We then moved on to posix semaphores. Using sem_wait/sem_post with the sem_t residing in a shared page seems to work on all 3 platforms. However, the FreeBSD (7-stable) man page for sem_init(3) has this scary text regarding the pshared value: The sem_init() function initializes the unnamed semaphore pointed to by sem to have the value value. A non-zero value for pshared specifies a shared semaphore that can be used by multiple processes, which this implementation is not capable of. Is this text obsolete? Or is my test just "getting lucky"? Is there recommended way to do this? Thanks, Drew From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 20:30:29 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76CDC1065670 for ; Thu, 22 Oct 2009 20:30:29 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 079788FC12 for ; Thu, 22 Oct 2009 20:30:28 +0000 (UTC) Received: by bwz5 with SMTP id 5so673216bwz.3 for ; Thu, 22 Oct 2009 13:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=QpVnAVEaG4ImqIFPeVUnzln9SF9RCxERhStgk+7KTq8=; b=JcL0G8mmTaePcKM56UDUB6XwazbAB7/HeqHNTWHwALgUr7gYLKHWdDqd9QzDHSCfJv 8nZvXTv+B3xMB9/T3SHeR20ylEnZOBGPtalcF14IkivNUfoQco0/v+55ZhMn1uHyS3X9 VWSqxriWhl29Hozt0YVA8CWb8S7Kquh4byw6w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=AqGeTRwJ5BfelOOrGly3gQ0HC8XL2bqVWrwxlqw4ycHMzEkzw8/B2tPxOEbPyYLIyl AxEYfDQNXPub3BGRnkXoRmeadXMf170V3OvTwXRtZ+DP+K8gFet51YGe7VWDX+RTVbyP clV/YX+1fD2TCkOr+g2Ipbu3glNKBiP2VIBbM= MIME-Version: 1.0 Received: by 10.223.2.196 with SMTP id 4mr1964237fak.3.1256241437886; Thu, 22 Oct 2009 12:57:17 -0700 (PDT) In-Reply-To: <204698.71349.qm@web113208.mail.gq1.yahoo.com> References: <204698.71349.qm@web113208.mail.gq1.yahoo.com> Date: Thu, 22 Oct 2009 15:57:17 -0400 Message-ID: <4ad871310910221257s5533da63l3ed062d9641b36@mail.gmail.com> From: Glen Barber To: Trever Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: bug in pkg_add ? doesn't fetch dependencies from set path X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 20:30:29 -0000 Hello, On Thu, Oct 22, 2009 at 2:41 PM, Trever wrote: > Does anyone else have this problem? > # env | grep PACKAGEPACKAGESITE=3Dftp://ftp.ourdomain.gov/FBSD/# pkg_add = -r subversion-1.6.5Fetching ftp://ftp.ourdomain.gov/FBSD/subversion-1.6.5.t= bz... Done.Error: FTP Unable to get ftp://ftp.ourdomain.gov/All/pkg-config-= 0.23_1.tbz: File unavailable (e.g., file not found, no access)Error: FTP Un= able to get ftp://ftp.ourdomain.gov/All/sqlite3-3.6.14.2.tbz: File unavaila= ble (e.g., file not found, no access)Error: FTP Unable to get ftp://ftp.our= domain.gov/All/gettext-0.17_1.tbz: File unavailable (e.g., file not found, = no access)Error: FTP Unable to get ftp://ftp.ourdomain.gov/All/neon28-0.28.= 4.tbz: File unavailable (e.g., file not found, no access) > > In plain English:pkg_add -r goes to the correct domain and path (per envi= ronment variable I set) to fetch the package I want to install, but when it= goes to get the dependencies for the package it just correctly fetched, it= subsequently fetches to the wrong path (goes to /All instead of /FBSD), th= ough it does fetch to the correct domain. > This is a pain because our ftp server has many uses, and having an "All" = directory in the root is ugliness (whether All is a link to FBSD or whateve= r, I don't want "All", I just want "FBSD"). > I have tried various combinations of setting both or one of PACKAGESITE a= nd/or PACKAGEROOT, just in case that would somehow help, but to no avail. = =A0Of course it would seem that PACKAGESITE alone is what I want (but that = and nothing else I have tried works). > Thank you much. > -T > pkg_add(1) expects the PACKAGESITE to follow the same hierarchy as a tinderbox. Without a tinderbox, you can 'mkdir /usr/ports/packages' on your local build server. When you 'make package' (or your preferred choice) the packages will be put in /usr/ports/packages with the correct hierarchy, symlinks to PACKAGESITE/All/ etc. HTH. --=20 Glen Barber From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 21:07:39 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9681106577A; Thu, 22 Oct 2009 21:07:39 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 7DDB18FC12; Thu, 22 Oct 2009 21:07:39 +0000 (UTC) Received: from [172.31.193.10] (cpe-069-134-110-200.nc.res.rr.com [69.134.110.200]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id n9ML7caM025863 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Oct 2009 17:07:38 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu n9ML7caM025863 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1256245658; bh=2aljZk2+CwgjOlvIPk4pyPGwNkoQqV3dy7oT3IyjTIo=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=M8Ebvrl7aDvBBmiuJmwbVaqi1hXVH+X0jGo21CjUExQEiSMf9+VtcRv9p3EgiNtHY MuO/pfc1a2DB63k2aKIY97CWGk1qBX3+ld17S0fGcBy7bHKQtR6pp9AoIXE7TCJ53Z fRraEgqHsDnrnG9qkWV1eVmwspWLqqlknxKrHtB0= Message-ID: <4AE0C995.5060303@cs.duke.edu> Date: Thu, 22 Oct 2009 17:07:33 -0400 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Daniel Eischen References: <4AE0BBAB.3040807@cs.duke.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 21:07:39 -0000 Daniel Eischen wrote: > On Thu, 22 Oct 2009, Andrew Gallatin wrote: > >> Hi, >> >> We're designing some software which has to lock access to >> shared memory pages between several processes, and has to >> run on Linux, Solaris, and FreeBSD. We were planning to >> have the lock be a pthread_mutex_t residing in the >> shared memory page. This works well on Linux and Solaris, >> but FreeBSD (at least 7-stable) does not support >> PTHREAD_PROCESS_SHARED mutexes. >> >> We then moved on to posix semaphores. Using sem_wait/sem_post >> with the sem_t residing in a shared page seems to work on >> all 3 platforms. However, the FreeBSD (7-stable) man page >> for sem_init(3) has this scary text regarding the pshared >> value: >> >> The sem_init() function initializes the unnamed semaphore pointed >> to by >> sem to have the value value. A non-zero value for pshared >> specifies a >> shared semaphore that can be used by multiple processes, which this >> implementation is not capable of. >> >> Is this text obsolete? Or is my test just "getting lucky"? > > I think you're getting lucky. Yes, after playing with the code some, I now see that. :( >> Is there recommended way to do this? > > I believe the only way to do this is with SYSV semaphores > (semop, semget, semctl). Unfortunately, these are not as > easy to use, IMHO. Yes, they are pretty ugly, and we were hoping to avoid them. Are there any plans to support either PTHREAD_PROCESS_SHARED mutexes, or pshared posix semaphores in FreeBSD? Thanks, Drew From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 21:10:51 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CA77106568B for ; Thu, 22 Oct 2009 21:10:51 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id E0F728FC16 for ; Thu, 22 Oct 2009 21:10:50 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id n9MKoWPG023557; Thu, 22 Oct 2009 16:50:32 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Thu, 22 Oct 2009 16:50:33 -0400 (EDT) Date: Thu, 22 Oct 2009 16:50:32 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Andrew Gallatin In-Reply-To: <4AE0BBAB.3040807@cs.duke.edu> Message-ID: References: <4AE0BBAB.3040807@cs.duke.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 21:10:51 -0000 On Thu, 22 Oct 2009, Andrew Gallatin wrote: > Hi, > > We're designing some software which has to lock access to > shared memory pages between several processes, and has to > run on Linux, Solaris, and FreeBSD. We were planning to > have the lock be a pthread_mutex_t residing in the > shared memory page. This works well on Linux and Solaris, > but FreeBSD (at least 7-stable) does not support > PTHREAD_PROCESS_SHARED mutexes. > > We then moved on to posix semaphores. Using sem_wait/sem_post > with the sem_t residing in a shared page seems to work on > all 3 platforms. However, the FreeBSD (7-stable) man page > for sem_init(3) has this scary text regarding the pshared > value: > > The sem_init() function initializes the unnamed semaphore pointed to by > sem to have the value value. A non-zero value for pshared specifies a > shared semaphore that can be used by multiple processes, which this > implementation is not capable of. > > Is this text obsolete? Or is my test just "getting lucky"? I think you're getting lucky. > Is there recommended way to do this? I believe the only way to do this is with SYSV semaphores (semop, semget, semctl). Unfortunately, these are not as easy to use, IMHO. -- DE From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 21:17:19 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F02F7106566C for ; Thu, 22 Oct 2009 21:17:19 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id AE56F8FC0C for ; Thu, 22 Oct 2009 21:17:19 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id n9MLH7X5006969; Thu, 22 Oct 2009 17:17:07 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Thu, 22 Oct 2009 17:17:07 -0400 (EDT) Date: Thu, 22 Oct 2009 17:17:07 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Andrew Gallatin In-Reply-To: <4AE0C995.5060303@cs.duke.edu> Message-ID: References: <4AE0BBAB.3040807@cs.duke.edu> <4AE0C995.5060303@cs.duke.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 21:17:20 -0000 On Thu, 22 Oct 2009, Andrew Gallatin wrote: > Daniel Eischen wrote: >> On Thu, 22 Oct 2009, Andrew Gallatin wrote: >> >>> Hi, >>> >>> We're designing some software which has to lock access to >>> shared memory pages between several processes, and has to >>> run on Linux, Solaris, and FreeBSD. We were planning to >>> have the lock be a pthread_mutex_t residing in the >>> shared memory page. This works well on Linux and Solaris, >>> but FreeBSD (at least 7-stable) does not support >>> PTHREAD_PROCESS_SHARED mutexes. >>> >>> We then moved on to posix semaphores. Using sem_wait/sem_post >>> with the sem_t residing in a shared page seems to work on >>> all 3 platforms. However, the FreeBSD (7-stable) man page >>> for sem_init(3) has this scary text regarding the pshared >>> value: >>> >>> The sem_init() function initializes the unnamed semaphore pointed to >>> by >>> sem to have the value value. A non-zero value for pshared specifies a >>> shared semaphore that can be used by multiple processes, which this >>> implementation is not capable of. >>> >>> Is this text obsolete? Or is my test just "getting lucky"? >> >> I think you're getting lucky. > > Yes, after playing with the code some, I now see that. :( > >>> Is there recommended way to do this? >> >> I believe the only way to do this is with SYSV semaphores >> (semop, semget, semctl). Unfortunately, these are not as >> easy to use, IMHO. > > Yes, they are pretty ugly, and we were hoping to avoid them. > Are there any plans to support either PTHREAD_PROCESS_SHARED > mutexes, or pshared posix semaphores in FreeBSD? It's planned, just not (yet) being actively worked on. It's a API change mostly, and then adding in all the compat hooks so we don't break ABI. -- DE From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 21:32:36 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83F8D106568F for ; Thu, 22 Oct 2009 21:32:36 +0000 (UTC) (envelope-from dudu@dudu.ro) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id 284778FC17 for ; Thu, 22 Oct 2009 21:32:35 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id d23so3280439fga.13 for ; Thu, 22 Oct 2009 14:32:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.5.87 with SMTP id 23mr1957049fau.87.1256245221960; Thu, 22 Oct 2009 14:00:21 -0700 (PDT) In-Reply-To: <4AE0BBAB.3040807@cs.duke.edu> References: <4AE0BBAB.3040807@cs.duke.edu> From: Vlad Galu Date: Fri, 23 Oct 2009 00:00:01 +0300 Message-ID: To: Andrew Gallatin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 21:32:36 -0000 On Thu, Oct 22, 2009 at 11:08 PM, Andrew Gallatin wr= ote: > Hi, > > We're designing some software which has to lock access to > shared memory pages between several processes, and has to > run on Linux, Solaris, and FreeBSD. =A0We were planning to > have the lock be a pthread_mutex_t residing in the > shared memory page. =A0This works well on Linux and Solaris, > but FreeBSD (at least 7-stable) does not support > PTHREAD_PROCESS_SHARED mutexes. > > We then moved on to posix semaphores. =A0Using sem_wait/sem_post > with the sem_t residing in a shared page seems to work on > all 3 platforms. =A0However, the FreeBSD (7-stable) man page > for sem_init(3) has this scary text regarding the pshared > value: > > =A0 =A0 The sem_init() function initializes the unnamed semaphore pointed= to by > =A0 =A0 sem to have the value value. =A0A non-zero value for pshared spec= ifies a > =A0 =A0 shared semaphore that can be used by multiple processes, which th= is > =A0 =A0 implementation is not capable of. > > Is this text obsolete? =A0Or is my test just "getting lucky"? > > Is there recommended way to do this? > > Thanks, > > Drew Hi Andrew, This works in Linux is because Linux defines sem_t as a struct type(or union, IIRC), while our sem_t is a pointer type (with more state kept in the pointed struct). SYSV semaphores seems the way to go... From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 21:37:09 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3704106566B for ; Thu, 22 Oct 2009 21:37:09 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell.rawbw.com (shell.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id B34298FC08 for ; Thu, 22 Oct 2009 21:37:09 +0000 (UTC) Received: from eagle.syrec.org (c-24-6-221-126.hsd1.ca.comcast.net [24.6.221.126]) (authenticated bits=0) by shell.rawbw.com (8.13.6/8.13.6) with ESMTP id n9MLb9gr038332 for ; Thu, 22 Oct 2009 14:37:09 -0700 (PDT) Message-ID: <4AE0D084.7070108@rawbw.com> Date: Thu, 22 Oct 2009 14:37:08 -0700 From: Yuri User-Agent: Thunderbird 2.0.0.23 (X11/20090824) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Failure to boot from HD formatted not by FreBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: yuri@rawbw.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 21:37:09 -0000 I wonder what are the limitations of MBR (/boot/boot0)? I have the OEM-formatted harddrive (160MB), on which I want to add FreeBSD into the free space. I created the FreeBSD partition, set MBR (in 8.0-RC2), but when it displays the boot prompt and I hit some key I only see '#' character printed and nothing happens. When I took MBR from my older FreeBSD HD and placed it on that one, it doesn't print '#' characters but also doesn't boot. When I boot into the healthy system with this new OEM HD attached I also see dmesg messages like this: GEOM: ad4: partition 2 does not start on a track boundary. What could be wrong, why it doesn't boot? Yuri --- partitions in MBR --- Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 7 (0x07),(NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX) start 2079, size 44039457 (21503 Meg), flag 80 (active) beg: cyl 0/ head 33/ sector 1; end: cyl 1023/ head 116/ sector 63 The data for partition 2 is: sysid 15 (0x0f),(Extended DOS (LBA)) start 220416000, size 61222912 (29894 Meg), flag 0 beg: cyl 1023/ head 255/ sector 63; end: cyl 1023/ head 53/ sector 58 The data for partition 3 is: sysid 18 (0x12),(Compaq diagnostics) start 281638912, size 30942896 (15108 Meg), flag 0 beg: cyl 1023/ head 255/ sector 63; end: cyl 1023/ head 80/ sector 63 The data for partition 4 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 44041536, size 176373792 (86120 Meg), flag 0 beg: cyl 1023/ head 255/ sector 63; end: cyl 1023/ head 55/ sector 63 From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 21:47:35 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4CF7106566C for ; Thu, 22 Oct 2009 21:47:35 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5DD8FC0C for ; Thu, 22 Oct 2009 21:47:35 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id E72AE1DD645; Thu, 22 Oct 2009 23:47:33 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id D2E84228BE; Thu, 22 Oct 2009 23:47:33 +0200 (CEST) Date: Thu, 22 Oct 2009 23:47:33 +0200 From: Jilles Tjoelker To: Andrew Gallatin Message-ID: <20091022214733.GA32745@stack.nl> References: <4AE0BBAB.3040807@cs.duke.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AE0BBAB.3040807@cs.duke.edu> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 21:47:35 -0000 On Thu, Oct 22, 2009 at 04:08:11PM -0400, Andrew Gallatin wrote: > We then moved on to posix semaphores. Using sem_wait/sem_post > with the sem_t residing in a shared page seems to work on > all 3 platforms. However, the FreeBSD (7-stable) man page > for sem_init(3) has this scary text regarding the pshared > value: > The sem_init() function initializes the unnamed semaphore pointed > to by > sem to have the value value. A non-zero value for pshared specifies a > shared semaphore that can be used by multiple processes, which this > implementation is not capable of. > Is this text obsolete? Or is my test just "getting lucky"? They work, but only if the processes are related and do not exec and the parent process initializes the semaphores before forking. This is because sem_t is a pointer to a malloc'ed structure. For process-shared semaphores this really only contains an identifier of the kernel semaphore. This also means process-shared semaphores are slower than in-process semaphores (libthr implements those using atomics and umtx so that system calls are only needed if a thread needs to sleep or be awakened). This is documented in comments in the source code, but not in man pages or other documentation. > Is there recommended way to do this? Apart from sysv semaphores, perhaps posix named semaphores (sem_open() etc). These require a 'kldload sem' on older versions though. -- Jilles Tjoelker From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 22 20:41:01 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42DE5106566C for ; Thu, 22 Oct 2009 20:41:01 +0000 (UTC) (envelope-from anti_spamsys@yahoo.com) Received: from web113202.mail.gq1.yahoo.com (web113202.mail.gq1.yahoo.com [98.136.165.123]) by mx1.freebsd.org (Postfix) with SMTP id 16A998FC14 for ; Thu, 22 Oct 2009 20:41:01 +0000 (UTC) Received: (qmail 98805 invoked by uid 60001); 22 Oct 2009 20:41:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1256244060; bh=zVmFh46B+/wDVRbTGyoN0FMKmc9QpEiXhFulOHn/MFI=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=xf/VEPMC30a7ru0wn2T0qXf3Ntung6oE8HwrcziDwR27Qmiq1zYkHWaopM0DyUFThp1iZ6EYMbWeRdwzPSqBhXAdDONdvLJ528GDa7+iC73350z8OQlsSFNdoAiYuPe76/aBkhV0y1kmvrNDEgcHCjxhLKxc6Kjx0pQldv21xYA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=Y/sJ5MGHrvQGQXbONmlt4JIj3pIs60Da5MbiLpJuRPX+ps7VexpvwNCH0WJgwmqlAt1V+faswipkJ1N2N/GAoZz0hW4b/wTVskeaegUXS6XdSOoQByIJc8FZjRrVhw91ILz3+UGq4c9beo+uzxjP0QsXdSigFgIhMo/NMeRq4qo=; Message-ID: <821063.97828.qm@web113202.mail.gq1.yahoo.com> X-YMail-OSG: QAFJwA8VM1nSsjdNehsEaEupxF_5WI6TNFW3VG5_udWI1inxvNgV_SpUOk0RxV7g5EHWmQfscVNRQIWjzPTNVm8sotNs9Mto0Rav__lTOFTZLuDSUghDAWYSLXCFfX4RILjE30XwJvMXNvoLc9s13KEfL6bJan4jqTu6LVHoyrYO8zCiC8.Q7lR8JBEN68GKCLoAJwforiT5yF0SvqzmY2adyhdDDydIYBSMWF2y5onMop.QYtceL5Pi7Du9UsLlc_sK8BiQLB6ow2muJDzEWaVWpjENIe9d3mLB Received: from [128.55.19.49] by web113202.mail.gq1.yahoo.com via HTTP; Thu, 22 Oct 2009 13:41:00 PDT X-Mailer: YahooMailClassic/8.0.7 YahooMailWebService/0.7.347.3 Date: Thu, 22 Oct 2009 13:41:00 -0700 (PDT) From: Trever To: Glen Barber In-Reply-To: <4ad871310910221257s5533da63l3ed062d9641b36@mail.gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 22 Oct 2009 22:57:16 +0000 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: bug in pkg_add ? doesn't fetch dependencies from set path X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 20:41:01 -0000 I realized that this was probably the case only after I sent the email, but= this keeps me from having to test so thanks. I do think the documentation leads one to think differently about what PACK= AGESITE does; perhaps I'll try to submit a clarification. =A0As I read it, = it talks about "subverting the logic" of the fetches, which led me to think= the expected hierarchy would be subverted- something like that. =A0 -T --- On Thu, 10/22/09, Glen Barber wrote: From: Glen Barber Subject: Re: bug in pkg_add ? doesn't fetch dependencies from set path To: "Trever" Cc: freebsd-hackers@freebsd.org Date: Thursday, October 22, 2009, 12:57 PM Hello, On Thu, Oct 22, 2009 at 2:41 PM, Trever wrote: > Does anyone else have this problem? > # env | grep PACKAGEPACKAGESITE=3Dftp://ftp.ourdomain.gov/FBSD/# pkg_add = -r subversion-1.6.5Fetching ftp://ftp.ourdomain.gov/FBSD/subversion-1.6.5.t= bz... Done.Error: FTP Unable to get ftp://ftp.ourdomain.gov/All/pkg-config-= 0.23_1.tbz: File unavailable (e.g., file not found, no access)Error: FTP Un= able to get ftp://ftp.ourdomain.gov/All/sqlite3-3.6.14.2.tbz: File unavaila= ble (e.g., file not found, no access)Error: FTP Unable to get ftp://ftp.our= domain.gov/All/gettext-0.17_1.tbz: File unavailable (e.g., file not found, = no access)Error: FTP Unable to get ftp://ftp.ourdomain.gov/All/neon28-0.28.= 4.tbz: File unavailable (e.g., file not found, no access) > > In plain English:pkg_add -r goes to the correct domain and path (per envi= ronment variable I set) to fetch the package I want to install, but when it= goes to get the dependencies for the package it just correctly fetched, it= subsequently fetches to the wrong path (goes to /All instead of /FBSD), th= ough it does fetch to the correct domain. > This is a pain because our ftp server has many uses, and having an "All" = directory in the root is ugliness (whether All is a link to FBSD or whateve= r, I don't want "All", I just want "FBSD"). > I have tried various combinations of setting both or one of PACKAGESITE a= nd/or PACKAGEROOT, just in case that would somehow help, but to no avail. = =A0Of course it would seem that PACKAGESITE alone is what I want (but that = and nothing else I have tried works). > Thank you much. > -T > pkg_add(1) expects the PACKAGESITE to follow the same hierarchy as a tinderbox.=A0 Without a tinderbox, you can 'mkdir /usr/ports/packages' on your local build server.=A0 When you 'make package' (or your preferred choice) the packages will be put in /usr/ports/packages with the correct hierarchy, symlinks to PACKAGESITE/All/ etc. HTH. --=20 Glen Barber =0A=0A=0A From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 01:12:30 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D41771065676 for ; Fri, 23 Oct 2009 01:12:30 +0000 (UTC) (envelope-from lankfordandrew@charter.net) Received: from que21.charter.net (que21.charter.net [209.225.8.22]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE768FC1F for ; Fri, 23 Oct 2009 01:12:30 +0000 (UTC) Received: from imp09 ([10.20.200.9]) by mta31.charter.net (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20091023005404.QEZA25738.mta31.charter.net@imp09>; Thu, 22 Oct 2009 20:54:04 -0400 Received: from [192.168.1.100] ([75.138.208.143]) by imp09 with smtp.charter.net id w0tz1c00736AQff050u3Ba; Thu, 22 Oct 2009 20:54:04 -0400 X-Authority-Analysis: v=1.0 c=1 a=TytK2yoJ9wAA:10 a=rEuvY6gjfpq8zqJuDyoA:9 a=mGSAOlNnt6h176sweoEA:7 a=fL7aw7L9Kec54QNcrnKNJ1hUMAcA:4 Message-ID: <4AE0FEA5.9070004@charter.net> Date: Thu, 22 Oct 2009 20:53:57 -0400 From: Andrew Lankford User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Yuri , freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 23 Oct 2009 02:10:38 +0000 Cc: Subject: Failure to boot from HD formatted not by FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 01:12:30 -0000 Looks to me like you're trying to get your computer to dual-boot Vista and FreeBSD 8.0, something I finally succeeded in doing. If by "MBR" you mean the first-stage boot program (512 bytes), I couldn't get that to work, nor could I use the standard boot0 menu from FreeBSD. I'm using the windows boot program instead. I think what I did was copy "/boot/boot1" from my root partition to my NTFS partition and then added an option to the Windows boot menu to boot with it. I get the GEOM "track boundary" complaint when I boot up as well. The FBSD 8.0 kernel has a new option 'GEOM_PART_MBR" on by default. Vista insisted on partitioning my drive, so if the new partition handler doesn't like it, it can lump it. In order to get the 8.0 kernel to recognise your old partitions, you need the "GEOM_MBR" option activated. That means you need to load "geom_mbr.ko" into memory before you load and boot from the 8.0 kernel. If you're booting from a FreeBSD 8.0 CD directly into sysinstall, you can escape to a shell and kldload geom_mbr.ko, but you have to then restart sysinstall without rebooting the computer in order for your hard disk partitions to show up. The only reliable way I could find to restart systinstall without rebooting was by pressing the power button. Wierd, eh? I added "option GEOM_MBR" back into my kernel, recompiled, fiddled with my network settings, and now everything seems to work alright. Anyway, all this procedure should be 75% correct since I've managed to successfully upgrade to 8.0 from 7-stable this way. For all I know, I might end up with a corrupted partition six months from now. Either that or Marcel Moolenar will get angry at me. Regards, Andrew Lankford From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 02:35:09 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D90D4106566B for ; Fri, 23 Oct 2009 02:35:09 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay2.uni-muenster.de (ZIVM-EXRELAY2.UNI-MUENSTER.DE [128.176.192.15]) by mx1.freebsd.org (Postfix) with ESMTP id 6E2DE8FC1A for ; Fri, 23 Oct 2009 02:35:09 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,609,1249250400"; d="scan'208";a="226994900" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 23 Oct 2009 04:35:07 +0200 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id AEA991B0766; Fri, 23 Oct 2009 04:35:07 +0200 (CEST) Date: Fri, 23 Oct 2009 04:35:07 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 02:35:10 -0000 hi everyone, together with hugh mahon (the author of ee) i've been trying to fix a nasty bug in ee. for some reason ee exits (not crashes) and leaves the console corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should exit all running ee instances). unfortunately we were unable to find the problem. it seems to be related to ncurses. running the ee linux binary under freebsd causes no problem with SIGWINCH at all. since the linux binary doesn't need to be linked against ncurses (linux has termio.h/sgtty.h) we assume the problem is related to ncurses. right at the beginning of the ee code all signals get set to SIG_IGN: for (counter = 1; counter <= 32; counter++) signal(counter, SIG_IGN); so actually SIGWINCH shouldn't cause any problems since it gets discarded. looking through the src i'm quite sure that SIGWINCH stays set to SIG_IGN the whole time. yet running ee with truss shows this result when doing `grep WINCH`: sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) sigaction(SIGWINCH,{ SIG_IGN SA_RESTART ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0) sigaction(SIGWINCH,0x0,{ SIG_IGN SA_RESTART ss_t }) = 0 (0x0) sigaction(SIGWINCH,{ 0x280bc130 0x0 ss_t },0x0) = 0 (0x0) sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) so SIGWINCH doesn't stay set to SIG_IGN the whole time. it seems the problem is being caused by some ncurses function which gets called in contrib/ee/ee.c. contrib/ee/new_curse* aren't used since ee relies in freebsd's local ncurse implementation. it would be really great if this nasty bug could be fixed. you'll find a problem report here: http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/136223 please don't hesitate to ask for more details. cheers. alex From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 04:02:51 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE33106566B for ; Fri, 23 Oct 2009 04:02:51 +0000 (UTC) (envelope-from lists@mawer.org) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id E22518FC16 for ; Fri, 23 Oct 2009 04:02:50 +0000 (UTC) Received: by pzk15 with SMTP id 15so5324060pzk.3 for ; Thu, 22 Oct 2009 21:02:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.161.3 with SMTP id j3mr1784643rve.27.1256270570433; Thu, 22 Oct 2009 21:02:50 -0700 (PDT) In-Reply-To: References: Date: Fri, 23 Oct 2009 15:02:50 +1100 Message-ID: From: Antony Mawer To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 04:02:51 -0000 On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best wrote: > hi everyone, > > together with hugh mahon (the author of ee) i've been trying to fix a nasty > bug in ee. for some reason ee exits (not crashes) and leaves the console > corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should exit all > running ee instances). I noticed this the other day when working on a new 8.0-RC1 system... in my case I was using putty (Windows ssh client) to access the system and maximised the window I had ee running in, and noticed ee just dumped me straight to the prompt. I am wondering if this has anything to do with the new tty subsystem in 8.0, as this wasn't a problem I've experienced before under 7.x... Maybe worth cc'ing ed@ to see if he has any thoughts? --Antony From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 04:10:05 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1030106566B for ; Fri, 23 Oct 2009 04:10:05 +0000 (UTC) (envelope-from nate@thatsmathematics.com) Received: from euclid.ucsd.edu (euclid.ucsd.edu [132.239.145.52]) by mx1.freebsd.org (Postfix) with ESMTP id A16CF8FC1A for ; Fri, 23 Oct 2009 04:10:05 +0000 (UTC) Received: from zeno.ucsd.edu (zeno.ucsd.edu [132.239.145.22]) by euclid.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id n9N4A5o10666; Thu, 22 Oct 2009 21:10:05 -0700 (PDT) Received: from localhost (neldredg@localhost) by zeno.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id n9N4A4n23985; Thu, 22 Oct 2009 21:10:05 -0700 (PDT) X-Authentication-Warning: zeno.ucsd.edu: neldredg owned process doing -bs Date: Thu, 22 Oct 2009 21:10:04 -0700 (PDT) From: Nate Eldredge X-X-Sender: neldredg@zeno.ucsd.edu To: Antony Mawer In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Alexander Best Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 04:10:05 -0000 On Fri, 23 Oct 2009, Antony Mawer wrote: > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best > wrote: >> hi everyone, >> >> together with hugh mahon (the author of ee) i've been trying to fix a nasty >> bug in ee. for some reason ee exits (not crashes) and leaves the console >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should exit all >> running ee instances). > > I noticed this the other day when working on a new 8.0-RC1 system... > in my case I was using putty (Windows ssh client) to access the system > and maximised the window I had ee running in, and noticed ee just > dumped me straight to the prompt. Seems a good start might be to compile ncurses with -g, link ee against it, put a breakpoint on the SIGWINCH handler, and start single stepping... -- Nate Eldredge nate@thatsmathematics.com From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 05:39:28 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20CA5106566B for ; Fri, 23 Oct 2009 05:39:28 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id 84FED8FC08 for ; Fri, 23 Oct 2009 05:39:27 +0000 (UTC) Received: from iMac.local (pgw.vnode.se [77.110.37.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id D59EAE3F078; Fri, 23 Oct 2009 07:21:31 +0200 (CEST) Message-ID: <4AE13D5A.6040608@FreeBSD.org> Date: Fri, 23 Oct 2009 07:21:30 +0200 From: Joel Dahl User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Antony Mawer References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Alexander Best Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 05:39:28 -0000 Antony Mawer skrev: > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best > wrote: >> hi everyone, >> >> together with hugh mahon (the author of ee) i've been trying to fix a nasty >> bug in ee. for some reason ee exits (not crashes) and leaves the console >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should exit all >> running ee instances). > > I noticed this the other day when working on a new 8.0-RC1 system... > in my case I was using putty (Windows ssh client) to access the system > and maximised the window I had ee running in, and noticed ee just > dumped me straight to the prompt. > > I am wondering if this has anything to do with the new tty subsystem > in 8.0, as this wasn't a problem I've experienced before under 7.x... I've been using ee in Mac OSX for a while and I see the exact same behaviour, ee exits when I resize the terminal window. I haven't seen it in FreeBSD yet, but that is probably because I don't use Xorg on any of my FreeBSD systems... -- Joel From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 09:22:08 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D88A106568D for ; Fri, 23 Oct 2009 09:22:08 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-fx0-f210.google.com (mail-fx0-f210.google.com [209.85.220.210]) by mx1.freebsd.org (Postfix) with ESMTP id 127E78FC19 for ; Fri, 23 Oct 2009 09:22:07 +0000 (UTC) Received: by fxm6 with SMTP id 6so9570639fxm.43 for ; Fri, 23 Oct 2009 02:22:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=TnXNh/9xaXczdXMFuQq7uCtLmPhL3ZYLpr+0emaHBRo=; b=Q8qIdyWILdj2BvdEE4KiCAK8Q/6ms6OBjirVRCxba9M/Sr1xGSQ4K0xIylfwuaJg3v zpiDZ1AscEzgnYa9QePMNhSsXuLpuwgtQ5VaLY7I3gZjw55i56u4Rae+bPbnrEd0ZGF+ a7qMvTPSoM0xjuZN4rLCzNjv0GTq6iL2eO7KE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=h/HQXYCdoWPQdBv/ngIj77gpfHGcdVZUmw9D8iKY/nIZgLKtr47srTw0a0xVZsY+7l HgYiyWxAeSdZBmDXSkOJDrNIo5BtTKIv0dCyocUkbhRVQYYm7+vchkSckQTGrosS7GwP sZu9RljL0LGXuvQaXkekovW1z8bqxqQvJQ3GI= MIME-Version: 1.0 Received: by 10.204.34.205 with SMTP id m13mr10692977bkd.80.1256288323483; Fri, 23 Oct 2009 01:58:43 -0700 (PDT) In-Reply-To: References: Date: Fri, 23 Oct 2009 12:58:43 +0400 Message-ID: From: pluknet To: Antony Mawer Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, Alexander Best Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 09:22:08 -0000 2009/10/23 Antony Mawer : > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best > wrote: >> hi everyone, >> >> together with hugh mahon (the author of ee) i've been trying to fix a nasty >> bug in ee. for some reason ee exits (not crashes) and leaves the console >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should exit all >> running ee instances). > > I noticed this the other day when working on a new 8.0-RC1 system... > in my case I was using putty (Windows ssh client) to access the system > and maximised the window I had ee running in, and noticed ee just > dumped me straight to the prompt. > > I am wondering if this has anything to do with the new tty subsystem > in 8.0, as this wasn't a problem I've experienced before under 7.x... > No, that's a regression appeared in (FreeBSD'ish? version of) ee 1.5.0. -- wbr, pluknet From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 10:36:38 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 248B2106566B for ; Fri, 23 Oct 2009 10:36:38 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay2.uni-muenster.de (ZIVM-EXRELAY2.UNI-MUENSTER.DE [128.176.192.15]) by mx1.freebsd.org (Postfix) with ESMTP id AAFED8FC12 for ; Fri, 23 Oct 2009 10:36:37 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,611,1249250400"; d="scan'208";a="227023245" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 23 Oct 2009 12:36:35 +0200 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id C4CA51B0766; Fri, 23 Oct 2009 12:36:35 +0200 (CEST) Date: Fri, 23 Oct 2009 12:36:35 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Nate Eldredge , Antony Mawer Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 10:36:38 -0000 Nate Eldredge schrieb am 2009-10-23: > On Fri, 23 Oct 2009, Antony Mawer wrote: > >On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best > > wrote: > >>hi everyone, > >>together with hugh mahon (the author of ee) i've been trying to > >>fix a nasty > >>bug in ee. for some reason ee exits (not crashes) and leaves the > >>console > >>corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should > >>exit all > >>running ee instances). > >I noticed this the other day when working on a new 8.0-RC1 system... > >in my case I was using putty (Windows ssh client) to access the > >system > >and maximised the window I had ee running in, and noticed ee just > >dumped me straight to the prompt. > Seems a good start might be to compile ncurses with -g, link ee > against it, put a breakpoint on the SIGWINCH handler, and start > single stepping... > -- > Nate Eldredge > nate@thatsmathematics.com it seems ncurses registers a standard libc function with SIGWINCH. i started gdb, loaded ee and did "handle SIGWINCH stop" when i do "run" and issue a SIGWINCH to ee this is the output: Program received signal SIGWINCH, Window size changed. 0x281a4063 in read () from /lib/libc.so.7 (gdb) nexti 0x281a4048 in write () from /lib/libc.so.7 (gdb) nexti 0x281a4049 in write () from /lib/libc.so.7 (gdb) nexti 0x281a404e in write () from /lib/libc.so.7 (gdb) nexti 0x281a404f in write () from /lib/libc.so.7 (gdb) nexti 0x281a4055 in write () from /lib/libc.so.7 (gdb) nexti Program exited normally. so i guess ee calls some ncurses function right at the beginning. that ncurses function registers a new function to be called upon SIGWINCH (maybe exit(3)). cheers. alex From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 10:42:29 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 644FB1065679 for ; Fri, 23 Oct 2009 10:42:29 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay2.uni-muenster.de (ZIVM-EXRELAY2.UNI-MUENSTER.DE [128.176.192.15]) by mx1.freebsd.org (Postfix) with ESMTP id EB38D8FC16 for ; Fri, 23 Oct 2009 10:42:28 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,611,1249250400"; d="scan'208";a="227023899" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 23 Oct 2009 12:42:27 +0200 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id DAF921B0767; Fri, 23 Oct 2009 12:42:27 +0200 (CEST) Date: Fri, 23 Oct 2009 12:42:27 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: pluknet , Antony Mawer Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 10:42:29 -0000 pluknet schrieb am 2009-10-23: > 2009/10/23 Antony Mawer : > > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best > > wrote: > >> hi everyone, > >> together with hugh mahon (the author of ee) i've been trying to > >> fix a nasty > >> bug in ee. for some reason ee exits (not crashes) and leaves the > >> console > >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should > >> exit all > >> running ee instances). > > I noticed this the other day when working on a new 8.0-RC1 > > system... > > in my case I was using putty (Windows ssh client) to access the > > system > > and maximised the window I had ee running in, and noticed ee just > > dumped me straight to the prompt. > > I am wondering if this has anything to do with the new tty > > subsystem > > in 8.0, as this wasn't a problem I've experienced before under > > 7.x... > No, that's a regression appeared in (FreeBSD'ish? version of) ee > 1.5.0. i'm not so sure this is entirely ee's fault. i just grabbed a really ancient version of ee from http://www.anerd.org/sources/ (ee-1.4.2.src.tgz last modified Jan 2001). yet i see the very same behaviour as with ee 1.5.0. right now it looks more like a tty or ncurses bug. cheers. alex From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 11:08:23 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17496106566B for ; Fri, 23 Oct 2009 11:08:23 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by mx1.freebsd.org (Postfix) with ESMTP id A09068FC13 for ; Fri, 23 Oct 2009 11:08:22 +0000 (UTC) Received: by ewy18 with SMTP id 18so8466100ewy.43 for ; Fri, 23 Oct 2009 04:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=53MXkDFeYbOl06N+1CMWYMhEQkhMIytJff5KCkQ0WXc=; b=UJBW2srWWd43xwoxtJxjZnEhVVjNE2GQdms6Bj4mSObrz/wqNnOZKkBhI9PmHVMXhF 8cSVE6tJ3PN1xDnqKgfctWHv8ZJ9yeIGmjwj9OX4C1xM2282bxpj8Ox8Fgqi5lohWcv7 1vpYXg4VCrHCtpulLEzi7iyruc5A3Ipv+oXyY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=RjfUGCkHNr0QSNXuSH6XtSE5wmRFiPYpVYsxId8zud+BGd+j5nGvh3OJwlpcXWH4BQ rey3hVOBjb5JffftmKbsdOjuSwn0YMm+dB7lkvT18Br9YFqXzT2AvEvBQ15k3/0j+S91 sfAlSMzzTp2q0Csph8oRUnaX9cFFCKfPKaS2Q= MIME-Version: 1.0 Received: by 10.210.95.3 with SMTP id s3mr4491453ebb.47.1256296101354; Fri, 23 Oct 2009 04:08:21 -0700 (PDT) In-Reply-To: References: Date: Fri, 23 Oct 2009 11:08:21 +0000 Message-ID: <3a142e750910230408q5aa60bcan1d641bd9e69d96af@mail.gmail.com> From: Paul B Mahol To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Cc: Antony Mawer , freebsd-hackers@freebsd.org, Nate Eldredge Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 11:08:23 -0000 On 10/23/09, Alexander Best wrote: > Nate Eldredge schrieb am 2009-10-23: >> On Fri, 23 Oct 2009, Antony Mawer wrote: > >> >On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best >> > wrote: >> >>hi everyone, > >> >>together with hugh mahon (the author of ee) i've been trying to >> >>fix a nasty >> >>bug in ee. for some reason ee exits (not crashes) and leaves the >> >>console >> >>corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should >> >>exit all >> >>running ee instances). > >> >I noticed this the other day when working on a new 8.0-RC1 system... >> >in my case I was using putty (Windows ssh client) to access the >> >system >> >and maximised the window I had ee running in, and noticed ee just >> >dumped me straight to the prompt. > >> Seems a good start might be to compile ncurses with -g, link ee >> against it, put a breakpoint on the SIGWINCH handler, and start >> single stepping... > >> -- > >> Nate Eldredge >> nate@thatsmathematics.com > > it seems ncurses registers a standard libc function with SIGWINCH. i started > gdb, loaded ee and did "handle SIGWINCH stop" > > when i do "run" and issue a SIGWINCH to ee this is the output: > > Program received signal SIGWINCH, Window size changed. > 0x281a4063 in read () from /lib/libc.so.7 > > (gdb) nexti > 0x281a4048 in write () from /lib/libc.so.7 > (gdb) nexti > 0x281a4049 in write () from /lib/libc.so.7 > (gdb) nexti > 0x281a404e in write () from /lib/libc.so.7 > (gdb) nexti > 0x281a404f in write () from /lib/libc.so.7 > (gdb) nexti > 0x281a4055 in write () from /lib/libc.so.7 > (gdb) nexti > > Program exited normally. > > so i guess ee calls some ncurses function right at the beginning. that > ncurses > function registers a new function to be called upon SIGWINCH (maybe > exit(3)). Hmm, from my little experience with ncurses, there is no such function bind to SIGWINCH. Even if exit() is called from ncurses that's because ncurses can not handle current state in any reasonable way so exiting is only possible solution, but in such case something should be printed and program should not exit normally. If you start another shell command from ee, and let it be for example vim, once you resize xterm window, vim will still work but ee will start to consume CPU time. From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 11:50:31 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 131F0106566B for ; Fri, 23 Oct 2009 11:50:31 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout4.freenet.de (mout4.freenet.de [IPv6:2001:748:100:40::2:6]) by mx1.freebsd.org (Postfix) with ESMTP id 9E9FC8FC12 for ; Fri, 23 Oct 2009 11:50:30 +0000 (UTC) Received: from [195.4.92.20] (helo=10.mx.freenet.de) by mout4.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #92) id 1N1If5-0006zz-0u; Fri, 23 Oct 2009 13:50:27 +0200 Received: from t9911.t.pppool.de ([89.55.153.17]:12397 helo=ernst.jennejohn.org) by 10.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #94) id 1N1If4-0008Ft-QG; Fri, 23 Oct 2009 13:50:27 +0200 Date: Fri, 23 Oct 2009 13:50:24 +0200 From: Gary Jennejohn To: pluknet Message-ID: <20091023135024.377bcfa6@ernst.jennejohn.org> In-Reply-To: References: X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.2; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Antony Mawer , freebsd-hackers@freebsd.org, Best , Alexander Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 11:50:31 -0000 On Fri, 23 Oct 2009 12:58:43 +0400 pluknet wrote: > 2009/10/23 Antony Mawer : > > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best > > wrote: > >> hi everyone, > >> > >> together with hugh mahon (the author of ee) i've been trying to fix a nasty > >> bug in ee. for some reason ee exits (not crashes) and leaves the console > >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should exit all > >> running ee instances). > > > > I noticed this the other day when working on a new 8.0-RC1 system... > > in my case I was using putty (Windows ssh client) to access the system > > and maximised the window I had ee running in, and noticed ee just > > dumped me straight to the prompt. > > > > I am wondering if this has anything to do with the new tty subsystem > > in 8.0, as this wasn't a problem I've experienced before under 7.x... > > > > No, that's a regression appeared in (FreeBSD'ish? version of) ee 1.5.0. > SIGWINCH is handled in new_curse.c, but it's not being compiled/linked. --- Gary Jennejohn From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 12:00:52 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 625DB1065670 for ; Fri, 23 Oct 2009 12:00:52 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout1.freenet.de (mout1.freenet.de [IPv6:2001:748:100:40::2:3]) by mx1.freebsd.org (Postfix) with ESMTP id EDA648FC12 for ; Fri, 23 Oct 2009 12:00:51 +0000 (UTC) Received: from [195.4.92.22] (helo=12.mx.freenet.de) by mout1.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #92) id 1N1Ip8-0002Vm-RN for freebsd-hackers@freebsd.org; Fri, 23 Oct 2009 14:00:50 +0200 Received: from t9911.t.pppool.de ([89.55.153.17]:51595 helo=ernst.jennejohn.org) by 12.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #94) id 1N1Ip8-0002q7-Jo for freebsd-hackers@freebsd.org; Fri, 23 Oct 2009 14:00:50 +0200 Date: Fri, 23 Oct 2009 14:00:49 +0200 From: Gary Jennejohn To: freebsd-hackers@freebsd.org Message-ID: <20091023140049.110d0562@ernst.jennejohn.org> In-Reply-To: <20091023135024.377bcfa6@ernst.jennejohn.org> References: <20091023135024.377bcfa6@ernst.jennejohn.org> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.2; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 12:00:52 -0000 On Fri, 23 Oct 2009 13:50:24 +0200 Gary Jennejohn wrote: > On Fri, 23 Oct 2009 12:58:43 +0400 > pluknet wrote: > > > 2009/10/23 Antony Mawer : > > > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best > > > wrote: > > >> hi everyone, > > >> > > >> together with hugh mahon (the author of ee) i've been trying to fix a nasty > > >> bug in ee. for some reason ee exits (not crashes) and leaves the console > > >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should exit all > > >> running ee instances). > > > > > > I noticed this the other day when working on a new 8.0-RC1 system... > > > in my case I was using putty (Windows ssh client) to access the system > > > and maximised the window I had ee running in, and noticed ee just > > > dumped me straight to the prompt. > > > > > > I am wondering if this has anything to do with the new tty subsystem > > > in 8.0, as this wasn't a problem I've experienced before under 7.x... > > > > > > > No, that's a regression appeared in (FreeBSD'ish? version of) ee 1.5.0. > > > > SIGWINCH is handled in new_curse.c, but it's not being compiled/linked. > Never mind - I see that new_curse.c is supposed to be a substitute for ncurses if it's not available on the system. Sorry for the noise. --- Gary Jennejohn From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 12:02:40 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DFBD1065697; Fri, 23 Oct 2009 12:02:40 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 1A3CA8FC14; Fri, 23 Oct 2009 12:02:39 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id BF32C6D41B; Fri, 23 Oct 2009 12:02:38 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 9379584509; Fri, 23 Oct 2009 14:02:38 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Alexander Best References: Date: Fri, 23 Oct 2009 14:02:38 +0200 In-Reply-To: (Alexander Best's message of "Fri, 23 Oct 2009 12:42:27 +0200 (CEST)") Message-ID: <86tyxqqpwh.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Antony Mawer , freebsd-hackers@freebsd.org, pluknet , ed@freebsd.org, rafan@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 12:02:40 -0000 [cc: ed for ee and rafan for ncurses] Alexander Best writes: > i'm not so sure this is entirely ee's fault. It is *partly* ee's fault. src/usr.bin/ee/ee.c in 7: in =3D wgetch(text_win); if (in =3D=3D -1) continue; src/contrib/ee/ee.c in 8: in =3D wgetch(text_win); if (in =3D=3D -1) exit(0); /* without this exit ee will go into an=20 infinite loop if the network=20 session detaches */ >From the wgetch() man page: Programmers concerned about portability should be prepared for eit= her of two cases: (a) signal receipt does not interrupt getch; (b) sig= nal receipt interrupts getch and causes it to return ERR with errno set = to EINTR. Under the ncurses implementation, handled signals never int= er=E2=80=90 rupt getch. so ee is not portable (it should not assume that a "handled signal" such as SIGWINCH does not interrupt wgetch()), but that's not the real issue. The real issue, though, is that when a SIGWINCH is caught, wgetch() correctly returns KEY_RESIZE, but the next call to wgetch() returns -1. The next call after that is fine. I suspect the error lies somewhere inside kgetch() in contrib/ncurses/ncurses/base/lib_getch.c. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 12:08:53 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A4E8106566B for ; Fri, 23 Oct 2009 12:08:53 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay3.uni-muenster.de (ZIVM-EXRELAY3.UNI-MUENSTER.DE [128.176.192.20]) by mx1.freebsd.org (Postfix) with ESMTP id C0EF98FC21 for ; Fri, 23 Oct 2009 12:08:52 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,612,1249250400"; d="scan'208";a="16604498" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 23 Oct 2009 14:08:51 +0200 Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459) id 15E401B07BD; Fri, 23 Oct 2009 14:08:51 +0200 (CEST) Date: Fri, 23 Oct 2009 14:08:50 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: , pluknet Message-ID: In-Reply-To: <20091023135024.377bcfa6@ernst.jennejohn.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Antony Mawer , freebsd-hackers@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 12:08:53 -0000 Gary Jennejohn schrieb am 2009-10-23: > On Fri, 23 Oct 2009 12:58:43 +0400 > pluknet wrote: > > 2009/10/23 Antony Mawer : > > > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best > > > wrote: > > >> hi everyone, > > >> together with hugh mahon (the author of ee) i've been trying to > > >> fix a nasty > > >> bug in ee. for some reason ee exits (not crashes) and leaves the > > >> console > > >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should > > >> exit all > > >> running ee instances). > > > I noticed this the other day when working on a new 8.0-RC1 > > > system... > > > in my case I was using putty (Windows ssh client) to access the > > > system > > > and maximised the window I had ee running in, and noticed ee just > > > dumped me straight to the prompt. > > > I am wondering if this has anything to do with the new tty > > > subsystem > > > in 8.0, as this wasn't a problem I've experienced before under > > > 7.x... > > No, that's a regression appeared in (FreeBSD'ish? version of) ee > > 1.5.0. > SIGWINCH is handled in new_curse.c, but it's not being > compiled/linked. > --- > Gary Jennejohn i think that file is only used on systems which have termio.h/sgtty.h and ee doesn't get linked against ncurses. on those systems (linux e.g.) new_curse.c is used to handle certain things which ncurses takes care under freebsd. this is under freebsd: `make`: Neither termio.h or sgtty.h are on this system! Relying on local curses implementation. Generating make.local make -f make.local cc ee.c -o ee -ggdb -DDIAG -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB -DHAS_CTYPE -DHAS_SYS_IOCTL -DHAS_SYS_WAIT -DSLCT_HDR -DTERMCAP="\"/usr/share/misc/termcap\"" -lcursesw `ldd ee`: libncursesw.so.8 => /lib/libncursesw.so.8 (0x2809b000) libc.so.7 => /lib/libc.so.7 (0x280e9000) and under linux: `make`: Generating make.local make -f make.local make[1]: Entering directory `/easyedit-test' cc -c ee.c -DSYS5 -DBSD_SELECT -DNCURSE -DHAS_UNISTD -DHAS_STDLIB -DHAS_CTYPE -DHAS_SYS_IOCTL -DHAS_SYS_WAIT -DSLCT_HDR -s cc new_curse.c -c -DSYS5 -DBSD_SELECT -DNCURSE -DHAS_UNISTD -DHAS_STDLIB -DHAS_CTYPE -DHAS_SYS_IOCTL -DHAS_SYS_WAIT -DSLCT_HDR -s cc -o ee ee.o new_curse.o -DHAS_UNISTD -DHAS_STDLIB -DHAS_CTYPE -DHAS_SYS_IOCTL -DHAS_SYS_WAIT -DSLCT_HDR -s make[1]: Leaving directory `/easyedit-test' `ldd ee`: libc.so.6 => /lib/libc.so.6 (0x2807a000) /lib/ld-linux.so.2 (0x2805b000) alex From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 12:16:52 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82EE41065695 for ; Fri, 23 Oct 2009 12:16:52 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay3.uni-muenster.de (ZIVM-EXRELAY3.UNI-MUENSTER.DE [128.176.192.20]) by mx1.freebsd.org (Postfix) with ESMTP id 161448FC1D for ; Fri, 23 Oct 2009 12:16:51 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,612,1249250400"; d="scan'208";a="16605081" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 23 Oct 2009 14:16:51 +0200 Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459) id 1D5D71B07BD; Fri, 23 Oct 2009 14:16:51 +0200 (CEST) Date: Fri, 23 Oct 2009 14:16:50 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: , pluknet Message-ID: In-Reply-To: <20091023135024.377bcfa6@ernst.jennejohn.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Antony Mawer , freebsd-hackers@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 12:16:52 -0000 Gary Jennejohn schrieb am 2009-10-23: > On Fri, 23 Oct 2009 12:58:43 +0400 > pluknet wrote: > > 2009/10/23 Antony Mawer : > > > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best > > > wrote: > > >> hi everyone, > > >> together with hugh mahon (the author of ee) i've been trying to > > >> fix a nasty > > >> bug in ee. for some reason ee exits (not crashes) and leaves the > > >> console > > >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should > > >> exit all > > >> running ee instances). > > > I noticed this the other day when working on a new 8.0-RC1 > > > system... > > > in my case I was using putty (Windows ssh client) to access the > > > system > > > and maximised the window I had ee running in, and noticed ee just > > > dumped me straight to the prompt. > > > I am wondering if this has anything to do with the new tty > > > subsystem > > > in 8.0, as this wasn't a problem I've experienced before under > > > 7.x... > > No, that's a regression appeared in (FreeBSD'ish? version of) ee > > 1.5.0. > SIGWINCH is handled in new_curse.c, but it's not being > compiled/linked. > --- > Gary Jennejohn i just tried building ee under linux without using new_curse.c and linking the executable against ncurses. running the binary is showing the same problems with SIGWINCH. so if this is in fact caused by a ncurses bug the bug appears in linux ncurses too. alex From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 12:34:03 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9AF11065679 for ; Fri, 23 Oct 2009 12:34:02 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 779D28FC14 for ; Fri, 23 Oct 2009 12:34:02 +0000 (UTC) Received: by bwz5 with SMTP id 5so880189bwz.3 for ; Fri, 23 Oct 2009 05:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=VmgNS8y9+CSUklOZGnk6VGtj3nF4o9lqVFOCOfH7Y74=; b=If2ECV18jc/Iu3L4r1uBFt2EyaACXWdrO5lj+NeZiK8sJmj2WcmxBNBAKE1nQGtNK6 gt2BnwHsXeKmYqwEhBV+ZAqLVuK+nzK6YFjn4QVaYwyovhK3s1+Mk0d9SR21j3wSB50J YsluA1SEXAAU17/O1uT0OiV75vDrvbGUNYu/4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=PpeL6AAAZ4nzhhpuuJ2C29GboBQuvSf7ToBeqf/tq7WbZBO9L842BzUDuKj2E8Pb6b +8xYn4IDklpLxYHc+HLKxJrwipq/kbmFImDeWwTT42ZVekgGS6uILawqdCqwO7EZK4Lz BAYzLiOcKF7e40aSA0eG9fEWgHtLYBexp8F/I= MIME-Version: 1.0 Received: by 10.204.35.12 with SMTP id n12mr11239757bkd.147.1256301241213; Fri, 23 Oct 2009 05:34:01 -0700 (PDT) In-Reply-To: References: <20091023135024.377bcfa6@ernst.jennejohn.org> Date: Fri, 23 Oct 2009 16:34:01 +0400 Message-ID: From: pluknet To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Antony Mawer , freebsd-hackers@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 12:34:03 -0000 2009/10/23 Alexander Best : > Gary Jennejohn schrieb am 2009-10-23: >> On Fri, 23 Oct 2009 12:58:43 +0400 >> pluknet wrote: > >> > 2009/10/23 Antony Mawer : >> > > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best >> > > wrote: >> > >> hi everyone, > >> > >> together with hugh mahon (the author of ee) i've been trying to >> > >> fix a nasty >> > >> bug in ee. for some reason ee exits (not crashes) and leaves the >> > >> console >> > >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should >> > >> exit all >> > >> running ee instances). > >> > > I noticed this the other day when working on a new 8.0-RC1 >> > > system... >> > > in my case I was using putty (Windows ssh client) to access the >> > > system >> > > and maximised the window I had ee running in, and noticed ee just >> > > dumped me straight to the prompt. > >> > > I am wondering if this has anything to do with the new tty >> > > subsystem >> > > in 8.0, as this wasn't a problem I've experienced before under >> > > 7.x... > > >> > No, that's a regression appeared in (FreeBSD'ish? version of) ee >> > 1.5.0. > > >> SIGWINCH is handled in new_curse.c, but it's not being >> compiled/linked. > >> --- >> Gary Jennejohn > > i think that file is only used on systems which have termio.h/sgtty.h and= ee > doesn't get linked against ncurses. on those systems (linux e.g.) new_cur= se.c > is used to handle certain things which ncurses takes care under freebsd. > > this is under freebsd: > > `make`: > Neither termio.h or sgtty.h are on this system! > Relying on local curses implementation. > Generating make.local > make -f make.local > cc ee.c -o ee -ggdb -DDIAG -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB -DHAS_C= TYPE > -DHAS_SYS_IOCTL -DHAS_SYS_WAIT =A0 -DSLCT_HDR > -DTERMCAP=3D"\"/usr/share/misc/termcap\"" -lcursesw > > `ldd ee`: > libncursesw.so.8 =3D> /lib/libncursesw.so.8 (0x2809b000) > libc.so.7 =3D> /lib/libc.so.7 (0x280e9000) > [Probably already mentioned.] btw, ee compiled under fbsd with new_curse.c (and not linked with curses/cursesw) goes fine with SIGWINCH. --- Makefile.old 2009-10-23 16:13:45.000000000 +0400 +++ Makefile 2009-10-23 16:30:03.000000000 +0400 @@ -3,15 +3,14 @@ .PATH: ${.CURDIR}/../../contrib/ee CFLAGS+=3D -DHAS_NCURSES -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB \ - -DHAS_SYS_WAIT + -DHAS_SYS_WAIT -DCAP -DNCURSE PROG=3D ee +SRCS=3D ee.c new_curse.c LINKS=3D ${BINDIR}/ee ${BINDIR}/ree ${BINDIR}/ee ${BINDIR}/edit MLINKS=3D ee.1 ree.1 ee.1 edit.1 -DPADD=3D ${LIBNCURSES} -LDADD=3D -lncurses -WARNS?=3D 2 +WARNS?=3D 0 NLS=3D en_US.US-ASCII fr_FR.ISO8859-1 de_DE.ISO8859-1 pl_PL.ISO8859-2 \ uk_UA.KOI8-U ru_RU.KOI8-R hu_HU.ISO8859-2 $ ldd ./ee ./ee: libc.so.6 =3D> /lib/libc.so.6 (0x2808a000) (yes, it's FreeBSD 6.x). --=20 wbr, pluknet From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 13:26:20 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAAD1106568D for ; Fri, 23 Oct 2009 13:26:20 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay2.uni-muenster.de (ZIVM-EXRELAY2.UNI-MUENSTER.DE [128.176.192.15]) by mx1.freebsd.org (Postfix) with ESMTP id 6D9278FC29 for ; Fri, 23 Oct 2009 13:26:19 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,612,1249250400"; d="scan'208";a="227039983" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 23 Oct 2009 15:26:18 +0200 Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459) id A31521B07BD; Fri, 23 Oct 2009 15:26:18 +0200 (CEST) Date: Fri, 23 Oct 2009 15:26:18 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: pluknet Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Antony Mawer , freebsd-hackers@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 13:26:21 -0000 pluknet schrieb am 2009-10-23: > 2009/10/23 Alexander Best : > > Gary Jennejohn schrieb am 2009-10-23: > >> On Fri, 23 Oct 2009 12:58:43 +0400 > >> pluknet wrote: > >> > 2009/10/23 Antony Mawer : > >> > > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best > >> > > wrote: > >> > >> hi everyone, > >> > >> together with hugh mahon (the author of ee) i've been trying > >> > >> to > >> > >> fix a nasty > >> > >> bug in ee. for some reason ee exits (not crashes) and leaves > >> > >> the > >> > >> console > >> > >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` > >> > >> should > >> > >> exit all > >> > >> running ee instances). > >> > > I noticed this the other day when working on a new 8.0-RC1 > >> > > system... > >> > > in my case I was using putty (Windows ssh client) to access > >> > > the > >> > > system > >> > > and maximised the window I had ee running in, and noticed ee > >> > > just > >> > > dumped me straight to the prompt. > >> > > I am wondering if this has anything to do with the new tty > >> > > subsystem > >> > > in 8.0, as this wasn't a problem I've experienced before under > >> > > 7.x... > >> > No, that's a regression appeared in (FreeBSD'ish? version of) ee > >> > 1.5.0. > >> SIGWINCH is handled in new_curse.c, but it's not being > >> compiled/linked. > >> --- > >> Gary Jennejohn > > i think that file is only used on systems which have > > termio.h/sgtty.h and ee > > doesn't get linked against ncurses. on those systems (linux e.g.) > > new_curse.c > > is used to handle certain things which ncurses takes care under > > freebsd. > > this is under freebsd: > > `make`: > > Neither termio.h or sgtty.h are on this system! > > Relying on local curses implementation. > > Generating make.local > > make -f make.local > > cc ee.c -o ee -ggdb -DDIAG -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB > > -DHAS_CTYPE > > -DHAS_SYS_IOCTL -DHAS_SYS_WAIT =A0 -DSLCT_HDR > > -DTERMCAP=3D"\"/usr/share/misc/termcap\"" -lcursesw > > `ldd ee`: > > libncursesw.so.8 =3D> /lib/libncursesw.so.8 (0x2809b000) > > libc.so.7 =3D> /lib/libc.so.7 (0x280e9000) > [Probably already mentioned.] > btw, ee compiled under fbsd with new_curse.c > (and not linked with curses/cursesw) goes fine with SIGWINCH. > --- Makefile.old 2009-10-23 16:13:45.000000000 +0400 > +++ Makefile 2009-10-23 16:30:03.000000000 +0400 > @@ -3,15 +3,14 @@ > .PATH: ${.CURDIR}/../../contrib/ee > CFLAGS+=3D -DHAS_NCURSES -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB \ > - -DHAS_SYS_WAIT > + -DHAS_SYS_WAIT -DCAP -DNCURSE > PROG=3D ee > +SRCS=3D ee.c new_curse.c > LINKS=3D ${BINDIR}/ee ${BINDIR}/ree ${BINDIR}/ee ${BINDIR}/edit > MLINKS=3D ee.1 ree.1 ee.1 edit.1 > -DPADD=3D ${LIBNCURSES} > -LDADD=3D -lncurses > -WARNS?=3D 2 > +WARNS?=3D 0 > NLS=3D en_US.US-ASCII fr_FR.ISO8859-1 de_DE.ISO8859-1 > pl_PL.ISO8859-2 \ > uk_UA.KOI8-U ru_RU.KOI8-R hu_HU.ISO8859-2 > $ ldd ./ee > ./ee: > libc.so.6 =3D> /lib/libc.so.6 (0x2808a000) > (yes, it's FreeBSD 6.x). won't work under CURRENT i'm afraid: Warning: Object directory not changed from original /usr/src/usr.bin/ee cc -O2 -fno-strict-aliasing -pipe -march=3Dnative -DHAS_NCURSES -DHAS_UNIS= TD -DHAS_STDARG -DHAS_STDLIB -DHAS_SYS_WAIT -DCAP -DNCURSE -std=3Dgnu99 -fstack-protector -Wno-pointer-sign -c /usr/src/usr.bin/ee/../../contrib/ee/ee.c In file included from /usr/src/usr.bin/ee/../../contrib/ee/ee.c:68: /usr/src/usr.bin/ee/../../contrib/ee/new_curse.h:47:19: error: sgtty.h: No such file or directory *** Error code 1 Stop in /usr/src/usr.bin/ee. here's the entry in ObsoleteFiles.inc: # 20080725: sgtty.h removed OLD_FILES+=3Dusr/include/sgtty.h alex From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 13:26:29 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7694A1065704; Fri, 23 Oct 2009 13:26:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 471BC8FC20; Fri, 23 Oct 2009 13:26:29 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id EBA1246B2C; Fri, 23 Oct 2009 09:26:28 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 30FBB8A01D; Fri, 23 Oct 2009 09:26:28 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org, Daniel Eischen Date: Fri, 23 Oct 2009 08:02:49 -0400 User-Agent: KMail/1.9.7 References: <4AE0BBAB.3040807@cs.duke.edu> <4AE0C995.5060303@cs.duke.edu> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910230802.49873.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 23 Oct 2009 09:26:28 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Andrew Gallatin , Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 13:26:29 -0000 On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: > On Thu, 22 Oct 2009, Andrew Gallatin wrote: > > > Daniel Eischen wrote: > >> On Thu, 22 Oct 2009, Andrew Gallatin wrote: > >> > >>> Hi, > >>> > >>> We're designing some software which has to lock access to > >>> shared memory pages between several processes, and has to > >>> run on Linux, Solaris, and FreeBSD. We were planning to > >>> have the lock be a pthread_mutex_t residing in the > >>> shared memory page. This works well on Linux and Solaris, > >>> but FreeBSD (at least 7-stable) does not support > >>> PTHREAD_PROCESS_SHARED mutexes. > >>> > >>> We then moved on to posix semaphores. Using sem_wait/sem_post > >>> with the sem_t residing in a shared page seems to work on > >>> all 3 platforms. However, the FreeBSD (7-stable) man page > >>> for sem_init(3) has this scary text regarding the pshared > >>> value: > >>> > >>> The sem_init() function initializes the unnamed semaphore pointed to > >>> by > >>> sem to have the value value. A non-zero value for pshared specifies a > >>> shared semaphore that can be used by multiple processes, which this > >>> implementation is not capable of. > >>> > >>> Is this text obsolete? Or is my test just "getting lucky"? > >> > >> I think you're getting lucky. > > > > Yes, after playing with the code some, I now see that. :( > > > >>> Is there recommended way to do this? > >> > >> I believe the only way to do this is with SYSV semaphores > >> (semop, semget, semctl). Unfortunately, these are not as > >> easy to use, IMHO. > > > > Yes, they are pretty ugly, and we were hoping to avoid them. > > Are there any plans to support either PTHREAD_PROCESS_SHARED > > mutexes, or pshared posix semaphores in FreeBSD? > > It's planned, just not (yet) being actively worked on. > It's a API change mostly, and then adding in all the > compat hooks so we don't break ABI. There are also an alternate set of patches on threads@ to allow just shared semaphores I think w/o the changes to the pthread types. I can't recall exactly what they did, but I think rrs@ was playing with using umtx directly to implement some sort of process-shared primitive. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 13:32:34 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED9AB10656B9 for ; Fri, 23 Oct 2009 13:32:34 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-fx0-f210.google.com (mail-fx0-f210.google.com [209.85.220.210]) by mx1.freebsd.org (Postfix) with ESMTP id 720C58FC13 for ; Fri, 23 Oct 2009 13:32:34 +0000 (UTC) Received: by fxm6 with SMTP id 6so9751585fxm.43 for ; Fri, 23 Oct 2009 06:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=x7nYXaeO2A5OObKqqNzAr4R3IDRDkH3lo9kSpayWJ6k=; b=nHe33BOOPbYhd6jtnN0XLLnt+ey7rietqeGfc/02WTeJbLUMFMhC4KP7OmcNbWUHgm 6a46eP2mM8ZXHfK1YqEul8apbekaToMGAElHgxsglUK3DHOebmKPfQ70PDC/r1h84d9M pBKEC/OzEV2Rddf2w8LuGgtWNbWdQT9m8IiY8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=AEfaDthqmWVRNOv820XSo4qwEzbZPoujX7NsttX5hWlCxFykkZjb0QgSCJFLcP2zSH WEKK+bPECV69Toi1gOoUU/zwIoVyHvhvaOkIuxOzsGDPu1HjFYeA+iNSItTT1vgflvK5 trrt+75Ip1uGP/CNT1SR1NAKnoeBNvKTbwKAg= MIME-Version: 1.0 Received: by 10.204.32.204 with SMTP id e12mr5335056bkd.51.1256304752743; Fri, 23 Oct 2009 06:32:32 -0700 (PDT) In-Reply-To: References: Date: Fri, 23 Oct 2009 17:32:32 +0400 Message-ID: From: pluknet To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Antony Mawer , freebsd-hackers@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 13:32:35 -0000 2009/10/23 Alexander Best : > pluknet schrieb am 2009-10-23: >> 2009/10/23 Alexander Best : >> > Gary Jennejohn schrieb am 2009-10-23: >> >> On Fri, 23 Oct 2009 12:58:43 +0400 >> >> pluknet wrote: > >> >> > 2009/10/23 Antony Mawer : >> >> > > On Fri, Oct 23, 2009 at 1:35 PM, Alexander Best >> >> > > wrote: >> >> > >> hi everyone, > >> >> > >> together with hugh mahon (the author of ee) i've been trying >> >> > >> to >> >> > >> fix a nasty >> >> > >> bug in ee. for some reason ee exits (not crashes) and leaves >> >> > >> the >> >> > >> console >> >> > >> corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` >> >> > >> should >> >> > >> exit all >> >> > >> running ee instances). > >> >> > > I noticed this the other day when working on a new 8.0-RC1 >> >> > > system... >> >> > > in my case I was using putty (Windows ssh client) to access >> >> > > the >> >> > > system >> >> > > and maximised the window I had ee running in, and noticed ee >> >> > > just >> >> > > dumped me straight to the prompt. > >> >> > > I am wondering if this has anything to do with the new tty >> >> > > subsystem >> >> > > in 8.0, as this wasn't a problem I've experienced before under >> >> > > 7.x... > > >> >> > No, that's a regression appeared in (FreeBSD'ish? version of) ee >> >> > 1.5.0. > > >> >> SIGWINCH is handled in new_curse.c, but it's not being >> >> compiled/linked. > >> >> --- >> >> Gary Jennejohn > >> > i think that file is only used on systems which have >> > termio.h/sgtty.h and ee >> > doesn't get linked against ncurses. on those systems (linux e.g.) >> > new_curse.c >> > is used to handle certain things which ncurses takes care under >> > freebsd. > >> > this is under freebsd: > >> > `make`: >> > Neither termio.h or sgtty.h are on this system! >> > Relying on local curses implementation. >> > Generating make.local >> > make -f make.local >> > cc ee.c -o ee -ggdb -DDIAG -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB >> > -DHAS_CTYPE >> > -DHAS_SYS_IOCTL -DHAS_SYS_WAIT =A0 -DSLCT_HDR >> > -DTERMCAP=3D"\"/usr/share/misc/termcap\"" -lcursesw > >> > `ldd ee`: >> > libncursesw.so.8 =3D> /lib/libncursesw.so.8 (0x2809b000) >> > libc.so.7 =3D> /lib/libc.so.7 (0x280e9000) > > >> [Probably already mentioned.] > >> btw, ee compiled under fbsd with new_curse.c >> (and not linked with curses/cursesw) goes fine with SIGWINCH. > >> --- Makefile.old =A0 =A0 =A0 =A02009-10-23 16:13:45.000000000 +0400 >> +++ Makefile =A0 =A02009-10-23 16:30:03.000000000 +0400 >> @@ -3,15 +3,14 @@ >> =A0.PATH: ${.CURDIR}/../../contrib/ee > >> =A0CFLAGS+=3D -DHAS_NCURSES -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB \ >> - =A0 =A0 =A0 =A0-DHAS_SYS_WAIT >> + =A0 =A0 =A0 =A0-DHAS_SYS_WAIT -DCAP -DNCURSE > >> =A0PROG=3D =A0ee >> +SRCS=3D =A0ee.c new_curse.c >> =A0LINKS=3D ${BINDIR}/ee ${BINDIR}/ree ${BINDIR}/ee ${BINDIR}/edit >> =A0MLINKS=3D =A0 =A0 =A0 =A0ee.1 ree.1 ee.1 edit.1 >> -DPADD=3D ${LIBNCURSES} >> -LDADD=3D -lncurses > >> -WARNS?=3D =A0 =A0 =A0 =A02 >> +WARNS?=3D =A0 =A0 =A0 =A00 > >> =A0NLS=3D =A0 en_US.US-ASCII fr_FR.ISO8859-1 de_DE.ISO8859-1 >> =A0pl_PL.ISO8859-2 \ >> =A0 =A0 =A0 =A0 uk_UA.KOI8-U ru_RU.KOI8-R hu_HU.ISO8859-2 > >> $ ldd ./ee >> ./ee: >> =A0 =A0 =A0 =A0 libc.so.6 =3D> /lib/libc.so.6 (0x2808a000) > >> (yes, it's FreeBSD 6.x). > > won't work under CURRENT i'm afraid: > > Warning: Object directory not changed from original /usr/src/usr.bin/ee > cc =A0-O2 -fno-strict-aliasing -pipe -march=3Dnative -DHAS_NCURSES -DHAS_= UNISTD > -DHAS_STDARG -DHAS_STDLIB =A0-DHAS_SYS_WAIT -DCAP -DNCURSE -std=3Dgnu99 > -fstack-protector -Wno-pointer-sign -c > /usr/src/usr.bin/ee/../../contrib/ee/ee.c > In file included from /usr/src/usr.bin/ee/../../contrib/ee/ee.c:68: > /usr/src/usr.bin/ee/../../contrib/ee/new_curse.h:47:19: error: sgtty.h: N= o > such file or directory > *** Error code 1 > > Stop in /usr/src/usr.bin/ee. > > here's the entry in ObsoleteFiles.inc: > > # 20080725: sgtty.h removed > OLD_FILES+=3Dusr/include/sgtty.h > > alex > Ah, OK. Just a stupid and not-tested guess. --=20 wbr, pluknet From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 14:56:11 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C04B1065696 for ; Fri, 23 Oct 2009 14:56:11 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9DD648FC15 for ; Fri, 23 Oct 2009 14:56:10 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id n9NEu6V6016744; Fri, 23 Oct 2009 10:56:06 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Fri, 23 Oct 2009 10:56:07 -0400 (EDT) Date: Fri, 23 Oct 2009 10:56:06 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: John Baldwin In-Reply-To: <200910230802.49873.jhb@freebsd.org> Message-ID: References: <4AE0BBAB.3040807@cs.duke.edu> <4AE0C995.5060303@cs.duke.edu> <200910230802.49873.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Andrew Gallatin , Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 14:56:11 -0000 On Fri, 23 Oct 2009, John Baldwin wrote: > On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: >> On Thu, 22 Oct 2009, Andrew Gallatin wrote: >> >>> Daniel Eischen wrote: >>>> On Thu, 22 Oct 2009, Andrew Gallatin wrote: >>>> >>>>> Hi, >>>>> >>>>> We're designing some software which has to lock access to >>>>> shared memory pages between several processes, and has to >>>>> run on Linux, Solaris, and FreeBSD. We were planning to >>>>> have the lock be a pthread_mutex_t residing in the >>>>> shared memory page. This works well on Linux and Solaris, >>>>> but FreeBSD (at least 7-stable) does not support >>>>> PTHREAD_PROCESS_SHARED mutexes. >>>>> >>>>> We then moved on to posix semaphores. Using sem_wait/sem_post >>>>> with the sem_t residing in a shared page seems to work on >>>>> all 3 platforms. However, the FreeBSD (7-stable) man page >>>>> for sem_init(3) has this scary text regarding the pshared >>>>> value: >>>>> >>>>> The sem_init() function initializes the unnamed semaphore pointed to >>>>> by >>>>> sem to have the value value. A non-zero value for pshared specifies > a >>>>> shared semaphore that can be used by multiple processes, which this >>>>> implementation is not capable of. >>>>> >>>>> Is this text obsolete? Or is my test just "getting lucky"? >>>> >>>> I think you're getting lucky. >>> >>> Yes, after playing with the code some, I now see that. :( >>> >>>>> Is there recommended way to do this? >>>> >>>> I believe the only way to do this is with SYSV semaphores >>>> (semop, semget, semctl). Unfortunately, these are not as >>>> easy to use, IMHO. >>> >>> Yes, they are pretty ugly, and we were hoping to avoid them. >>> Are there any plans to support either PTHREAD_PROCESS_SHARED >>> mutexes, or pshared posix semaphores in FreeBSD? >> >> It's planned, just not (yet) being actively worked on. >> It's a API change mostly, and then adding in all the >> compat hooks so we don't break ABI. > > There are also an alternate set of patches on threads@ to allow just shared > semaphores I think w/o the changes to the pthread types. I can't recall > exactly what they did, but I think rrs@ was playing with using umtx directly > to implement some sort of process-shared primitive. That's really not the way to go. The structs really need to become public. -- DE From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 15:39:38 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C161D106566C; Fri, 23 Oct 2009 15:39:38 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 748508FC15; Fri, 23 Oct 2009 15:39:38 +0000 (UTC) Received: from [172.31.193.10] (cpe-069-134-110-200.nc.res.rr.com [69.134.110.200]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id n9NFdbYW024946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Oct 2009 11:39:37 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu n9NFdbYW024946 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1256312377; bh=ubFuS5RpnbEDksjH9chxijWie5C0nifsY5MSBoKx+m0=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=JdCDZrZ+LRt9Y6iwMHIkQ66mM77lpMp33eyn/w/2mZgXjrdae/pBP/EKaIR2SiG88 3SjMSEl1ZG7v0RbBfz4L78GvkTePf5E+72CEhX4hUqb90sC1c+v7roTCQYh2ABkohs Ckw+DTDWUxEDzybKVPU73wDejYKqQs+ycqGPKSTk= Message-ID: <4AE1CE31.1090206@cs.duke.edu> Date: Fri, 23 Oct 2009 11:39:29 -0400 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Daniel Eischen References: <4AE0BBAB.3040807@cs.duke.edu> <4AE0C995.5060303@cs.duke.edu> <200910230802.49873.jhb@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 15:39:38 -0000 Daniel Eischen wrote: > On Fri, 23 Oct 2009, John Baldwin wrote: > >> On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: >>> On Thu, 22 Oct 2009, Andrew Gallatin wrote: >>> >>>> Daniel Eischen wrote: >>>>> On Thu, 22 Oct 2009, Andrew Gallatin wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> We're designing some software which has to lock access to >>>>>> shared memory pages between several processes, and has to >>>>>> run on Linux, Solaris, and FreeBSD. We were planning to >>>>>> have the lock be a pthread_mutex_t residing in the >>>>>> shared memory page. This works well on Linux and Solaris, >>>>>> but FreeBSD (at least 7-stable) does not support >>>>>> PTHREAD_PROCESS_SHARED mutexes. >>>>>> >>>>>> We then moved on to posix semaphores. Using sem_wait/sem_post >>>>>> with the sem_t residing in a shared page seems to work on >>>>>> all 3 platforms. However, the FreeBSD (7-stable) man page >>>>>> for sem_init(3) has this scary text regarding the pshared >>>>>> value: >>>>>> >>>>>> The sem_init() function initializes the unnamed semaphore >>>>>> pointed to >>>>>> by >>>>>> sem to have the value value. A non-zero value for pshared >>>>>> specifies >> a >>>>>> shared semaphore that can be used by multiple processes, which >>>>>> this >>>>>> implementation is not capable of. >>>>>> >>>>>> Is this text obsolete? Or is my test just "getting lucky"? >>>>> >>>>> I think you're getting lucky. >>>> >>>> Yes, after playing with the code some, I now see that. :( >>>> >>>>>> Is there recommended way to do this? >>>>> >>>>> I believe the only way to do this is with SYSV semaphores >>>>> (semop, semget, semctl). Unfortunately, these are not as >>>>> easy to use, IMHO. >>>> >>>> Yes, they are pretty ugly, and we were hoping to avoid them. >>>> Are there any plans to support either PTHREAD_PROCESS_SHARED >>>> mutexes, or pshared posix semaphores in FreeBSD? >>> >>> It's planned, just not (yet) being actively worked on. >>> It's a API change mostly, and then adding in all the >>> compat hooks so we don't break ABI. >> >> There are also an alternate set of patches on threads@ to allow just >> shared >> semaphores I think w/o the changes to the pthread types. I can't recall >> exactly what they did, but I think rrs@ was playing with using umtx >> directly >> to implement some sort of process-shared primitive. > > That's really not the way to go. The structs really need > to become public. > It would be great if they were, but that discussion was 6 months ago, and nothing seems to have happened. Plus we need to support at least 7.X and probably 6, so any changes here might not even help us. What is wrong with just using umtx directly? It seems to do exactly what we need. Thanks, Drew From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 15:45:52 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D24D3106566C; Fri, 23 Oct 2009 15:45:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB598FC17; Fri, 23 Oct 2009 15:45:52 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2568146B53; Fri, 23 Oct 2009 11:45:52 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 42CD18A01F; Fri, 23 Oct 2009 11:45:51 -0400 (EDT) From: John Baldwin To: Daniel Eischen Date: Fri, 23 Oct 2009 11:36:21 -0400 User-Agent: KMail/1.9.7 References: <4AE0BBAB.3040807@cs.duke.edu> <200910230802.49873.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910231136.21837.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 23 Oct 2009 11:45:51 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: freebsd-hackers@freebsd.org, Andrew Gallatin , Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 15:45:53 -0000 On Friday 23 October 2009 10:56:06 am Daniel Eischen wrote: > On Fri, 23 Oct 2009, John Baldwin wrote: > > > On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: > >> On Thu, 22 Oct 2009, Andrew Gallatin wrote: > >> > >>> Daniel Eischen wrote: > >>>> On Thu, 22 Oct 2009, Andrew Gallatin wrote: > >>>> > >>>>> Hi, > >>>>> > >>>>> We're designing some software which has to lock access to > >>>>> shared memory pages between several processes, and has to > >>>>> run on Linux, Solaris, and FreeBSD. We were planning to > >>>>> have the lock be a pthread_mutex_t residing in the > >>>>> shared memory page. This works well on Linux and Solaris, > >>>>> but FreeBSD (at least 7-stable) does not support > >>>>> PTHREAD_PROCESS_SHARED mutexes. > >>>>> > >>>>> We then moved on to posix semaphores. Using sem_wait/sem_post > >>>>> with the sem_t residing in a shared page seems to work on > >>>>> all 3 platforms. However, the FreeBSD (7-stable) man page > >>>>> for sem_init(3) has this scary text regarding the pshared > >>>>> value: > >>>>> > >>>>> The sem_init() function initializes the unnamed semaphore pointed to > >>>>> by > >>>>> sem to have the value value. A non-zero value for pshared specifies > > a > >>>>> shared semaphore that can be used by multiple processes, which this > >>>>> implementation is not capable of. > >>>>> > >>>>> Is this text obsolete? Or is my test just "getting lucky"? > >>>> > >>>> I think you're getting lucky. > >>> > >>> Yes, after playing with the code some, I now see that. :( > >>> > >>>>> Is there recommended way to do this? > >>>> > >>>> I believe the only way to do this is with SYSV semaphores > >>>> (semop, semget, semctl). Unfortunately, these are not as > >>>> easy to use, IMHO. > >>> > >>> Yes, they are pretty ugly, and we were hoping to avoid them. > >>> Are there any plans to support either PTHREAD_PROCESS_SHARED > >>> mutexes, or pshared posix semaphores in FreeBSD? > >> > >> It's planned, just not (yet) being actively worked on. > >> It's a API change mostly, and then adding in all the > >> compat hooks so we don't break ABI. > > > > There are also an alternate set of patches on threads@ to allow just shared > > semaphores I think w/o the changes to the pthread types. I can't recall > > exactly what they did, but I think rrs@ was playing with using umtx directly > > to implement some sort of process-shared primitive. > > That's really not the way to go. The structs really need > to become public. I was mostly suggesting it as a way to use something sooner since I expect it will be a long while before anyone does the pthreads work. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 15:47:40 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06EA4106566B; Fri, 23 Oct 2009 15:47:40 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id C7BFD8FC1D; Fri, 23 Oct 2009 15:47:38 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id n9NFlaCO016835; Fri, 23 Oct 2009 11:47:36 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Fri, 23 Oct 2009 11:47:36 -0400 (EDT) Date: Fri, 23 Oct 2009 11:47:36 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Andrew Gallatin In-Reply-To: <4AE1CE31.1090206@cs.duke.edu> Message-ID: References: <4AE0BBAB.3040807@cs.duke.edu> <4AE0C995.5060303@cs.duke.edu> <200910230802.49873.jhb@freebsd.org> <4AE1CE31.1090206@cs.duke.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 15:47:40 -0000 On Fri, 23 Oct 2009, Andrew Gallatin wrote: > Daniel Eischen wrote: >> On Fri, 23 Oct 2009, John Baldwin wrote: >> >>> On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: >>>> On Thu, 22 Oct 2009, Andrew Gallatin wrote: >>>> >>>>> Daniel Eischen wrote: >>>>>> On Thu, 22 Oct 2009, Andrew Gallatin wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> We're designing some software which has to lock access to >>>>>>> shared memory pages between several processes, and has to >>>>>>> run on Linux, Solaris, and FreeBSD. We were planning to >>>>>>> have the lock be a pthread_mutex_t residing in the >>>>>>> shared memory page. This works well on Linux and Solaris, >>>>>>> but FreeBSD (at least 7-stable) does not support >>>>>>> PTHREAD_PROCESS_SHARED mutexes. >>>>>>> >>>>>>> We then moved on to posix semaphores. Using sem_wait/sem_post >>>>>>> with the sem_t residing in a shared page seems to work on >>>>>>> all 3 platforms. However, the FreeBSD (7-stable) man page >>>>>>> for sem_init(3) has this scary text regarding the pshared >>>>>>> value: >>>>>>> >>>>>>> The sem_init() function initializes the unnamed semaphore pointed >>>>>>> to >>>>>>> by >>>>>>> sem to have the value value. A non-zero value for pshared >>>>>>> specifies >>> a >>>>>>> shared semaphore that can be used by multiple processes, which >>>>>>> this >>>>>>> implementation is not capable of. >>>>>>> >>>>>>> Is this text obsolete? Or is my test just "getting lucky"? >>>>>> >>>>>> I think you're getting lucky. >>>>> >>>>> Yes, after playing with the code some, I now see that. :( >>>>> >>>>>>> Is there recommended way to do this? >>>>>> >>>>>> I believe the only way to do this is with SYSV semaphores >>>>>> (semop, semget, semctl). Unfortunately, these are not as >>>>>> easy to use, IMHO. >>>>> >>>>> Yes, they are pretty ugly, and we were hoping to avoid them. >>>>> Are there any plans to support either PTHREAD_PROCESS_SHARED >>>>> mutexes, or pshared posix semaphores in FreeBSD? >>>> >>>> It's planned, just not (yet) being actively worked on. >>>> It's a API change mostly, and then adding in all the >>>> compat hooks so we don't break ABI. >>> >>> There are also an alternate set of patches on threads@ to allow just >>> shared >>> semaphores I think w/o the changes to the pthread types. I can't recall >>> exactly what they did, but I think rrs@ was playing with using umtx >>> directly >>> to implement some sort of process-shared primitive. >> >> That's really not the way to go. The structs really need >> to become public. >> > > It would be great if they were, but that discussion was 6 months > ago, and nothing seems to have happened. Plus we need to support > at least 7.X and probably 6, so any changes here might not even > help us. > > What is wrong with just using umtx directly? It seems to do > exactly what we need. Because you can't do anything more than use umtx directly, like check for mutex types and return appropriate error codes. Just look at other implementations - Solaris, Linux, all have their pthread_*_t as public structs. -- DE From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 15:55:07 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79892106566B; Fri, 23 Oct 2009 15:55:07 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 4194A8FC15; Fri, 23 Oct 2009 15:55:07 +0000 (UTC) Received: from [172.31.193.10] (cpe-069-134-110-200.nc.res.rr.com [69.134.110.200]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id n9NFt6aK025918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Oct 2009 11:55:06 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu n9NFt6aK025918 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1256313306; bh=5PyRLb0zmccKj04ypHIH+kASCci8BVD+Rh0vZFoHCFE=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=QJm5/0yJMS0NUzMHDWKcyS65+HHUjg3UvDX9AVx7Vt2U4jIJW+ksBW5apOYaIcV4x N7Izdj21k2MZgcYAGaGKpDmBsEp6J9GbHR2JiVaUEUkErAJLwt49ACTp4R4sVunyZG SIaT87oG7oQ7fAzDm1DdiVdq6uR09aMKIpzN2Db8= Message-ID: <4AE1D1D2.1090307@cs.duke.edu> Date: Fri, 23 Oct 2009 11:54:58 -0400 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Daniel Eischen References: <4AE0BBAB.3040807@cs.duke.edu> <4AE0C995.5060303@cs.duke.edu> <200910230802.49873.jhb@freebsd.org> <4AE1CE31.1090206@cs.duke.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 15:55:07 -0000 Daniel Eischen wrote: > On Fri, 23 Oct 2009, Andrew Gallatin wrote: > >> Daniel Eischen wrote: >>> On Fri, 23 Oct 2009, John Baldwin wrote: >>> >>>> On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: >>>>> On Thu, 22 Oct 2009, Andrew Gallatin wrote: >>>>> >>>>>> Daniel Eischen wrote: >>>>>>> On Thu, 22 Oct 2009, Andrew Gallatin wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> We're designing some software which has to lock access to >>>>>>>> shared memory pages between several processes, and has to >>>>>>>> run on Linux, Solaris, and FreeBSD. We were planning to >>>>>>>> have the lock be a pthread_mutex_t residing in the >>>>>>>> shared memory page. This works well on Linux and Solaris, >>>>>>>> but FreeBSD (at least 7-stable) does not support >>>>>>>> PTHREAD_PROCESS_SHARED mutexes. >>>>>>>> >>>>>>>> We then moved on to posix semaphores. Using sem_wait/sem_post >>>>>>>> with the sem_t residing in a shared page seems to work on >>>>>>>> all 3 platforms. However, the FreeBSD (7-stable) man page >>>>>>>> for sem_init(3) has this scary text regarding the pshared >>>>>>>> value: >>>>>>>> >>>>>>>> The sem_init() function initializes the unnamed semaphore >>>>>>>> pointed to >>>>>>>> by >>>>>>>> sem to have the value value. A non-zero value for pshared >>>>>>>> specifies >>>> a >>>>>>>> shared semaphore that can be used by multiple processes, >>>>>>>> which this >>>>>>>> implementation is not capable of. >>>>>>>> >>>>>>>> Is this text obsolete? Or is my test just "getting lucky"? >>>>>>> >>>>>>> I think you're getting lucky. >>>>>> >>>>>> Yes, after playing with the code some, I now see that. :( >>>>>> >>>>>>>> Is there recommended way to do this? >>>>>>> >>>>>>> I believe the only way to do this is with SYSV semaphores >>>>>>> (semop, semget, semctl). Unfortunately, these are not as >>>>>>> easy to use, IMHO. >>>>>> >>>>>> Yes, they are pretty ugly, and we were hoping to avoid them. >>>>>> Are there any plans to support either PTHREAD_PROCESS_SHARED >>>>>> mutexes, or pshared posix semaphores in FreeBSD? >>>>> >>>>> It's planned, just not (yet) being actively worked on. >>>>> It's a API change mostly, and then adding in all the >>>>> compat hooks so we don't break ABI. >>>> >>>> There are also an alternate set of patches on threads@ to allow just >>>> shared >>>> semaphores I think w/o the changes to the pthread types. I can't >>>> recall >>>> exactly what they did, but I think rrs@ was playing with using umtx >>>> directly >>>> to implement some sort of process-shared primitive. >>> >>> That's really not the way to go. The structs really need >>> to become public. >>> >> >> It would be great if they were, but that discussion was 6 months >> ago, and nothing seems to have happened. Plus we need to support >> at least 7.X and probably 6, so any changes here might not even >> help us. >> >> What is wrong with just using umtx directly? It seems to do >> exactly what we need. > > Because you can't do anything more than use umtx directly, > like check for mutex types and return appropriate error > codes. Just look at other implementations - Solaris, > Linux, all have their pthread_*_t as public structs. I'm not saying that having pthread*t public, and getting all the features of real PTHREAD_PROCESS_SHARED would not be far better in general. But in this case all we need is a lock around a shared resource. Eg, nothing fance. So our choices seem to be either: 1) use sysv semaphores (ick) 2) use a hand rolled spinlock (ick) 3) use some sort of hack built into our driver (ick, ick) 4) use umtx Is there some bug or limitation in umtx that makes it inappropriate? (beyond the obvious, like the potential to leave a resource locked forever if the lock holder exits). Thanks, Drew From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 15:56:43 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB15F1065670 for ; Fri, 23 Oct 2009 15:56:43 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 544598FC19 for ; Fri, 23 Oct 2009 15:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Date:From:To:Cc:Subject:Message-ID: Reply-To:References:MIME-Version:Content-Type:In-Reply-To: Sender; bh=VP4ytz+ADu40j9hDp3t8IWoOu7F2FF00IaGP/7KkS4s=; b=HtNgm noQBNTBSac9Amcw0PWicXmNO+iQEKGhOcSXGi6pncDdu0ktGBwjIE5fxe5V8aV6w I+9Q7SO248YTcUW+i/lJyQgrCWhpMv+ABYV7lRdhuPMD9yRg9kCJZ2WL29FXcRF/ KqnrXng3XSIIw956ZRtnb3O1bsaE2Ko0/E64jTbg5YImsNv6iLCF1KhgBucyiZtK zD20E3eBB94QpRoW4vPyeqY8WRTg3qPFp1DsrJQ+CUNSWpvLbgDy+w/vwkPWP1ng ZL8KZisQlVcAAvti1RxXpWelAMnNBqZDc4SmxXwwM6fJJD92ieUl7zytV7hvMY1L 5WvI1Zeh347mF7iig== Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1N1MVK-000HX7-GV; Fri, 23 Oct 2009 19:56:38 +0400 Date: Fri, 23 Oct 2009 19:56:35 +0400 From: Eygene Ryabinkin To: Dag-Erling Sm??rgrav Message-ID: <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> References: <86tyxqqpwh.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline In-Reply-To: <86tyxqqpwh.fsf@ds4.des.no> Sender: rea-fbsd@codelabs.ru Cc: freebsd-hackers@freebsd.org, pluknet , ed@freebsd.org, Antony Mawer , Alexander Best , rafan@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rea-fbsd@codelabs.ru List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 15:56:43 -0000 --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Gentlemen, good day. Fri, Oct 23, 2009 at 02:02:38PM +0200, Dag-Erling Sm??rgrav wrote: > src/contrib/ee/ee.c in 8: > > in = wgetch(text_win); > if (in == -1) > exit(0); /* without this exit ee will go into an > infinite loop if the network > session detaches */ > > >From the wgetch() man page: > > Programmers concerned about portability should be prepared for > either of two cases: (a) signal receipt does not interrupt > getch; (b) signal receipt interrupts getch and causes it to > return ERR with errno set to EINTR. Under the ncurses > implementation, handled signals never inter??? rupt getch. Hmm, we can transform this code to the following one: ----- errno = 0; do { in = wgetch(text_win); } while (errno == EINTR); if (in == -1) exit(0); ----- This won't help with FreeBSD's ncurses, but may be other variants will feel much better with such a event loop variant. > The real issue, though, is that when a SIGWINCH is caught, wgetch() > correctly returns KEY_RESIZE, but the next call to wgetch() returns -1. > The next call after that is fine. I suspect the error lies somewhere > inside kgetch() in contrib/ncurses/ncurses/base/lib_getch.c. The problem should be healed with the attached patch. And you're partly right: this is kgetch() that is returning ERR for the second wgetch(), but kgetch() shouldn't be blamed for this -- _nc_wgetch() should. At least in my opinion ;) Any views on this? -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ # --+HP7ph2BbKc20aGI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ncurses-properly-handle-SIGWINCH.diff" Content-Transfer-Encoding: quoted-printable =46rom d0b09b188c778858f44379546bcce05e8a279fe0 Mon Sep 17 00:00:00 2001 =46rom: Eygene Ryabinkin Date: Fri, 23 Oct 2009 19:02:14 +0400 Subject: [PATCH] Ncurses: get ERR from the fifo when SIGWINCH is handled fifo_pull() will put ERR to the buffer if read() will fail for any reason. kgetch() will notice this ERR and won't interpret any fifo contents setting peek =3D head. But when _nc_wgetch() will handle SIGWINCH and KEY_RESIZE will be pushed into fifo and taken out, ERR will still stay there. We should take ERR from the fifo or kgetch() will return ERR on all subsequent calls. Signed-off-by: Eygene Ryabinkin --- contrib/ncurses/ncurses/base/lib_getch.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/contrib/ncurses/ncurses/base/lib_getch.c b/contrib/ncurses/ncu= rses/base/lib_getch.c index a3812be..e7ba0b2 100644 --- a/contrib/ncurses/ncurses/base/lib_getch.c +++ b/contrib/ncurses/ncurses/base/lib_getch.c @@ -476,6 +476,12 @@ _nc_wgetch(WINDOW *win, /* resizeterm can push KEY_RESIZE */ if (cooked_key_in_fifo()) { *result =3D fifo_pull(sp); + /* + * Get the ERR from queue -- it is from WINCH, + * so we should take it out, the "error" is handled. + */ + if (fifo_peek(sp) =3D=3D -1) + fifo_pull(sp); returnCode(*result >=3D KEY_MIN ? KEY_CODE_YES : OK); } } --=20 1.6.4.4 --+HP7ph2BbKc20aGI-- From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 16:07:57 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60A571065692; Fri, 23 Oct 2009 16:07:57 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id EF9878FC20; Fri, 23 Oct 2009 16:07:56 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id n9NG7sSS029357; Fri, 23 Oct 2009 12:07:54 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Fri, 23 Oct 2009 12:07:54 -0400 (EDT) Date: Fri, 23 Oct 2009 12:07:54 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Andrew Gallatin In-Reply-To: <4AE1D1D2.1090307@cs.duke.edu> Message-ID: References: <4AE0BBAB.3040807@cs.duke.edu> <4AE0C995.5060303@cs.duke.edu> <200910230802.49873.jhb@freebsd.org> <4AE1CE31.1090206@cs.duke.edu> <4AE1D1D2.1090307@cs.duke.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 16:07:57 -0000 On Fri, 23 Oct 2009, Andrew Gallatin wrote: > Daniel Eischen wrote: >> On Fri, 23 Oct 2009, Andrew Gallatin wrote: >> >>> It would be great if they were, but that discussion was 6 months >>> ago, and nothing seems to have happened. Plus we need to support >>> at least 7.X and probably 6, so any changes here might not even >>> help us. >>> >>> What is wrong with just using umtx directly? It seems to do >>> exactly what we need. >> >> Because you can't do anything more than use umtx directly, >> like check for mutex types and return appropriate error >> codes. Just look at other implementations - Solaris, >> Linux, all have their pthread_*_t as public structs. > > I'm not saying that having pthread*t public, and getting all > the features of real PTHREAD_PROCESS_SHARED would not be far > better in general. But in this case all we need is a lock around > a shared resource. Eg, nothing fance. So our choices seem to be > either: > > 1) use sysv semaphores (ick) > 2) use a hand rolled spinlock (ick) > 3) use some sort of hack built into our driver (ick, ick) > 4) use umtx > > Is there some bug or limitation in umtx that makes it inappropriate? > (beyond the obvious, like the potential to leave a resource locked > forever if the lock holder exits). We already use umtx. This really is a hack and I wouldn't advocate it. I'm not sure how you could make it work and not break existing ability to return appropriate error codes without slowing down the path in the non-shared case. You'd have to check to see if the address space was shared or not, which would require a system call. All our public pthread_foo() symbols are weak. You can easily override them in your application code in the #ifdef freebsd case. What is wrong with providing your own library that overrides them to do what you require - this shouldn't change your application code? -- DE From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 16:27:50 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E16F9106566C; Fri, 23 Oct 2009 16:27:50 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 908C58FC0C; Fri, 23 Oct 2009 16:27:50 +0000 (UTC) Received: from [172.31.193.10] (cpe-069-134-110-200.nc.res.rr.com [69.134.110.200]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id n9NGRnAZ027732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Oct 2009 12:27:49 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu n9NGRnAZ027732 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1256315269; bh=knWqu7OFIT2xJ+9wLfLxbkmRoBj+Bh5p4pNm56tudXE=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=PsgKzK2WJCNttZj5c3iKjZj+lKUJf2RxDOEWknhI2cS1mycRHmHkzWO46Oi7BgCb6 6AG/FrN2asvWuxR9xIgkoW4nDs/oHeMWcSiJj9xrACalgPk69VsQIc79o6JK7jkG+u XV4QZ8VrrRJm9b3Yhgrt/JaYr3QJNB5ZVys8Xksw= Message-ID: <4AE1D97F.6060708@cs.duke.edu> Date: Fri, 23 Oct 2009 12:27:43 -0400 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Daniel Eischen References: <4AE0BBAB.3040807@cs.duke.edu> <4AE0C995.5060303@cs.duke.edu> <200910230802.49873.jhb@freebsd.org> <4AE1CE31.1090206@cs.duke.edu> <4AE1D1D2.1090307@cs.duke.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 16:27:51 -0000 Daniel Eischen wrote: > > We already use umtx. This really is a hack and I wouldn't > advocate it. I'm not sure how you could make it work and > not break existing ability to return appropriate error > codes without slowing down the path in the non-shared > case. You'd have to check to see if the address space > was shared or not, which would require a system call. I'm probably missing something. What does it matter if the address space is shared, as long as the umtx struct is in shared memory? From my quick read, the umtx operations use a lock word in userspace. For uncontested locks, they use atomic ops to flip an id into the lock word. The kernel takes over for contested locks, and does sleeping, wakup, etc. Is this correct? Is there something here that matters if the address space (and not just the lock word) is shared? > All our public pthread_foo() symbols are weak. You > can easily override them in your application code in > the #ifdef freebsd case. What is wrong with providing > your own library that overrides them to do what you > require - this shouldn't change your application code? > For our code, I was thinking of something like: #ifdef FreeBSD #define lock(x) umtx_lock(x, getpid()) #define unlock(x) umtx_unlock(x, getpid()) #else #define lock(x) pthread_mutex_lock(x) #define unlock(x) pthread_mutex_lock(x) #endif I should probably just shut up and try it.. Drew From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 16:32:41 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 954C61065670 for ; Fri, 23 Oct 2009 16:32:41 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay2.uni-muenster.de (ZIVM-EXRELAY2.UNI-MUENSTER.DE [128.176.192.15]) by mx1.freebsd.org (Postfix) with ESMTP id E661F8FC16 for ; Fri, 23 Oct 2009 16:32:39 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,613,1249250400"; d="scan'208";a="227055604" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER03.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 23 Oct 2009 18:32:38 +0200 Received: by ZIVMAILUSER03.UNI-MUENSTER.DE (Postfix, from userid 149459) id 7C66D1B0750; Fri, 23 Oct 2009 18:32:38 +0200 (CEST) Date: Fri, 23 Oct 2009 18:32:38 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: , Dag-Erling Sm??rgrav Message-ID: In-Reply-To: <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Antony Mawer , freebsd-hackers@freebsd.org, pluknet , ed@freebsd.org, rafan@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 16:32:41 -0000 Eygene Ryabinkin schrieb am 2009-10-23: > Gentlemen, good day. > Fri, Oct 23, 2009 at 02:02:38PM +0200, Dag-Erling Sm??rgrav wrote: > > src/contrib/ee/ee.c in 8: > > in = wgetch(text_win); > > if (in == -1) > > exit(0); /* without this exit ee will go > > into an > > infinite loop if the network > > session detaches */ > > >From the wgetch() man page: > > Programmers concerned about portability should be prepared > > for > > either of two cases: (a) signal receipt does not interrupt > > getch; (b) signal receipt interrupts getch and causes it to > > return ERR with errno set to EINTR. Under the ncurses > > implementation, handled signals never inter??? rupt getch. > Hmm, we can transform this code to the following one: > ----- > errno = 0; > do { > in = wgetch(text_win); > } while (errno == EINTR); > if (in == -1) > exit(0); > ----- > This won't help with FreeBSD's ncurses, but may be other variants > will feel much better with such a event loop variant. > > The real issue, though, is that when a SIGWINCH is caught, wgetch() > > correctly returns KEY_RESIZE, but the next call to wgetch() returns > > -1. > > The next call after that is fine. I suspect the error lies > > somewhere > > inside kgetch() in contrib/ncurses/ncurses/base/lib_getch.c. > The problem should be healed with the attached patch. And you're > partly right: this is kgetch() that is returning ERR for the second > wgetch(), but kgetch() shouldn't be blamed for this -- _nc_wgetch() > should. At least in my opinion ;) > Any views on this? thanks a million. for me the patch works great. :) the sooner it gets committed the better. ;) since this problem is not limited to freebsd it would be nice if somebody could send the patch to the ncurses maintainers so all OSes using ncurses can profit from it. cheers. alex From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 17:01:10 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD5351065679; Fri, 23 Oct 2009 17:01:10 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 7A7498FC1A; Fri, 23 Oct 2009 17:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Date:From:To:Cc:Subject:Message-ID: Reply-To:References:MIME-Version:Content-Type:In-Reply-To: Sender; bh=ltB3KM38yJYd1d85Dw+b9GPs80bh+nqfMhro5nicEIM=; b=lZh8j 4Ii3DsxcU5EM4K2k93wZWKDNsXqgI8OGKE0oFvWkJKlK15RZkDyRL7eRfACt1pmy KLQSKbQMCJGThtivIf3k9whw+dTtd5X/JnmwFGAW15o8rnG+VI/WC/EDEd6cqfRW MZwiNS+FaZacuEsq7tEwQ9BSyii0GB9FaKuEMDruJc/gGMXnoMKNeSyT/Lv1fPbO sVQRT6fCE0NKl6pWyBqKmE9c3ZXYnxmSIpBcBqIrwA8TKxPCiQ7z/8Mlkf5bwThQ fr9hFHQ+70N+kyfXKQAD/RIQmsK2nIUg6Te7IUD4tS5jhBbSCuglfD1XejxoLkDm J6/Pko6wG6gAyhQMg== Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1N1NVk-000Off-AQ; Fri, 23 Oct 2009 21:01:08 +0400 Date: Fri, 23 Oct 2009 21:01:05 +0400 From: Eygene Ryabinkin To: Alexander Best Message-ID: References: <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: rea-fbsd@codelabs.ru Cc: freebsd-hackers@freebsd.org, pluknet , ed@freebsd.org, Antony Mawer , Dag-Erling Sm??rgrav , rafan@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rea-fbsd@codelabs.ru List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 17:01:10 -0000 Fri, Oct 23, 2009 at 06:32:38PM +0200, Alexander Best wrote: > thanks a million. for me the patch works great. :) You're welcome ;)) > the sooner it gets committed the better. ;) It may well break something else. I am not 100% sure that this patch is the proper thing -- curses code is a bit new to me, so I would say that the patch will need more thorough review from maintainers. > since this problem is not limited to freebsd it would be nice if > somebody could send the patch to the ncurses maintainers so all OSes > using ncurses can profit from it. Will also send this patch to bug-ncurses@gnu.org. -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ # From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 17:02:35 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5198010656A3; Fri, 23 Oct 2009 17:02:35 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay3.uni-muenster.de (ZIVM-EXRELAY3.UNI-MUENSTER.DE [128.176.192.20]) by mx1.freebsd.org (Postfix) with ESMTP id 757C58FC18; Fri, 23 Oct 2009 17:02:34 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,613,1249250400"; d="scan'208";a="16629731" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 23 Oct 2009 19:02:20 +0200 Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459) id 8B0DB1B07BD; Fri, 23 Oct 2009 19:02:20 +0200 (CEST) Date: Fri, 23 Oct 2009 19:02:20 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: , Dag-Erling Sm??rgrav Message-ID: In-Reply-To: <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Antony Mawer , freebsd-hackers@freebsd.org, pluknet , ed@freebsd.org, rafan@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 17:02:35 -0000 Eygene Ryabinkin schrieb am 2009-10-23: > Gentlemen, good day. > Fri, Oct 23, 2009 at 02:02:38PM +0200, Dag-Erling Sm??rgrav wrote: > > src/contrib/ee/ee.c in 8: > > in = wgetch(text_win); > > if (in == -1) > > exit(0); /* without this exit ee will go > > into an > > infinite loop if the network > > session detaches */ > > >From the wgetch() man page: > > Programmers concerned about portability should be prepared > > for > > either of two cases: (a) signal receipt does not interrupt > > getch; (b) signal receipt interrupts getch and causes it to > > return ERR with errno set to EINTR. Under the ncurses > > implementation, handled signals never inter??? rupt getch. > Hmm, we can transform this code to the following one: > ----- > errno = 0; > do { > in = wgetch(text_win); > } while (errno == EINTR); > if (in == -1) > exit(0); > ----- > This won't help with FreeBSD's ncurses, but may be other variants > will feel much better with such a event loop variant. > > The real issue, though, is that when a SIGWINCH is caught, wgetch() > > correctly returns KEY_RESIZE, but the next call to wgetch() returns > > -1. > > The next call after that is fine. I suspect the error lies > > somewhere > > inside kgetch() in contrib/ncurses/ncurses/base/lib_getch.c. > The problem should be healed with the attached patch. And you're > partly right: this is kgetch() that is returning ERR for the second > wgetch(), but kgetch() shouldn't be blamed for this -- _nc_wgetch() > should. At least in my opinion ;) > Any views on this? oh...and btw. the PR (http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/136223) hasn't been assigned to anyone yet. could the person who will be committing the patch please take care of that (maybe setting the PR to analysed->patched->closed? ;) would be great if this fix could make it into 8.0-RELEASE in time because it's quite nasty to lose all your editor data due to a SIGWINCH. cheers. alex From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 17:13:03 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CD1F1065695; Fri, 23 Oct 2009 17:13:03 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id C0F658FC0C; Fri, 23 Oct 2009 17:13:02 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 15A541CD0A; Fri, 23 Oct 2009 19:13:01 +0200 (CEST) Date: Fri, 23 Oct 2009 19:13:01 +0200 From: Ed Schouten To: Eygene Ryabinkin Message-ID: <20091023171301.GO1293@hoeg.nl> References: <86tyxqqpwh.fsf@ds4.des.no> <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ck22u5fw4m2k6hx2" Content-Disposition: inline In-Reply-To: <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org, pluknet , Antony Mawer , Alexander Best , Dag-Erling Sm??rgrav , rafan@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 17:13:03 -0000 --Ck22u5fw4m2k6hx2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Eygene Ryabinkin wrote: > The problem should be healed with the attached patch. Ah, thanks. I looked at this some time ago but I also discovered ncurses was to blame. I didn't have any time to look at it back then, so I obviously forgot. Have you sent it to Thomas Dickey as well? --=20 Ed Schouten WWW: http://80386.nl/ --Ck22u5fw4m2k6hx2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrh5BwACgkQ52SDGA2eCwXqdACdGi9kpHW7zSqEFun7l4iOdRHi bf8AnjlYnONdT3nAR+n38wpGJYWBJ3N3 =IvmB -----END PGP SIGNATURE----- --Ck22u5fw4m2k6hx2-- From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 17:18:05 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A46AE106566B; Fri, 23 Oct 2009 17:18:05 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 401DB8FC1A; Fri, 23 Oct 2009 17:18:04 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id n9NHI2TG008879; Fri, 23 Oct 2009 13:18:02 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Fri, 23 Oct 2009 13:18:03 -0400 (EDT) Date: Fri, 23 Oct 2009 13:18:02 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Andrew Gallatin In-Reply-To: <4AE1D97F.6060708@cs.duke.edu> Message-ID: References: <4AE0BBAB.3040807@cs.duke.edu> <4AE0C995.5060303@cs.duke.edu> <200910230802.49873.jhb@freebsd.org> <4AE1CE31.1090206@cs.duke.edu> <4AE1D1D2.1090307@cs.duke.edu> <4AE1D97F.6060708@cs.duke.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Christian Bell Subject: Re: semaphores between processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 17:18:05 -0000 On Fri, 23 Oct 2009, Andrew Gallatin wrote: > Daniel Eischen wrote: > >> >> We already use umtx. This really is a hack and I wouldn't >> advocate it. I'm not sure how you could make it work and >> not break existing ability to return appropriate error >> codes without slowing down the path in the non-shared >> case. You'd have to check to see if the address space >> was shared or not, which would require a system call. > > I'm probably missing something. What does it matter if the > address space is shared, as long as the umtx struct is > in shared memory? > > From my quick read, the umtx operations use a lock word > in userspace. For uncontested locks, they use atomic > ops to flip an id into the lock word. The kernel takes > over for contested locks, and does sleeping, wakup, etc. > Is this correct? Is there something here that matters > if the address space (and not just the lock word) is > shared? > >> All our public pthread_foo() symbols are weak. You >> can easily override them in your application code in >> the #ifdef freebsd case. What is wrong with providing >> your own library that overrides them to do what you >> require - this shouldn't change your application code? >> > > For our code, I was thinking of something like: > > #ifdef FreeBSD > #define lock(x) umtx_lock(x, getpid()) > #define unlock(x) umtx_unlock(x, getpid()) > #else > #define lock(x) pthread_mutex_lock(x) > #define unlock(x) pthread_mutex_lock(x) > #endif > > > I should probably just shut up and try it.. My apologies - I thought you were talking about changing our pthread_mutex_* functions in src/lib/... -- DE From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 23 21:05:08 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E049106566C for ; Fri, 23 Oct 2009 21:05:08 +0000 (UTC) (envelope-from lankfordandrew@charter.net) Received: from mta11.charter.net (mta11.charter.net [216.33.127.80]) by mx1.freebsd.org (Postfix) with ESMTP id 625048FC13 for ; Fri, 23 Oct 2009 21:05:08 +0000 (UTC) Received: from imp09 ([10.20.200.9]) by mta11.charter.net (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20091023210507.RBWA27604.mta11.charter.net@imp09>; Fri, 23 Oct 2009 17:05:07 -0400 Received: from [192.168.1.100] ([75.138.208.143]) by imp09 with smtp.charter.net id wM571c00936AQff05M57tp; Fri, 23 Oct 2009 17:05:07 -0400 X-Authority-Analysis: v=1.0 c=1 a=WVgjoMXwEjcA:10 a=hOpmn2quAAAA:8 a=FnIUHYMPAAAA:8 a=6I5d2MoRAAAA:8 a=O7HqlGkfHIU9JavBgTkA:9 a=6jSDhN38MaCQRkFw4twA:7 a=-mBB8pPDUbyt7AiLqjNzbulPiGAA:4 a=hUswqBWy9Q8A:10 a=TG6KZ68mZ_cA:10 a=SV7veod9ZcQA:10 Message-ID: <4AE21A83.2030809@charter.net> Date: Fri, 23 Oct 2009 17:05:07 -0400 From: Andrew Lankford User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Yuri , freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 23 Oct 2009 21:23:03 +0000 Cc: Subject: [Fwd: Failure to boot from HD formatted not by FreeBSD] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 21:05:08 -0000 I mentioned that I've set up my laptop to boot using the Windows Vista boot menu. I have, and I needed to copy /boot/boot1 from 7-stable to my NTFS partition in order to successfully boot to my FreeBSD 8.0 partition. Last night, I tried replacing the 7-stable boot1 block with a version from 8.0-RC1, and now it doesn't successfully boot. I gather from the 8.0 release notes that there have been some changes to some part of the boot code. In any case, I can boot via the Windows boot menu with the help of 7-stable's /boot/boot1 file. Hoping that helps .... Andrew Lankford -------- Original Message -------- From: - Thu Oct 22 20:54:06 2009 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00800000 X-Mozilla-Keys: Message-ID: <4AE0FEA5.9070004@charter.net> Date: Thu, 22 Oct 2009 20:53:57 -0400 From: Andrew Lankford User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Yuri , freebsd-hackers@freebsd.org Subject: Failure to boot from HD formatted not by FreeBSD Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bi Looks to me like you're trying to get your computer to dual-boot Vista and FreeBSD 8.0, something I finally succeeded in doing. If by "MBR" you mean the first-stage boot program (512 bytes), I couldn't get that to work, nor could I use the standard boot0 menu from FreeBSD. I'm using the windows boot program instead. I think what I did was copy "/boot/boot1" from my root partition to my NTFS partition and then added an option to the Windows boot menu to boot with it. I get the GEOM "track boundary" complaint when I boot up as well. The FBSD 8.0 kernel has a new option 'GEOM_PART_MBR" on by default. Vista insisted on partitioning my drive, so if the new partition handler doesn't like it, it can lump it. In order to get the 8.0 kernel to recognise your old partitions, you need the "GEOM_MBR" option activated. That means you need to load "geom_mbr.ko" into memory before you load and boot from the 8.0 kernel. If you're booting from a FreeBSD 8.0 CD directly into sysinstall, you can escape to a shell and kldload geom_mbr.ko, but you have to then restart sysinstall without rebooting the computer in order for your hard disk partitions to show up. The only reliable way I could find to restart systinstall without rebooting was by pressing the power button. Wierd, eh? I added "option GEOM_MBR" back into my kernel, recompiled, fiddled with my network settings, and now everything seems to work alright. Anyway, all this procedure should be 75% correct since I've managed to successfully upgrade to 8.0 from 7-stable this way. For all I know, I might end up with a corrupted partition six months from now. Either that or Marcel Moolenar will get angry at me. Regards, Andrew Lankford From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 24 04:04:16 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE510106568B; Sat, 24 Oct 2009 04:04:16 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 9DDA28FC18; Sat, 24 Oct 2009 04:04:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Date:From:To:Cc:Subject:Message-ID: Reply-To:References:MIME-Version:Content-Type:In-Reply-To: Sender; bh=0n80iOz2NIr7NxZaGY7jR+bnTPC8IjqBz1RFG3gUKQk=; b=eL8TF GoYvHClT875RHk0vMTwmhE0arEjauvDO00oClRZCP/+lLs9tzxH5wNx/R7YySvcH MU1nnHEaVYt0fe3zDhyNiT9ycyR61HGNju1AnDQbICL7dkd33El691n+OXbNcP6i k861WW7Wp3d/lETpUAp+usB1KBk+tNMrl+lGbAntLV5WG9quZ3Yvoi4I7XnZTZVU 3vNGLyA5g5BWgFEf68Jxu/AuPXmDFqONCS3nSiI/rL7Bl2VUfQgWIy88swr9MQLG oWqioUXOFW3e0G/4PoQQlncd7DJOMV2Ch6VwqZZ6Vc9+NZTg9BcKP4laiF2cxOac Ap+wLDrkbnnM/EPBA== Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1N1XrP-000Kys-9Y; Sat, 24 Oct 2009 08:04:11 +0400 Date: Sat, 24 Oct 2009 08:04:08 +0400 From: Eygene Ryabinkin To: Ed Schouten Message-ID: References: <86tyxqqpwh.fsf@ds4.des.no> <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> <20091023171301.GO1293@hoeg.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091023171301.GO1293@hoeg.nl> Sender: rea-fbsd@codelabs.ru Cc: freebsd-hackers@freebsd.org, pluknet , Antony Mawer , Alexander Best , Dag-Erling Sm??rgrav , rafan@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rea-fbsd@codelabs.ru List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2009 04:04:17 -0000 Ed, good day. Fri, Oct 23, 2009 at 07:13:01PM +0200, Ed Schouten wrote: > Have you sent it to Thomas Dickey as well? Sent the patch to bug-ncurses@gnu.org. Do you think that I should send it to Thomas directly as well? -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ # From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 24 08:08:49 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DA5F106566C; Sat, 24 Oct 2009 08:08:49 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id B13CD8FC0C; Sat, 24 Oct 2009 08:08:48 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id C23251CD0A; Sat, 24 Oct 2009 10:08:45 +0200 (CEST) Date: Sat, 24 Oct 2009 10:08:45 +0200 From: Ed Schouten To: Eygene Ryabinkin Message-ID: <20091024080845.GP1293@hoeg.nl> References: <86tyxqqpwh.fsf@ds4.des.no> <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> <20091023171301.GO1293@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gQt10JDuGyDb0HQ5" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org, pluknet , Antony Mawer , Alexander Best , Dag-Erling Sm??rgrav , rafan@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2009 08:08:49 -0000 --gQt10JDuGyDb0HQ5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hy Eygene, * Eygene Ryabinkin wrote: > Sent the patch to bug-ncurses@gnu.org. Do you think that I should > send it to Thomas directly as well? Probably not. bug-ncurses@ should be good enough. Thanks! --=20 Ed Schouten WWW: http://80386.nl/ --gQt10JDuGyDb0HQ5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkritg0ACgkQ52SDGA2eCwUlMgCePcDP7uZ31hGD5Q/yGMnXsNOu eBwAnRqONvXeukMxI0m2Pqp1Q+AOnuYb =Vcjs -----END PGP SIGNATURE----- --gQt10JDuGyDb0HQ5-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 24 12:04:36 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22BBA106566C for ; Sat, 24 Oct 2009 12:04:36 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id D4F1D8FC17 for ; Sat, 24 Oct 2009 12:04:35 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C622135A821; Sat, 24 Oct 2009 14:04:34 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id B22CD228BE; Sat, 24 Oct 2009 14:04:34 +0200 (CEST) Date: Sat, 24 Oct 2009 14:04:34 +0200 From: Jilles Tjoelker To: Eygene Ryabinkin Message-ID: <20091024120434.GA27808@stack.nl> References: <86tyxqqpwh.fsf@ds4.des.no> <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2009 12:04:36 -0000 On Fri, Oct 23, 2009 at 07:56:35PM +0400, Eygene Ryabinkin wrote: > Hmm, we can transform this code to the following one: > ----- > errno = 0; > do { > in = wgetch(text_win); > } while (errno == EINTR); > if (in == -1) > exit(0); > ----- > This won't help with FreeBSD's ncurses, but may be other variants > will feel much better with such a event loop variant. That should be: ----- do in = wgetch(text_win); while (in == -1 && errno == EINTR); if (in == -1) exit(0); ----- errno should only be checked after failed function calls or for functions where it is documented that errno should be used to check for error conditions (example: readdir). -- Jilles Tjoelker From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 24 15:44:07 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08BDD106566B for ; Sat, 24 Oct 2009 15:44:07 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id AF39F8FC18 for ; Sat, 24 Oct 2009 15:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Date:From:To:Cc:Subject:Message-ID: Reply-To:References:MIME-Version:Content-Type:In-Reply-To: Sender; bh=cNPkMz6sZ0DmifhpTKnnUSfUD+43Xk6M1sypsbl9HS4=; b=iVJLk yZb7mGgLBI9Z428dRWFognlYl1RnHz9UW2kfnj6TYKTiaryu1j6QFE79BN6nXEts 2wC4FLo3/BSwfO4h8YskCJD2t4fcBS3Fte+16SgPpU79M1nXSC2++W5Ln+YZuzJa gX5Xd41fndM615xsyYEQkZJHaStXe5Z7CT0TKe7foonjEBLSvERSrzpHXJE3kI4/ SdEyI+9rE1BT1Sq57uVysLgMAIs3YjfZg1qZasYm6vbnlL06iA4cCOpescjrHdoe yWKYaL/MITTK1pLCO2k3YK5P9AJn7nx90cAvw/Uqpe3P8/QTlD+SLAXpOeW/B2TH uTlMLcAvzwWb1khtw== Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1N1imj-000M4Y-5R; Sat, 24 Oct 2009 19:44:05 +0400 Date: Sat, 24 Oct 2009 19:44:03 +0400 From: Eygene Ryabinkin To: Jilles Tjoelker Message-ID: References: <86tyxqqpwh.fsf@ds4.des.no> <8gJJDa6kRsCUwxK/zidtHIOFMRw@LbQSLh99U4wa807TkC1GazBU7WI> <20091024120434.GA27808@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091024120434.GA27808@stack.nl> Sender: rea-fbsd@codelabs.ru Cc: freebsd-hackers@freebsd.org Subject: Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rea-fbsd@codelabs.ru List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2009 15:44:07 -0000 Sat, Oct 24, 2009 at 02:04:34PM +0200, Jilles Tjoelker wrote: > That should be: > ----- > do > in = wgetch(text_win); > while (in == -1 && errno == EINTR); > if (in == -1) > exit(0); > ----- > > errno should only be checked after failed function calls or for > functions where it is documented that errno should be used to check for > error conditions (example: readdir). True, thanks for correction! -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ #