From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 4 02:55: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 034041065672 for ; Sun, 4 Oct 2009 02:55:47 +0000 (UTC) (envelope-from prvs=1528b9544c=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id 8F0898FC0A for ; Sun, 4 Oct 2009 02:55:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=multiplay.co.uk; s=Multiplay; t=1254624311; x=1255229111; q=dns/txt; h=Received: Message-ID:From:To:Subject:Date:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=fyDtY432WY+nJHAPdhezMdA5GaA3o2x+sr 2TgRFl1sM=; b=Php5pQi0+mQqKJfipNzmeXSc1gyAfhaeb++ORzJ4IfS/jXlEhD GRidHwtBTC9yCRPLIEoQN5AjN9a1uRuc4gcuF3LMPAxiaeKX0bYfhOy2OjNtOOnG NUN2Sdxa39fBML5E88hZhtTH0BzcFe2dDXMtNoe9YDtJUAD8BX0bdidLE= X-MDAV-Processed: mail1.multiplay.co.uk, Sun, 04 Oct 2009 03:45:11 +0100 Received: from r2d2 by mail1.multiplay.co.uk (MDaemon PRO v10.0.4) with ESMTP id md50008321175.msg for ; Sun, 04 Oct 2009 03:45:11 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Sun, 04 Oct 2009 03:45:11 +0100 (not processed: message from trusted or authenticated source) X-Authenticated-Sender: Killing@multiplay.co.uk X-MDRemoteIP: 213.123.247.160 X-Return-Path: prvs=1528b9544c=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-hackers@freebsd.org Message-ID: <01693A2B7EE64DA78F373BC113A9CF92@multiplay.co.uk> From: "Steven Hartland" To: Date: Sun, 4 Oct 2009 03:45:07 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Subject: How to prevent 64bit library paths being searched for 32bit binaries on amd64? 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, 04 Oct 2009 02:55:47 -0000 I've just been trying to get a 32bit binary to work on amd64 7.0-RELEASE, the binary had some qt4 dependencies so I set about copying these into /usr/local/lib32 but it seems that for some reason /usr/local/lib is searched first which obviously causes problems when here is a 64bit library of the same name. /etc/rc.d/ldconfig start shows:- ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg /usr/local/lib/mysql /usr/local/lib/pth 32-bit compatibility ldconfig path: /usr/lib32 /usr/local/lib32 /usr/local/lib32/mysql /usr/local/lib32/qt4 LD_LIBARY_PATH isn't set So the question is why is /usr/local/lib searched for a 32bit binary? Is it possible the binary itself is setting it and if so how to I override it? Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 4 08:35: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 A50E8106566B for ; Sun, 4 Oct 2009 08:35:21 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id F0D758FC0C for ; Sun, 4 Oct 2009 08:35:20 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 119215C025 for ; Sun, 4 Oct 2009 16:35:19 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 41F9855CE383; Sun, 4 Oct 2009 16:35:18 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id y6EWjxQM4jJC; Sun, 4 Oct 2009 16:35:11 +0800 (CST) Received: from charlie.delphij.net (c-69-181-136-105.hsd1.ca.comcast.net [69.181.136.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id E992C55CE379; Sun, 4 Oct 2009 16:35:09 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=poz8Z36Y05Zqgpv574g0AFFoPpG/ymAS8BECtxEaoIeVE8tIBjXiKG7qgisqywNVr jv+kF5cp7XaaWul1N5pRQ== Message-ID: <4AC85E3B.4040906@delphij.net> Date: Sun, 04 Oct 2009 01:35:07 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: Daniel O'Connor References: <20091002201039.GA53034@flint.openpave.org> <20091003081335.GA19914@marx.net.bit> <200910032357.02207.doconnor@gsoft.com.au> In-Reply-To: <200910032357.02207.doconnor@gsoft.com.au> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: jruohonen@iki.fi, freebsd-hackers@freebsd.org, krad Subject: Re: Distributed SSH attack X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2009 08:35:21 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Daniel O'Connor wrote: > On Sat, 3 Oct 2009, krad wrote: >> simplest this to do is disable password auth, and use key based. > > Your logs are still full of crap though. > > I find sshguard works well, and I am fairly sure you couldn't spoof a > valid TCP connection through pf sanitising so it would be difficult > (nigh-impossible?) for someone to cause you to block a legit IP. > > If you can, changing the port sshd runs on is by far the simplest work > around. Galling as it is to have to change stuff to work around > malicious assholes.. Believe it or not, I find this pf.conf rule very effective to mitigate this type of distributed SSH botnet attack: block in quick proto tcp from any os "Linux" to any port ssh Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkrIXjsACgkQi+vbBBjt66DjhACeOJTIYbDuvAjIgYDrQ41aJcw8 +lsAoJhoUOoSL1k4Y/n/UDwqZNSUxId2 =wdkL -----END PGP SIGNATURE----- From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 4 14:44:59 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 CDECE1065670; Sun, 4 Oct 2009 14:44:58 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from services.rulez.sk (services.rulez.sk [92.240.234.125]) by mx1.freebsd.org (Postfix) with ESMTP id 87BB28FC1C; Sun, 4 Oct 2009 14:44:58 +0000 (UTC) Received: from localhost (services.rulez.sk [92.240.234.125]) by services.rulez.sk (Postfix) with ESMTP id C2CBB13345FC; Sun, 4 Oct 2009 16:44:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at rulez.sk Received: from services.rulez.sk ([92.240.234.125]) by localhost (services.rulez.sk [92.240.234.125]) (amavisd-new, port 10024) with ESMTP id 3KtaBh01K0EX; Sun, 4 Oct 2009 16:44:56 +0200 (CEST) Received: from [10.50.0.2] (danger.mcrn.sk [84.16.37.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: danger@rulez.sk) by services.rulez.sk (Postfix) with ESMTPSA id DB194133453E; Sun, 4 Oct 2009 16:44:56 +0200 (CEST) Message-ID: <4AC8B4E8.7080106@FreeBSD.org> Date: Sun, 04 Oct 2009 16:44:56 +0200 From: Daniel Gerzo Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: current@freebsd.org, hackers@freebsd.org Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: [Fwd: HEADSUP: Call for FreeBSD Status Reports] 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, 04 Oct 2009 14:44:59 -0000 Hello guys, I would like to remind you about the FreeBSD Status Reports. The deadline is set to October 7th, and to date I have received only 5 reports, which is very little (considering the fact we are now covering almost 6 months). If you think you have anything to share with the community through the status report entry, please email us at monthly@freebsd.org as soon as possible. It really doesn't have to be a whole article, just a few lines about what you are working on. Thank you! -------- Original Message -------- Subject: HEADSUP: Call for FreeBSD Status Reports Date: Thu, 24 Sep 2009 17:07:29 +0200 From: Daniel Gerzo Organization: The FreeBSD Project To: current@freebsd.org, hackers@freebsd.org, stable@freebsd.org Dear all, I would like to remind you to submit your status reports as soon as possible. Long time has passed since the last status reports were released; and surely a lot has had happened since then. Our developers are relaxed after DevSummit and EuroBSDCon in Cambridge, which both were great! I believe a lot of stuff has been discussed during these events (I hope we will have reports covering this too) and since the last report a lot of things have happened. During that time, two other conferences have been held (BSDCan and AsiaBSDCon), we have released 7.2, not to mention that 8.0 is behind the door. Google Summer of Code should be finished by now too, and we would like to hear about its results. Surely there are a lot more projects which are currently being worked on, so please do not hesitate and write us a few lines - a short description about what you are working on, what are the plans and goals, so we can inform our community about your great work! It's useful for you as well as our users! Please note, the submissions for this quarter (well...rather halfyear, because we should now cover 4-9/2009) are due by October 7th, 2009. Please post the filled-in XML template to be found at http://www.freebsd.org/news/status/report-sample.xml to monthly@FreeBSD.org, or alternatively use our web based form at http://www.freebsd.org/cgi/monthly.cgi. We are looking forward to see your submissions! -- S pozdravom / Best regards Daniel Gerzo, FreeBSD committer From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 4 14:35:59 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 73300106566B for ; Sun, 4 Oct 2009 14:35:59 +0000 (UTC) (envelope-from "") Received: from mail.internationalconspiracy.org (mail.internationalconspiracy.org [85.234.142.62]) by mx1.freebsd.org (Postfix) with ESMTP id 338348FC0C for ; Sun, 4 Oct 2009 14:35:59 +0000 (UTC) Received: from localhost (mail.internationalconspiracy.org [85.234.142.62]) by mail.internationalconspiracy.org (Postfix) with SMTP id 4291E20206 for ; Sun, 4 Oct 2009 15:11:22 +0100 (BST) Received: from _HOSTNAME_ (syndicate.internationalconspiracy.org [IPv6:2002:55ea:8e40::55]) by mail.internationalconspiracy.org (Postfix) with SMTP id 7B78D201F4; Sun, 4 Oct 2009 15:11:18 +0100 (BST) Received: by _HOSTNAME_ (sSMTP sendmail emulation); Sun, 4 Oct 2009 15:11:18 +0100 Date: Sun, 4 Oct 2009 15:11:18 +0100 From: Alex Trull To: freebsd-rc@freebsd.org, freebsd-hackers@freebsd.org Message-ID: <20091004141118.GG95662@syndicate.internationalconspiracy.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lZZ4ablUVnt2XgAh" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-DSPAM-Result: Innocent X-DSPAM-Processed: Sun Oct 4 15:11:21 2009 X-DSPAM-Confidence: 0.9988 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 292,4ac8ad09526101998617228 X-Mailman-Approved-At: Sun, 04 Oct 2009 14:57:19 +0000 Cc: Subject: (Ab)using rcng's features to keep rc.d-style services running should they fail. 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, 04 Oct 2009 14:35:59 -0000 --lZZ4ablUVnt2XgAh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, I realised that because portupgrade/portmaster don't always=20 cleanly restart processes that have died due to being=20 upgraded (mysqld, often!) that this was something I wanted=20 to fix. However, I'd seen the daemontools and wasn't a fan - too=20 much to configure with weird directories and so forth and=20 while monit is very powerful it also takes too much effort=20 to do what could be so much simpler. So why not just (ab)use the rcng system with a script ? the=20 functionality is all there already to do almost everything=20 needed. To check whether something is running and (if not!)=20 start it. So this is my dirty hack so far - runs out of cron with=20 "2>/dev/null" every few minutes and mails me about attempted=20 startups as they happen : #!/bin/sh # start things that should be running find /usr/local/etc/rc.d/ /etc/rc.d/ -type f | egrep -v '(newsyslog|devd|se= ndmail)' | awk '{print $0" status| grep \"is not running\" && "$0" start"}'= | sh Performance is not stunning, thankfuly my cpus are quite=20 idle. real 0m1.198s user 0m0.610s sys 0m0.877s (devd, newsyslog and sendmail are left out because their=20 scripts don't behave quite right.) Initialy I used it purely for the /usr/local/etc/rc.d but I=20 had a base ntpd die on me one evening so decided to throw in=20 /etc/rc.d/ too. This script has also caught a few other=20 failures in port-installed daemons in addition to the=20 ever-common mysqld-upgraded one. Of course it is relatively inefficient executing all those=20 scripts on a regular basis - but it works - has anyone=20 thought of cleaner/more efficient ways of doing this and=20 getting more out of the rcng framework ? Or simpler for that=20 matter. -- Alex --lZZ4ablUVnt2XgAh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEARECAAYFAkrIrQUACgkQey4m6/eWxTTE4ACfbtGSQRXQt/C/tSigVQ4eoXYI P4kAnA2CP6HV2kiU0YpdrgPeYTFUVUBN =6r53 -----END PGP SIGNATURE----- --lZZ4ablUVnt2XgAh-- From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 4 18:40: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 F29251065672 for ; Sun, 4 Oct 2009 18:40:40 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by mx1.freebsd.org (Postfix) with ESMTP id 815078FC14 for ; Sun, 4 Oct 2009 18:40:39 +0000 (UTC) Received: by bwz27 with SMTP id 27so1905395bwz.43 for ; Sun, 04 Oct 2009 11:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:subject:organization:from :date:message-id:user-agent:mime-version:content-type; bh=81IkPzkpLvPfla6mDeSdEp7ZsrHkQAy2SwjMkBI9z1k=; b=kn4SBUNSVJk7z3vJdBD3tbeD5+u5VaIZIFPDLSijjhqwLayodpfoMjq5Naii4zfihB 7SLW4cm5yv5C7aQ7xCxCXKzmU92iyUvyrcetP7vlWYI/2lUaYNHQPmBh4yqsaFQR5HeN kv/6b2y4RKvb6tdFKc19CxwSjkCU/VWFsPDpo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:subject:organization:from:date:message-id:user-agent :mime-version:content-type; b=dnmxVIX+FtuC28A4ELtpKBWkw+j7WM+1DO9a9hULuRoTk288eUCcIG0HqVUz7Ie5Q1 tqjYhIEHUj0P9b5FunVzDYpwAGl0ooOdG+B4PAYy3I5nIgnzUiYVJ39AWHvwXRO1abD3 nEJLPoUWRkMBqnOPOGuyuHyIKWZCwHrwuGJHo= Received: by 10.204.3.207 with SMTP id 15mr3283728bko.106.1254681639091; Sun, 04 Oct 2009 11:40:39 -0700 (PDT) Received: from localhost ([95.69.165.162]) by mx.google.com with ESMTPS id 18sm2661763fks.10.2009.10.04.11.40.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 04 Oct 2009 11:40:38 -0700 (PDT) To: freebsd-hackers@freebsd.org Organization: TOA Ukraine From: Mikolaj Golub Date: Sun, 04 Oct 2009 21:40:34 +0300 Message-ID: <86pr9380kd.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 Subject: 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, 04 Oct 2009 18:40:41 -0000 Hi, http://trociny.googlecode.com/files/crashtar This simple script is useful for me and might be useful for other people too. The script creates tar archive that contains all files needed for debugging FreeBSD kernel crash (vmcore, kernel, loaded modules, sources that appear in backtrace). This is useful e.g. for debugging a crash on another host, sending it to developers or if you are going to upgrade the kernel on crashed host but would like to keep crashdump in case the developers ask you to provide additional info. Created tar contains also a script that when being run inside unpacked archive will give kgdb(1) session with crash core loaded in it. The script should be run with root privileges because it does chroot(8) before starting kgdb(1). I think I don't have to warn here that a crashdump may be sent only to person you trust :-). -- Mikolaj Golub From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 4 19:16: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 BFE9C1065670 for ; Sun, 4 Oct 2009 19:16:22 +0000 (UTC) (envelope-from brampton@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 4E63B8FC0A for ; Sun, 4 Oct 2009 19:16:21 +0000 (UTC) Received: by ewy5 with SMTP id 5so1590062ewy.36 for ; Sun, 04 Oct 2009 12:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=iaZiuPNlgR5nyZ4M/0krdEHSdi79+fxsLMLO19HQlBs=; b=HNOjoVYDH0PIVOuiGWxjJNdNmc4Mwd13m4Q/Nf1c5Jm0Fqp9HVYgK1qqvh1Sn85d2v Fjex2mo2fVBoggCvDKRUeD/d1Kl5LfZl0eo2pdsPefpphjn/vXO6wBtCDytdRrhCoqTB W7ntgNXnGK9Zn2GHA0cPsQ04jbCWWOK7WYCZ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=swlcUscwGkO/mhLVmQLkb4VV/SdKzT7c0KCeT+D+I+YShSHoB5lPU963NShGBQkR6m FRSKkai2mM1YyyaMx5SyaeoB6GejsJ7T95dDpWQkU7d+uzhIPUQcKojw9BWMjeN5zr+g kAdsRKb9ixardDRGF0XPG18dGGH4OF+B6/52E= MIME-Version: 1.0 Sender: brampton@gmail.com Received: by 10.216.30.4 with SMTP id j4mr886677wea.16.1254683781181; Sun, 04 Oct 2009 12:16:21 -0700 (PDT) Date: Sun, 4 Oct 2009 20:16:21 +0100 X-Google-Sender-Auth: 6d9ff61ba5abec75 Message-ID: From: Andrew Brampton To: freebsd-hackers@freebsd.org Content-Type: multipart/mixed; boundary=0016e6dd9669153090047520d5d8 Subject: Make top display thread IDs 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, 04 Oct 2009 19:16:22 -0000 --0016e6dd9669153090047520d5d8 Content-Type: text/plain; charset=UTF-8 Hello, I was using "top -H" to display all the different threads on my system. I then wanted to use cpuset to pin a thread to a particular core, however, I couldn't find the thread ID. So I've hacked top to display thread IDs. Hopefully this patch is useful to something, and perhaps it should be included with FreeBSD. I'd be grateful for any feedback or suggestions. thanks Andrew --0016e6dd9669153090047520d5d8 Content-Type: text/plain; charset=US-ASCII; name="freebsd-top-tid.patch.txt" Content-Disposition: attachment; filename="freebsd-top-tid.patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g0e6atdy0 SW5kZXg6IHVzci5iaW4vdG9wL21hY2hpbmUuYw0KPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KLS0tIHVzci5iaW4vdG9w L21hY2hpbmUuYwkocmV2aXNpb24gMTk3NjExKQ0KKysrIHVzci5iaW4vdG9wL21hY2hpbmUuYwko d29ya2luZyBjb3B5KQ0KQEAgLTEwOCwxOCArMTA4LDE4IEBADQogc3RhdGljIGNoYXIgc21wX2hl YWRlcl90aHJbXSA9DQogICAgICIgIFBJRCVzICUtKi4qcyAgVEhSIFBSSSBOSUNFICAgU0laRSAg ICBSRVMgU1RBVEUgICBDICAgVElNRSAlNnMgQ09NTUFORCI7DQogc3RhdGljIGNoYXIgc21wX2hl YWRlcltdID0NCi0gICAgIiAgUElEJXMgJS0qLipzICIgICAiUFJJIE5JQ0UgICBTSVpFICAgIFJF UyBTVEFURSAgIEMgICBUSU1FICU2cyBDT01NQU5EIjsNCisgICAgIiAgUElEICAgIFRJRCVzICUt Ki4qcyBQUkkgTklDRSAgIFNJWkUgICAgUkVTIFNUQVRFICAgQyAgIFRJTUUgJTZzIENPTU1BTkQi Ow0KIA0KICNkZWZpbmUgc21wX1Byb2NfZm9ybWF0IFwNCi0gICAgIiU1ZCVzICUtKi4qcyAlcyUz ZCAlNHMlN3MgJTZzICUtNi42cyAlMmQlN3MgJTUuMmYlJSAlLipzIg0KKyAgICAiJTVkJXMlcyAl LSouKnMgJXMlM2QgJTRzJTdzICU2cyAlLTYuNnMgJTJkJTdzICU1LjJmJSUgJS4qcyINCiANCiBz dGF0aWMgY2hhciB1cF9oZWFkZXJfdGhyW10gPQ0KICAgICAiICBQSUQlcyAlLSouKnMgIFRIUiBQ UkkgTklDRSAgIFNJWkUgICAgUkVTIFNUQVRFICAgIFRJTUUgJTZzIENPTU1BTkQiOw0KIHN0YXRp YyBjaGFyIHVwX2hlYWRlcltdID0NCi0gICAgIiAgUElEJXMgJS0qLipzICIgICAiUFJJIE5JQ0Ug ICBTSVpFICAgIFJFUyBTVEFURSAgICBUSU1FICU2cyBDT01NQU5EIjsNCisgICAgIiAgUElEICAg IFRJRCVzICUtKi4qcyBQUkkgTklDRSAgIFNJWkUgICAgUkVTIFNUQVRFICAgIFRJTUUgJTZzIENP TU1BTkQiOw0KIA0KICNkZWZpbmUgdXBfUHJvY19mb3JtYXQgXA0KLSAgICAiJTVkJXMgJS0qLipz ICVzJTNkICU0cyU3cyAlNnMgJS02LjZzJS4wZCU3cyAlNS4yZiUlICUuKnMiDQorICAgICIlNWQl cyVzICUtKi4qcyAlcyUzZCAlNHMlN3MgJTZzICUtNi42cyUuMGQlN3MgJTUuMmYlJSAlLipzIg0K IA0KIA0KIC8qIHByb2Nlc3Mgc3RhdGUgbmFtZXMgZm9yIHRoZSAiU1RBVEUiIGNvbHVtbiBvZiB0 aGUgZGlzcGxheSAqLw0KQEAgLTc1Nyw3ICs3NTcsNyBAQA0KIAlpbnQgc3RhdGU7DQogCXN0cnVj dCBydXNhZ2UgcnUsICpydXA7DQogCWxvbmcgcF90b3QsIHNfdG90Ow0KLQljaGFyICpwcm9jX2Zt dCwgdGhyX2J1Zls2XSwgamlkX2J1Zls2XTsNCisJY2hhciAqcHJvY19mbXQsIHRpZF9idWZbOF0s IHRocl9idWZbNl0sIGppZF9idWZbNl07DQogCWNoYXIgKmNtZGJ1ZiA9IE5VTEw7DQogCWNoYXIg KiphcmdzOw0KIA0KQEAgLTk0MiwxNCArOTQyLDE5IEBADQogDQogCS8qIGZvcm1hdCB0aGlzIGVu dHJ5ICovDQogCXByb2NfZm10ID0gc21wbW9kZSA/IHNtcF9Qcm9jX2Zvcm1hdCA6IHVwX1Byb2Nf Zm9ybWF0Ow0KLQlpZiAocHMudGhyZWFkICE9IDApDQorCWlmIChwcy50aHJlYWQpIHsNCiAJCXRo cl9idWZbMF0gPSAnXDAnOw0KLQllbHNlDQorCQlzbnByaW50Zih0aWRfYnVmLCBzaXplb2YodGlk X2J1ZiksICIlKmQiLA0KKwkJICAgIHNpemVvZih0aWRfYnVmKSAtIDEsIHBwLT5raV90aWQpOw0K Kwl9IGVsc2Ugew0KKwkJdGlkX2J1ZlswXSA9ICdcMCc7DQogCQlzbnByaW50Zih0aHJfYnVmLCBz aXplb2YodGhyX2J1ZiksICIlKmQgIiwNCiAJCSAgICBzaXplb2YodGhyX2J1ZikgLSAyLCBwcC0+ a2lfbnVtdGhyZWFkcyk7DQorCX0NCiANCiAJc3ByaW50ZihmbXQsIHByb2NfZm10LA0KIAkgICAg cHAtPmtpX3BpZCwNCisJICAgIHRpZF9idWYsDQogCSAgICBqaWRfYnVmLA0KIAkgICAgbmFtZWxl bmd0aCwgbmFtZWxlbmd0aCwgKCpnZXRfdXNlcmlkKShwcC0+a2lfcnVpZCksDQogCSAgICB0aHJf YnVmLA0K --0016e6dd9669153090047520d5d8-- From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 4 19:30: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 CE2331065679 for ; Sun, 4 Oct 2009 19:30:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 7B3228FC0C for ; Sun, 4 Oct 2009 19:30:57 +0000 (UTC) Received: (qmail 15085 invoked by uid 399); 4 Oct 2009 19:30:56 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 4 Oct 2009 19:30:56 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4AC8F7EF.9010303@FreeBSD.org> Date: Sun, 04 Oct 2009 12:30:55 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Alex Trull References: <20091004141118.GG95662@syndicate.internationalconspiracy.org> In-Reply-To: <20091004141118.GG95662@syndicate.internationalconspiracy.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-rc@freebsd.org Subject: Re: (Ab)using rcng's features to keep rc.d-style services running should they fail. 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, 04 Oct 2009 19:30:58 -0000 Alex Trull wrote: > Hi all, > > I realised that because portupgrade/portmaster don't always > cleanly restart processes that have died due to being > upgraded (mysqld, often!) that this was something I wanted > to fix. I can't speak to portupgrade, however for portmaster there is no such facility whatsoever. The admin is expected to disable things prior to an upgrade and re-enable them when the upgrade is done. I don't feel that this is an overwhelming burden. :) That said I have it in mind to add a facility to handle this feature. Stay tuned for more news about this. > So why not just (ab)use the rcng system with a script ? First, it's rc.d now if you please. Second, I don't think that there is anything wrong with your concept that would classify it as abuse, although I'm not sure I would have implemented it in quite the same way. > the > functionality is all there already to do almost everything > needed. To check whether something is running and (if not!) > start it. > > So this is my dirty hack so far - runs out of cron with > "2>/dev/null" every few minutes and mails me about attempted > startups as they happen : > > #!/bin/sh > # start things that should be running > find /usr/local/etc/rc.d/ /etc/rc.d/ -type f | egrep -v '(newsyslog|devd|sendmail)' | awk '{print $0" status| grep \"is not running\" && "$0" start"}' | sh There are a couple of "problems" with this, although please understand I'm not criticizing, I'm just offering what I hope are constructive suggestions. First, (and I consider this to be a bug) there are several scripts in /etc/rc.d that are not actually 'startup' scripts in the true sense. Therefore I would not attempt to run them all. Personally if I were going to do what you're doing I would make an explicit list of scripts I wanted to test for. If you are going to continue to use awk you might want to learn how to avoid piping it to grep, that's an extra subshell that you don't really need. Finally I would do something like this (untested): for service in ntpd mysqld foo bar; do if [ -x /usr/local/etc/rc.d/$service ]; then service=/usr/local/etc/rc.d/$service elif [ -x /etc/rc.d/$service ]; then service=/etc/rc.d/$service else echo "Cannot find $service in /etc/rc.d or /usr/local/etc/rc.d" exit 1 fi $service start | grep -v 'already running' done > (devd, newsyslog and sendmail are left out because their > scripts don't behave quite right.) I don't see anything wrong with devd's output from the status command, sendmail's is a little hard to parse because it's doing a lot of things in one script. newsyslog is spitting out 'not running' which arguably it should not do since that script is not for starting a persistent service, it's just a 'run at boot' thing. In any case, if you find what you think are bugs in rc.d related stuff feel free to report them to freebsd-rc@freebsd.org. hth, Doug -- This .signature sanitized for your protection From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 4 22:32: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 88A771065670 for ; Sun, 4 Oct 2009 22:32:20 +0000 (UTC) (envelope-from mlfbsd@kanar.ci0.org) Received: from kanar.ci0.org (kanar.ci0.org [88.191.50.96]) by mx1.freebsd.org (Postfix) with ESMTP id 0E61B8FC29 for ; Sun, 4 Oct 2009 22:32:19 +0000 (UTC) Received: from kanar.ci0.org (pluxor@localhost [127.0.0.1]) by kanar.ci0.org (8.14.2/8.14.3) with ESMTP id n94MYXiZ073459; Mon, 5 Oct 2009 00:34:33 +0200 (CEST) (envelope-from mlfbsd@kanar.ci0.org) Received: (from mlfbsd@localhost) by kanar.ci0.org (8.14.2/8.14.3/Submit) id n94MYXEb073458; Mon, 5 Oct 2009 00:34:33 +0200 (CEST) (envelope-from mlfbsd) Date: Mon, 5 Oct 2009 00:34:33 +0200 From: Olivier Houchard To: Tom Judge Message-ID: <20091004223433.GA73189@ci0.org> References: <4AC106AA.9000305@tomjudge.com> <20090928202132.GA15236@ci0.org> <4AC16B5A.8090407@tomjudge.com> <20090929093825.GA26424@ci0.org> <4AC21F44.6060004@tomjudge.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AC21F44.6060004@tomjudge.com> User-Agent: Mutt/1.4.2.1i X-Mailman-Approved-At: Mon, 05 Oct 2009 04:12:29 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: Help debugging: Fatal kernel mode data abort: 'External Linefetch Abort (P)' 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, 04 Oct 2009 22:32:20 -0000 > Hi Olivier, > > I have tried the patch and here are the boot results: > > > i80321: BAR0 = 20000004.00000000 BAR1 = 40000004.00000000 > i80219: BAR0 = 20000000.00000000 BAR1 = 40000000.00000000 > i80219: I/O Processor, acting as PCI host > i80321: SBDR = 0xa0000000 SBR0 = 0x00000018 SBR1 = 0x00000020 > i80321: BANK0 = 0x10000000 BANK1 = 0x10000000 > i80321: Reserve space for private devices (Inbound Window 1) > hi:0x00000000 lo:0x8000000c xlate:0x80000000 size:0x04000000 > i80321: RAM access (Inbound Window 2) > hi:0x00000000 lo:0xa000000c xlate:0xa0000000 size:0x20000000 > obio0 on iq0 > uart0: <16550 or compatible> on obio0 > uart0: [FILTER] > uart0: console (115200,n,8,1) > itimer0: on iq0 > iopwdog0: on iq0 > pcib0: on iq0 > pci0: on pcib0 > Device 1 routed to irq 27 > Device 2 routed to irq 30 > Device 3 routed to irq 29 > Device 5 routed to irq 30 > Device 5 routed to irq 29 > Device 5 routed to irq 27 > em0: port > 0xfe400000-0xfe40003f mem 0-0x1ffff,0x20000-0x3ffff irq 27 at device 1.0 > on pci0 > em0: Start: 0x00000000 > em0: End: 0x0001FFFF > em0: Size: 0x00020000 > Fatal kernel mode data abort: 'External Linefetch Abort (P)' > trapframe: 0xc00faad0 > FSR=00000406, FAR=Invalid, spsr=200000d3 > r0 =c00d0400, r1 =cd5bf000, r2 =00000010, r3 =0000000a > r4 =c317e008, r5 =cd5bf000, r6 =c00d0400, r7 =c130212c > r8 =c317e008, r9 =c0071180, r10=c317e000, r11=c00fab40 > r12=c00fab44, ssp=c00fab1c, slr=c106a96c, pc =c106a968 > > [thread pid 0 tid 100000 ] > Stopped at e1000_init_script_state_82541+0x24c: blx r7 > db> > > > > As you can see I added some debug to if_em.c as such: > > Index: sys/dev/e1000/if_em.c > =================================================================== > --- sys/dev/e1000/if_em.c (revision 197472) > +++ sys/dev/e1000/if_em.c (working copy) > @@ -2770,6 +2770,9 @@ > rman_get_bustag(adapter->memory); > adapter->osdep.mem_bus_space_handle = > rman_get_bushandle(adapter->memory); > + device_printf(dev,"Start: 0x%08lX\n", rman_get_start(adapter->memory)); > + device_printf(dev,"End: 0x%08lX\n", rman_get_end(adapter->memory)); > + device_printf(dev,"Size: 0x%08lX\n", rman_get_size(adapter->memory)); > adapter->hw.hw_addr = (u8 *)&adapter->osdep.mem_bus_space_handle; > > /* Only older adapters use IO mapping */ > > > But the memory mapping seems to be missing the most significant 0x8. > I fail to see how it happens. Could you printf the value of sc->sc_mem once set in i80321_pci_attach(), and if it appears to be 0, the value of i80321_softc->sc_owin[0].owin_xlate_lo at the different points it can be set ? Thanks a lot, Olivier From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 5 05:48: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 790E71065672 for ; Mon, 5 Oct 2009 05:48:11 +0000 (UTC) (envelope-from to.my.trociny@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 CCB4A8FC12 for ; Mon, 5 Oct 2009 05:48:10 +0000 (UTC) Received: by ewy5 with SMTP id 5so1852556ewy.36 for ; Sun, 04 Oct 2009 22:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:subject:organization:from :date:message-id:user-agent:mime-version:content-type; bh=9zbycC4dHRTXymNgQ56bT6o8zYpYIVaiEh7u2uNZucM=; b=p6z0oJmOc0UKPcFuyYWK5a+I8l9T8PWUFnQk6UQJB1TNAcNbpXOLGTzrabV9cQ4x3Z LVvEQzxHiG7lnNhUNMzuvdwA44zeYLr3OtaEV3Ogaa5WApOUsxJkzW8h8KJ8Y/k0Qr09 FgWBcSebldUZcp9CjRJSXcTKseLBdFNVumHZI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:subject:organization:from:date:message-id:user-agent :mime-version:content-type; b=bUDuRC/lOZdjQ9tnYzXnAd9aQpbmiSyAflKBSprhAjyQSoiYGmygp0S4aLIbx8LU7N L5z/y/mJ1PTryjzVG6WvFLwxYOWplkwTDz0ek5ZBaBBJ9NrMGS3Qbcjrbe4MVH2yVnPN U6xPXaMW2oZvglmKLHFFFvd2g1igQ6d+bu1gM= Received: by 10.211.157.7 with SMTP id j7mr6544702ebo.2.1254721689809; Sun, 04 Oct 2009 22:48:09 -0700 (PDT) Received: from localhost (ms.singlescrowd.net [80.85.90.67]) by mx.google.com with ESMTPS id 10sm1295952eyd.45.2009.10.04.22.48.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 04 Oct 2009 22:48:09 -0700 (PDT) To: freebsd-hackers@freebsd.org Organization: TOA Ukraine From: Mikolaj Golub Date: Mon, 05 Oct 2009 08:48:06 +0300 Message-ID: <81ws3a1je1.fsf@zhuzha.ua1> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: crashinfo: print the content of ddb capture budder 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, 05 Oct 2009 05:48:11 -0000 Hi, It would be nice if crashinfo(8) were also trying to output the content of ddb capture buffer. Something like in this patch: --- crashinfo.sh.orig 2009-10-05 08:26:26.000000000 +0300 +++ crashinfo.sh 2009-10-05 08:43:56.000000000 +0300 @@ -304,3 +304,18 @@ echo "kernel config" echo config -x $KERNEL + +file=`mktemp /tmp/crashinfo.XXXXXX` +if [ $? -eq 0 ]; then + ddb capture -M $VMCORE -N $KERNEL print > $file 2>/dev/null + if [ -s $file ]; then + echo "------------------------------------------------------------------------" + echo "ddb capture buffer" + echo + cat $file | + sed -e 's/p\{10\}p*//' # XXX: this removes the unfilled part of a capture buffer + echo + fi + rm -f $file +fi + -- Mikolaj Golub From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 5 13:48: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 292D9106566B for ; Mon, 5 Oct 2009 13:48:28 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from tomjudge.vm.bytemark.co.uk (tomjudge.vm.bytemark.co.uk [80.68.91.100]) by mx1.freebsd.org (Postfix) with ESMTP id DA9018FC18 for ; Mon, 5 Oct 2009 13:48:27 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 59C1948997; Mon, 5 Oct 2009 14:48:26 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at tomjudge.vm.bytemark.co.uk Received: from tomjudge.vm.bytemark.co.uk ([127.0.0.1]) by localhost (tomjudge.vm.bytemark.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g48Qk9v192rr; Mon, 5 Oct 2009 14:48:23 +0100 (BST) Received: from rita.nodomain (unknown [192.168.205.6]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id C346E48698; Mon, 5 Oct 2009 14:48:22 +0100 (BST) Message-ID: <4AC9F906.3040306@tomjudge.com> Date: Mon, 05 Oct 2009 13:47:50 +0000 From: Tom Judge User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Olivier Houchard References: <4AC106AA.9000305@tomjudge.com> <20090928202132.GA15236@ci0.org> <4AC16B5A.8090407@tomjudge.com> <20090929093825.GA26424@ci0.org> <4AC21F44.6060004@tomjudge.com> <20091004223433.GA73189@ci0.org> In-Reply-To: <20091004223433.GA73189@ci0.org> Content-Type: multipart/mixed; boundary="------------050000070909080403010604" Cc: freebsd-hackers@freebsd.org Subject: Re: Help debugging: Fatal kernel mode data abort: 'External Linefetch Abort (P)' 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, 05 Oct 2009 13:48:28 -0000 This is a multi-part message in MIME format. --------------050000070909080403010604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Olivier Houchard wrote: >> Hi Olivier, >> >> I have tried the patch and here are the boot results: >> >> >> > > I fail to see how it happens. > Could you printf the value of sc->sc_mem once set in i80321_pci_attach(), > and if it appears to be 0, the value of i80321_softc->sc_owin[0].owin_xlate_lo > at the different points it can be set ? > > Thanks a lot, > > Olivier > Hi Olivier, I have been working though this with Mark Tinguely and we came up with this patch that makes it work. Not sure on its correctness but it works. Tom --------------050000070909080403010604 Content-Type: text/plain; name="pci-1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pci-1.patch" Index: i80321_pci.c =================================================================== --- i80321_pci.c (revision 197735) +++ i80321_pci.c (working copy) @@ -92,8 +92,7 @@ sc->sc_busno = busno; sc->sc_pciio = &i80321_softc->sc_pci_iot; sc->sc_pcimem = &i80321_softc->sc_pci_memt; - sc->sc_mem = i80321_softc->sc_owin[0].owin_xlate_lo + - VERDE_OUT_XLATE_MEM_WIN_SIZE; + sc->sc_mem = i80321_softc->sc_owin[0].owin_xlate_lo; sc->sc_io = i80321_softc->sc_iow_vaddr; /* Initialize memory and i/o rmans. */ @@ -110,7 +109,8 @@ sc->sc_mem_rman.rm_descr = "I80321 PCI Memory"; if (rman_init(&sc->sc_mem_rman) != 0 || rman_manage_region(&sc->sc_mem_rman, - 0, VERDE_OUT_XLATE_MEM_WIN_SIZE) != 0) { + VERDE_OUT_XLATE_MEM_WIN0_BASE, + VERDE_OUT_XLATE_MEM_WIN0_BASE + VERDE_OUT_XLATE_MEM_WIN_SIZE) != 0) { panic("i80321_pci_probe: failed to set up memory rman"); } sc->sc_irq_rman.rm_type = RMAN_ARRAY; @@ -297,6 +297,9 @@ sc->sc_mem; start &= (0x1000000 - 1); end &= (0x1000000 - 1); + start += 0x80000000; + end += 0x80000000; + device_printf(child, "SYS_RES_MEMORY: start: 0x%08lX end: 0x%08lX\n",start,end); break; case SYS_RES_IOPORT: rm = &sc->sc_io_rman; @@ -312,12 +315,15 @@ } rv = rman_reserve_resource(rm, start, end, count, flags, child); + device_printf(child, "RMAN_RESERVE_RESOURCE: start: 0x%08lX end: 0x%08lX\n", + rman_get_start(rv), + rman_get_end(rv)); if (rv == NULL) return (NULL); rman_set_rid(rv, *rid); if (type != SYS_RES_IRQ) { if (type == SYS_RES_MEMORY) - bh += (rman_get_start(rv)); + bh = (rman_get_start(rv)); rman_set_bustag(rv, bt); rman_set_bushandle(rv, bh); if (flags & RF_ACTIVE) { --------------050000070909080403010604-- From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 5 13:53:42 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 C0F881065696; Mon, 5 Oct 2009 13:53:42 +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 68B088FC13; Mon, 5 Oct 2009 13:53:42 +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 1365346B39; Mon, 5 Oct 2009 09:53:42 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (localhost [IPv6:::1]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 7C5638A021; Mon, 5 Oct 2009 09:53:40 -0400 (EDT) Message-ID: <4AC9FA63.9020606@FreeBSD.org> Date: Mon, 05 Oct 2009 09:53:39 -0400 From: John Baldwin User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Attilio Rao References: <20090924224935.GW473@gandalf.sssup.it> <200909291953.36373.max@love2party.net> <3bbf2fe10909291342o4d32e381ge23e446582bb2d18@mail.gmail.com> <200909291731.32394.jhb@freebsd.org> <3bbf2fe10910031345n5ea54f40i1ca4dd6a1d42ff13@mail.gmail.com> In-Reply-To: <3bbf2fe10910031345n5ea54f40i1ca4dd6a1d42ff13@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 05 Oct 2009 09:53:41 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Max Laier , Fabio Checconi , freebsd-hackers@freebsd.org Subject: Re: sx locks and memory barriers 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, 05 Oct 2009 13:53:42 -0000 Attilio Rao wrote: > 2009/9/29 John Baldwin : >> On Tuesday 29 September 2009 4:42:13 pm Attilio Rao wrote: >>> 2009/9/29 Max Laier : >>>> On Tuesday 29 September 2009 17:39:37 Attilio Rao wrote: >>>>> 2009/9/25 Fabio Checconi : >>>>>> Hi all, >>>>>> looking at sys/sx.h I have some troubles understanding this comment: >>>>>> >>>>>> * A note about memory barriers. Exclusive locks need to use the same >>>>>> * memory barriers as mutexes: _acq when acquiring an exclusive lock >>>>>> * and _rel when releasing an exclusive lock. On the other side, >>>>>> * shared lock needs to use an _acq barrier when acquiring the lock >>>>>> * but, since they don't update any locked data, no memory barrier is >>>>>> * needed when releasing a shared lock. >>>>>> >>>>>> In particular, I'm not understanding what prevents the following sequence >>>>>> from happening: >>>>>> >>>>>> CPU A CPU B >>>>>> >>>>>> sx_slock(&data->lock); >>>>>> >>>>>> sx_sunlock(&data->lock); >>>>>> >>>>>> /* reordered after the unlock >>>>>> by the cpu */ >>>>>> if (data->buffer) >>>>>> sx_xlock(&data->lock); >>>>>> free(data->buffer); >>>>>> data->buffer = NULL; >>>>>> sx_xunlock(&data->lock); >>>>>> >>>>>> a = *data->buffer; >>>>>> >>>>>> IOW, even if readers do not modify the data protected by the lock, >>>>>> without a release barrier a memory access may leak past the unlock (as >>>>>> the cpu won't notice any dependency between the unlock and the fetch, >>>>>> feeling free to reorder them), thus potentially racing with an exclusive >>>>>> writer accessing the data. >>>>>> >>>>>> On architectures where atomic ops serialize memory accesses this would >>>>>> never happen, otherwise the sequence above seems possible; am I missing >>>>>> something? >>>>> I think your concerns are right, possibly we need this patch: >>>>> http://www.freebsd.org/~attilio/sxrw_unlockb.diff >>>>> >>>>> However speaking with John we agreed possibly there is a more serious >>>>> breakage. Possibly, memory barriers would also require to ensure the >>>>> compiler to not reorder the operation, while right now, in FreeBSD, they >>>>> just take care of the reordering from the architecture perspective. >>>>> The only way I'm aware of GCC offers that is to clobber memory. >>>>> I will provide a patch that address this soon, hoping that GCC will be >>>>> smart enough to not overhead too much the memory clobbering but just >>>>> try to understand what's our purpose and servers it (I will try to >>>>> compare code generated before and after the patch at least for tier-1 >>>>> architectures). >>>> Does GCC really reorder accesses to volatile objects? The C Standard seems to >>>> object: >>>> >>>> 5.1.2.3 - 2 >>>> Accessing a volatile object, modifying an object, modifying a file, or calling >>>> a function that does any of those operations are all side effects,11) which >>>> are changes in the state of the execution environment. Evaluation of an >>>> expression may produce side effects. At certain specified points in the >>>> execution sequence called sequence points, all side effects of previous >>>> evaluations shall be complete and no side effects of subsequent evaluations >>>> shall have taken place. (A summary of the sequence points is given in annex >>>> C.) >>> Very interesting. >>> I was thinking about the other operating systems which basically do >>> 'memory clobbering' for ensuring a compiler barrier, but actually they >>> often forsee such a barrier without the conjuction of a memory >>> operand. >>> >>> I think I will need to speak a bit with a GCC engineer in order to see >>> what do they implement in regard of volatile operands. >> GCC can be quite aggressive with reordering even in the face of volatile. I >> was recently doing a hack to export some data from the kernel to userland >> that used a spin loop to grab a snapshot of the contents of a structure >> similar to the method used in the kernel with the timehands structures. It >> used a volatile structure exposed from the kernel that looked something >> like: >> >> struct foo { >> volatile int gen; >> /* other stuff */ >> }; >> >> volatile struct foo *p; >> >> do { >> x = p->gen; >> /* read other stuff */ >> y = p->gen; >> } while (x != y && x != 0); >> >> GCC moved the 'y = ' up into the middle of the '/* read other stuff */'. >> I eventually had to add explicit "memory" clobbers to force GCC to not >> move the reads of 'gen' around but do them "around" all the other >> operations, so that the working code is: >> >> do { >> x = p->gen; >> asm volatile("" ::: "memory"); >> /* read other stuff */ >> asm volatile("" ::: "memory"); >> y = p->gen; >> } while (x != y && x != 0); > > The situation was not so desperate as I first thought. > Actually, only ia32 and amd64 seems affected by the missing of memory > clobbering because it is already done for all the other platform when > using all the memory barriers. > On ia32 and amd64 too, the impact is more limited than what I > expected. atomic_cmpset_* already clobbers the memory and only > atomic_store_rel_* is not adeguately protected among the atomics used > in our locking primitives, thus I would really expect a limited > performance penalty if any. > What was not really protected where the functions defined through > ATOMIC_ASM() and that was the larger part to fix. > > I spoke briefly about the compiler support with Christian Lattner > (@Apple, LLVM leader) and he mentioned he was aware of the aggressive > behaviour of GCC pointing me in the direction that what the C Standard > really mandates is that read/write operations with non-volatile > operands can be reordered across a volatile operand but that the > read/write of volatile operands are strong ordered in regard of > eachother. This however means that we have to fix the 'memory clobber' > for GCC-simil compilers and also offer a support for the other that > let them specify a memory barrier. > I then wrote this patch: > http://www.freebsd.org/~attilio/atomic.h.diff > > That should address all the concern raised and also forsee the > possibility for other compiler to specify memory barriers semantics > differently from normal atomic. > > rdivacky@ kindly already tested the patch on LLVM/CLANG reporting no problems. > > I still didn't compare pickly the produced binaries, but I see a > little increase in the binary sizes probabilly caming from the .text > growing. This looks good to me. One thing that is missing is that the UP atomic load/store ops still need "memory" clobbers to prevent the compiler from reordering things (you could still have bad juju if you preempted in between the atomic op and the compiler-reordered operation on UP). -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 5 14:16: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 F3E911065670; Mon, 5 Oct 2009 14:16:40 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: from syn.atarininja.org (syn.csh.rit.edu [129.21.50.215]) by mx1.freebsd.org (Postfix) with ESMTP id CE0198FC20; Mon, 5 Oct 2009 14:16:40 +0000 (UTC) Received: by syn.atarininja.org (Postfix, from userid 1001) id B911C5C2E; Mon, 5 Oct 2009 09:58:42 -0400 (EDT) Date: Mon, 5 Oct 2009 09:58:42 -0400 From: Wesley Shields To: Doug Barton Message-ID: <20091005135842.GA8629@atarininja.org> References: <20091004141118.GG95662@syndicate.internationalconspiracy.org> <4AC8F7EF.9010303@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AC8F7EF.9010303@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Alex Trull , freebsd-rc@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: (Ab)using rcng's features to keep rc.d-style services running should they fail. 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, 05 Oct 2009 14:16:41 -0000 On Sun, Oct 04, 2009 at 12:30:55PM -0700, Doug Barton wrote: > Alex Trull wrote: > > Hi all, > > > > I realised that because portupgrade/portmaster don't always > > cleanly restart processes that have died due to being > > upgraded (mysqld, often!) that this was something I wanted > > to fix. > > I can't speak to portupgrade, however for portmaster there is no such > facility whatsoever. The admin is expected to disable things prior to > an upgrade and re-enable them when the upgrade is done. I don't feel > that this is an overwhelming burden. :) There is the @stopdaemon directive in plists (which gets translated into @unexec to forcestop the script). Some ports use it and some do not. Personally I think ports doing this automatically are quite annoying, and would love to rip them all out from the ports. Something like portmaster growing support for it would be welcome provided it does not happen by default. I've always found it funny that there is no @startdaemon directive (rightfully so, as we want people to explicitly turn things on) but it's acceptable if things get turned off via @stopdaemon without explicit permission. If a particular upgrade requires that the thing be not running we should check for that and abort, not go shutting things down. -- WXS From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 5 15:20:48 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 E7A33106566B for ; Mon, 5 Oct 2009 15:20:48 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by mx1.freebsd.org (Postfix) with ESMTP id 73A4E8FC0C for ; Mon, 5 Oct 2009 15:20:47 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 4so676011eyf.9 for ; Mon, 05 Oct 2009 08:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=NWJuTWd7Ox4TmJDw76SMwZL/DHvaXJdqFyiqHgzuanI=; b=ZT0mOlGTf3SbexAIGdc/SKceYkU9LXKbydkNruVcn2jG0oBYxnviKHOYDw/aM0XE1T Hurqlsb7SSyu8+HRnANME/cMvJX/omslgdgHbeQNiEinCmx34wzr11s2+e3zErfywlSD +NowOXVZwW3LJo+eI0eKcC1prBgPBrh9ZRz30= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=uTsRI+VzgQDEy6nmh4jMlf9SJo/ULRyh6V83nVjmU9pknkZKMHbvUMiJl3YlsFJsJ9 We/N1FiJvUKefJASV0X2X8RXMXX+0X0NoleRhAhr8JyEovvJNaYfqhSnbTp7bGFrthHN iiCx2D5EYlYa0Qqbr1yWVKo6OoMKp2mIEqwP4= Received: by 10.211.155.20 with SMTP id h20mr3442846ebo.44.1254754053657; Mon, 05 Oct 2009 07:47:33 -0700 (PDT) Received: from gumby.homeunix.com (bb-87-81-140-128.ukonline.co.uk [87.81.140.128]) by mx.google.com with ESMTPS id 7sm99126eyg.19.2009.10.05.07.47.31 (version=SSLv3 cipher=RC4-MD5); Mon, 05 Oct 2009 07:47:32 -0700 (PDT) Date: Mon, 5 Oct 2009 15:47:29 +0100 From: RW To: freebsd-hackers@freebsd.org Message-ID: <20091005154729.36044f89@gumby.homeunix.com> In-Reply-To: <20091004141118.GG95662@syndicate.internationalconspiracy.org> References: <20091004141118.GG95662@syndicate.internationalconspiracy.org> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.6; i386-portbld-freebsd7.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: (Ab)using rcng's features to keep rc.d-style services running should they fail. 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, 05 Oct 2009 15:20:49 -0000 On Sun, 4 Oct 2009 15:11:18 +0100 Alex Trull wrote: > Hi all, > > I realised that because portupgrade/portmaster don't always > cleanly restart processes that have died due to being > upgraded (mysqld, often!) that this was something I wanted > to fix. You can configure portupgrade (and FWIW portmanager) to do this. Take look at the sample configuration file. From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 5 17:01: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 2B82E106566B for ; Mon, 5 Oct 2009 17:01:31 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from tomjudge.vm.bytemark.co.uk (tomjudge.vm.bytemark.co.uk [80.68.91.100]) by mx1.freebsd.org (Postfix) with ESMTP id E3B948FC16 for ; Mon, 5 Oct 2009 17:01:30 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id C3784489C3 for ; Mon, 5 Oct 2009 18:01:29 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at tomjudge.vm.bytemark.co.uk Received: from tomjudge.vm.bytemark.co.uk ([127.0.0.1]) by localhost (tomjudge.vm.bytemark.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 660YSsuPD4s8 for ; Mon, 5 Oct 2009 18:01:26 +0100 (BST) Received: from rita.nodomain (unknown [192.168.205.6]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 524B2489BA for ; Mon, 5 Oct 2009 18:01:26 +0100 (BST) Message-ID: <4ACA2645.30801@tomjudge.com> Date: Mon, 05 Oct 2009 17:00:53 +0000 From: Tom Judge User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Kernel Thread Lock Question 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, 05 Oct 2009 17:01:31 -0000 Do I need to hold the per thread lock here? (This is for 7.1) PROC_LOCK(p); //mtx_lock_spin(&sched_lock); breakout = 0; FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); if (!TD_ON_RUNQ(td) && !TD_IS_RUNNING(td) && !TD_IS_SLEEPING(td)) { breakout = 1; thread_unlock(td); break; } thread_unlock(td); } //mtx_unlock_spin(&sched_lock); PROC_UNLOCK(p); Thanks Tom From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 5 17:55: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 5679C106566B for ; Mon, 5 Oct 2009 17:55:26 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outA.internet-mail-service.net (outa.internet-mail-service.net [216.240.47.224]) by mx1.freebsd.org (Postfix) with ESMTP id 4054C8FC0C for ; Mon, 5 Oct 2009 17:55:25 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 1BE0122E7; Mon, 5 Oct 2009 10:55:30 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 06B352D6014; Mon, 5 Oct 2009 10:55:24 -0700 (PDT) Message-ID: <4ACA330F.7060207@elischer.org> Date: Mon, 05 Oct 2009 10:55:27 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Tom Judge References: <4ACA2645.30801@tomjudge.com> In-Reply-To: <4ACA2645.30801@tomjudge.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Kernel Thread Lock Question 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, 05 Oct 2009 17:55:26 -0000 Tom Judge wrote: > Do I need to hold the per thread lock here? (This is for 7.1) > > PROC_LOCK(p); > //mtx_lock_spin(&sched_lock); > breakout = 0; > FOREACH_THREAD_IN_PROC(p, td) { > thread_lock(td); > if (!TD_ON_RUNQ(td) && > !TD_IS_RUNNING(td) && > !TD_IS_SLEEPING(td)) { > breakout = 1; > thread_unlock(td); > break; > } > thread_unlock(td); > } > //mtx_unlock_spin(&sched_lock); > PROC_UNLOCK(p); > "probably not" because the value in the status word can change just after you release it anyhow so your result does not have to be consistent with anything, just with itself. > > Thanks > > Tom > _______________________________________________ > 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" From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 6 19:50: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 6842A1065700; Tue, 6 Oct 2009 19:50:40 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 267EE8FC15; Tue, 6 Oct 2009 19:50:39 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n96JYbcd001437; Tue, 6 Oct 2009 15:34:37 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n96JYbl1001436; Tue, 6 Oct 2009 15:34:37 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 6 Oct 2009 15:34:37 -0400 From: David Schultz To: Anders Nordby , freebsd-hackers@FreeBSD.ORG, alc@FreeBSD.ORG, phk@FreeBSD.ORG Message-ID: <20091006193437.GA1196@zim.MIT.EDU> Mail-Followup-To: Anders Nordby , freebsd-hackers@freebsd.org, alc@FreeBSD.org, phk@FreeBSD.org References: <20091002202936.GA836@fupp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091002202936.GA836@fupp.net> Cc: Subject: Re: No end to swap zone exhausted problems? 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, 06 Oct 2009 19:50:40 -0000 On Fri, Oct 02, 2009, Anders Nordby wrote: > Better post about my swap zone problems here than tear all my hair out. > This concerns me: > > 1) How can SWAPMETA usage continue increasing, while swap space used is > not? Example: http://anders.fupp.net/test/swapmeta.png. In the swap meta > graph, used space is USED and free space is LIMIT-USED (FREE numbers are > a bit odd, it starts with 0) from the SWAPMETA line when running vmstat > -z. In the week graph, you can see that after 3 days swap space usage > settles at around 90 GB, while swap meta keeps increasing. IIRC, the swap pager tracks virtual memory regions that include swapped pages on a granularity of 16 pages. An increase in swapmeta usage could simply mean that swap has become fragmented. It should eventually level out (unless there is actually a leak, but I think we'd know by now). > How come increasing maxswzone beyond 256 MB does not yield a larger > SWAPMETA than 995410? Does it stop around 260 MB maxswzone? How can I > increase SWAPMETA further to be able to swap more? The code appears to limit the number of swapmeta entries (each entry being about 100 bytes) to half the number of pages of physical memory you have (sys/vm/swap_pager.c): n = cnt.v_page_count / 2; if (maxswzone && n > maxswzone / sizeof(struct swblock)) n = maxswzone / sizeof(struct swblock); You could try commenting out the first two of these lines, leaving the third, and see if that lets you raise the limit to something that works better for you. Note that raising it too high is also going to cause problems, as all of your physical memory will be filled with swap metadata. From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 6 22:44: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 E4241106566B; Tue, 6 Oct 2009 22:44:51 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 8EA818FC1B; Tue, 6 Oct 2009 22:44:51 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id A8B9E5C024; Wed, 7 Oct 2009 06:44:50 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 5CDCD55CE3D9; Wed, 7 Oct 2009 06:44:50 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id Ca+h1OLRzUzq; Wed, 7 Oct 2009 06:44:45 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-60.dsl.pltn13.sbcglobal.net [76.237.33.60]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id C0D5155CE3D3; Wed, 7 Oct 2009 06:44:42 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=WJaxvYLS/kXuKHZYyCeQetmQ9W8Su27jO+wxzGA0lEdLqwA0BRpMW5UlQBeRrvWpx KrFOg4usF7mtcSjtWWaug== Message-ID: <4ACBC857.2030207@delphij.net> Date: Tue, 06 Oct 2009 15:44:39 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.23 (X11/20091004) MIME-Version: 1.0 To: Wesley Shields References: <20091004141118.GG95662@syndicate.internationalconspiracy.org> <4AC8F7EF.9010303@FreeBSD.org> <20091005135842.GA8629@atarininja.org> In-Reply-To: <20091005135842.GA8629@atarininja.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alex Trull , Doug Barton , freebsd-rc@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: (Ab)using rcng's features to keep rc.d-style services running should they fail. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2009 22:44:52 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Wesley Shields wrote: > On Sun, Oct 04, 2009 at 12:30:55PM -0700, Doug Barton wrote: >> Alex Trull wrote: >>> Hi all, >>> >>> I realised that because portupgrade/portmaster don't always >>> cleanly restart processes that have died due to being >>> upgraded (mysqld, often!) that this was something I wanted >>> to fix. >> I can't speak to portupgrade, however for portmaster there is no such >> facility whatsoever. The admin is expected to disable things prior to >> an upgrade and re-enable them when the upgrade is done. I don't feel >> that this is an overwhelming burden. :) > > There is the @stopdaemon directive in plists (which gets translated into > @unexec to forcestop the script). Some ports use it and some do not. > Personally I think ports doing this automatically are quite annoying, > and would love to rip them all out from the ports. Something like > portmaster growing support for it would be welcome provided it does not > happen by default. +1 I think this feature should be user-controllable (or, the 'make install' should be 'restart'ing the rc.d script at very least). Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEARECAAYFAkrLyFcACgkQi+vbBBjt66DZ5QCfU3LSI+RiZwJv3huFx4wd3QNe UUsAn37vdhs30y+2eE/HLaw424CS7dMh =1FW0 -----END PGP SIGNATURE----- From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 7 02:53:25 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 06FCB106566B for ; Wed, 7 Oct 2009 02:53:25 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 519FD8FC12 for ; Wed, 7 Oct 2009 02:53:23 +0000 (UTC) Received: from inchoate.gsoft.com.au (inchoate.gsoft.com.au [203.31.81.30]) (authenticated bits=0) by cain.gsoft.com.au (8.13.8/8.13.8) with ESMTP id n972qu1b069214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 7 Oct 2009 13:22:57 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-hackers@freebsd.org, d@delphij.net Date: Wed, 7 Oct 2009 13:22:39 +1030 User-Agent: KMail/1.9.10 References: <20091004141118.GG95662@syndicate.internationalconspiracy.org> <20091005135842.GA8629@atarininja.org> <4ACBC857.2030207@delphij.net> In-Reply-To: <4ACBC857.2030207@delphij.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart8902491.FueqLsS0Pt"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200910071322.48738.doconnor@gsoft.com.au> X-Spam-Score: -3.977 () ALL_TRUSTED,BAYES_00 X-Scanned-By: MIMEDefang 2.63 on 203.31.81.10 Cc: Alex Trull , Wesley Shields , Doug Barton , freebsd-rc@freebsd.org Subject: Re: (Ab)using rcng's features to keep rc.d-style services running should they fail. 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, 07 Oct 2009 02:53:25 -0000 --nextPart8902491.FueqLsS0Pt Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wed, 7 Oct 2009, Xin LI wrote: > Wesley Shields wrote: > > On Sun, Oct 04, 2009 at 12:30:55PM -0700, Doug Barton wrote: > >> Alex Trull wrote: > >>> Hi all, > >>> > >>> I realised that because portupgrade/portmaster don't always > >>> cleanly restart processes that have died due to being > >>> upgraded (mysqld, often!) that this was something I wanted > >>> to fix. > >> > >> I can't speak to portupgrade, however for portmaster there is no > >> such facility whatsoever. The admin is expected to disable things > >> prior to an upgrade and re-enable them when the upgrade is done. I > >> don't feel that this is an overwhelming burden. :) > > > > There is the @stopdaemon directive in plists (which gets translated > > into @unexec to forcestop the script). Some ports use it and some > > do not. Personally I think ports doing this automatically are quite > > annoying, and would love to rip them all out from the ports. > > Something like portmaster growing support for it would be welcome > > provided it does not happen by default. > > +1 > > I think this feature should be user-controllable (or, the 'make > install' should be 'restart'ing the rc.d script at very least). It won't actually start anything you haven't enabled in rc.conf though=20 since all ports install rc.d scripts which require FOO_enable to be=20 YES. That said a knob like RESTART_SERVICES or similar would be nice. =2D-=20 Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --nextPart8902491.FueqLsS0Pt Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iD8DBQBKzAKA5ZPcIHs/zowRAmR0AJsEVYLNNKxI0wSISD1YRU9fvbTt4ACgpU3R W0+DjRmqeLH3MtYbJRV5Uyg= =jzPh -----END PGP SIGNATURE----- --nextPart8902491.FueqLsS0Pt-- From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 7 10:06: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 63F9A1065692 for ; Wed, 7 Oct 2009 10:06:20 +0000 (UTC) (envelope-from madduck@madduck.net) Received: from clegg.madduck.net (clegg.madduck.net [IPv6:2001:41e0:ff43::1]) by mx1.freebsd.org (Postfix) with ESMTP id A317C8FC1C for ; Wed, 7 Oct 2009 10:06:19 +0000 (UTC) Received: from piper.oerlikon.madduck.net (piper.oerlikon.madduck.net [IPv6:2001:41e0:ff12:0:211:2fff:fe6b:c869]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "piper.oerlikon.madduck.net", Issuer "CAcert Class 3 Root" (verified OK)) by clegg.madduck.net (postfix) with ESMTPS id 3A0E51D409E for ; Wed, 7 Oct 2009 12:06:12 +0200 (CEST) Received: from piper.oerlikon.madduck.net (piper.oerlikon.madduck.net [127.0.0.1]) by piper.oerlikon.madduck.net (Postfix) with ESMTP id 7889434F0 for ; Wed, 7 Oct 2009 12:05:06 +0200 (CEST) Date: Wed, 07 Oct 2009 12:05:06 +0200 To: freebsd-hackers@freebsd.org From: martin f krafft X-Mailer: swaks v20061116.0 jetmore.org/john/code/#swaks Message-Id: <20091007100506.7889434F0@piper.oerlikon.madduck.net> X-Virus-Scanned: clamav-milter 0.95.2 at clegg X-Virus-Status: Clean X-Mailman-Approved-At: Wed, 07 Oct 2009 11:38:10 +0000 Subject: Distro Summit 2010: call for papers extended until 18 Oct 2009 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: cfp@distrosummit.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2009 10:06:20 -0000 Please redistribute this call for papers. The deadline has been extended to 18 Oct 2009. =============== CALL FOR PAPERS =============== Distro Summit 2010 is a one-day technical conference with a strong focus on collaboration between Free Software distributions hosted at the linux.conf.au 2010. We are looking for proposals from any Free Software distribution, from the typical full distributions (both linux and non-linux) to the niche market derivatives. In spite of the strong focus on collaboration between Free Software distributions, topics may include packaging, maintenance, relationship with upstream developers, release management and QA. For more informtion, please visit: http://distrosummit.org. Important dates =============== * Call for papers ends: Wednesday 18 October 2009 * Announcing the schedule: Friday 2 October 2009 * Conference begins: Monday 18 January 2010 Presentation types ================== We will accept proposals for: * 25 minute standard-length presentations; * 50 minute long presentations. Session lengths include time for audience questions. We intend for standard-length presentation to make up the vast majority of our presentations. If you plan on submitting a proposal for a long presentation, a willingness to present a standard-length presentation will impact positively on your proposal. Submit a proposal ================= To submit your proposal, we'll need the following information: * Your name, contact details and a short biography; * Your proposal title; * Intended audience; * An abstract; * Presentation outline; * Presentation type (standard-length or long). To submit a proposal, or get more information, please write to cfp@distrosummit.org. Unfortunately, we cannot offer sponsorship for speakers. About the Distro Summit ======================= The Distro Summit 2010 is a one-day developer conference with a strong focus on collaboration between free software distributions hosted at the linux.conf.au 2010 (http://www.lca2010.org.nz). In addition to a schedule of technical, social and policy talks, the Distro Summit provides an opportunity for developers, contributors and other interested people to meet in person and work together more closely. Previous similar events have featured speakers from around the world. They have also been extremely beneficial for developing key free software software components and for improving collaboration and sharing between the different distributions. Target Audience =============== The Distro Summit is (mainly) a technical event, but this does not mean that the only target audience are developers and maintainers of free software distributions: the event will feature talks that range from the development to real-world use cases, going through marketing and the social aspects of the maintenance of free software distributions. -- Martin Krafft on the behalf of the Distro Summit organizers From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 7 17:54: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 34DB81065672 for ; Wed, 7 Oct 2009 17:54:41 +0000 (UTC) (envelope-from rysto32@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 BA18C8FC16 for ; Wed, 7 Oct 2009 17:54:40 +0000 (UTC) Received: by ewy18 with SMTP id 18so8583466ewy.43 for ; Wed, 07 Oct 2009 10:54:39 -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=IsFuq/lhQben4O7TlNTXZsM5df+mwI+0oJ7Xhn2vbn0=; b=PambxIN2pvwLbzv6uTAI5YeSSn8qj2zyVkYfztSv2ykGMVDEEewiBrDDNPunXC1YEI sC776EmOH0wZf+q0cYl/pulwWMQ/TD+guiJ6h6Qmt4my+25ciGG2QeHfcMCpDKrtn6GQ Xe1ZJkCIOOT1GU1ShaFv68NrKprWHmYgBNnAg= 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=ZHccYeDGzJRuXqNZaklY0aMOh7uow4HMXZjOpgiL+I75x9SbBc2RJoAn7QQF5jEmzl qv3ALgDPlGqsxTM7dzfMlE2pjtTT90V3/N8s753sZX0KYu6/j8xulh6AItDj/Q9oM12E kdd4dE0AIvb0uvUw8SKoZ+xFGno7Rz5D42vRQ= MIME-Version: 1.0 Received: by 10.211.131.12 with SMTP id i12mr6899367ebn.97.1254938079696; Wed, 07 Oct 2009 10:54:39 -0700 (PDT) In-Reply-To: References: Date: Wed, 7 Oct 2009 13:54:39 -0400 Message-ID: From: Ryan Stone To: Andrew Brampton Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: Make top display thread IDs 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, 07 Oct 2009 17:54:41 -0000 If a thread has a name, top -H will display it in parentheses after the executable name. One option would be to print the tid there if the thread has no name. From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 7 18:14:33 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 61457106566B for ; Wed, 7 Oct 2009 18:14:33 +0000 (UTC) (envelope-from brampton@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 E28DE8FC23 for ; Wed, 7 Oct 2009 18:14:32 +0000 (UTC) Received: by ewy18 with SMTP id 18so8601504ewy.43 for ; Wed, 07 Oct 2009 11:14:32 -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:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=ru1lamSbnclZL1mju2Fu5gWUlz+2/CDXqIKzk4+8Vrc=; b=Ig9Ygunu82QirYqzIJ4Bfb4OvWK1fUG5l/udGa02yy1JuTytS45l4JInpSB/oWK814 MR6CpcJftVXuaJNH4GlsQ5p01nuOcjExfJpIzgaqX99eaRWgZPrEko4wjs8qulodGRyQ AaO4rJisYcQQDFSonnmHs9IFeaV96PBAjeXRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=gthRCyP6w2sfN97FXP+qej9Y5WGC4+VydZSfK60ceYuz11L4qX6xQPHKgJFv8E2ssG ZS7OTB6I9zjHocm52sT7PmLuRH9WsZ8ZQsD/pNyPBv6TiPkltkWW9zuxxQxgbZSNZ8W8 /2Jdu+VtlrEevtFDl6dNGgV/C6I0MuoMmu5Fg= MIME-Version: 1.0 Sender: brampton@gmail.com Received: by 10.216.89.84 with SMTP id b62mr56346wef.227.1254939271897; Wed, 07 Oct 2009 11:14:31 -0700 (PDT) In-Reply-To: References: Date: Wed, 7 Oct 2009 19:14:31 +0100 X-Google-Sender-Auth: da54a5f9f9ed74a4 Message-ID: From: Andrew Brampton To: Ryan Stone Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Make top display thread IDs 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, 07 Oct 2009 18:14:33 -0000 2009/10/7 Ryan Stone : > If a thread has a name, top -H will display it in parentheses after > the executable name. =C2=A0One option would be to print the tid there if > the thread has no name. > Thanks for your suggestion. I would like the TID always to be displayed, so displaying it when there is no name wouldn't work for me. If you haven't looked at the patch I placed the TID directly after the PID column (when displaying threads in -H mode). thanks Andrew From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 7 21:40:59 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 E9E8B106568D for ; Wed, 7 Oct 2009 21:40:59 +0000 (UTC) (envelope-from jandrese@mitre.org) Received: from smtp-bedford.mitre.org (smtp-bedford.mitre.org [129.83.20.191]) by mx1.freebsd.org (Postfix) with ESMTP id A53BE8FC19 for ; Wed, 7 Oct 2009 21:40:59 +0000 (UTC) Received: from smtp-bedford.mitre.org (localhost.localdomain [127.0.0.1]) by smtp-bedford.mitre.org (8.13.1/8.13.1) with ESMTP id n97L6N97024345 for ; Wed, 7 Oct 2009 17:06:23 -0400 Received: from imchub2.MITRE.ORG (imchub2.mitre.org [129.83.29.74]) by smtp-bedford.mitre.org (8.13.1/8.13.1) with ESMTP id n97L6Nsb024342 for ; Wed, 7 Oct 2009 17:06:23 -0400 Received: from IMCMBX3.MITRE.ORG ([129.83.29.206]) by imchub2.MITRE.ORG ([129.83.29.74]) with mapi; Wed, 7 Oct 2009 17:06:23 -0400 From: "Andresen, Jason R." To: "freebsd-hackers@freebsd.org" Date: Wed, 7 Oct 2009 17:06:20 -0400 Thread-Topic: Distributed SSH attack Thread-Index: AcpEzbSMFH6a26/ORperuEkLW2evogCw8AKA Message-ID: <600C0C33850FFE49B76BDD81AED4D2580131FCB08C@IMCMBX3.MITRE.ORG> References: <20091002201039.GA53034@flint.openpave.org> <20091003081335.GA19914@marx.net.bit> <200910032357.02207.doconnor@gsoft.com.au> <4AC85E3B.4040906@delphij.net> In-Reply-To: <4AC85E3B.4040906@delphij.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: Distributed SSH attack 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, 07 Oct 2009 21:41:00 -0000 >-----Original Message----- >From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd- >hackers@freebsd.org] On Behalf Of Xin LI >Sent: Sunday, October 04, 2009 4:35 AM >To: Daniel O'Connor >Cc: jruohonen@iki.fi; freebsd-hackers@freebsd.org; krad >Subject: Re: Distributed SSH attack > >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >Daniel O'Connor wrote: >> On Sat, 3 Oct 2009, krad wrote: >>> simplest this to do is disable password auth, and use key based. >> >> Your logs are still full of crap though. >> >> I find sshguard works well, and I am fairly sure you couldn't spoof a >> valid TCP connection through pf sanitising so it would be difficult >> (nigh-impossible?) for someone to cause you to block a legit IP. >> >> If you can, changing the port sshd runs on is by far the simplest work >> around. Galling as it is to have to change stuff to work around >> malicious assholes.. > >Believe it or not, I find this pf.conf rule very effective to mitigate >this type of distributed SSH botnet attack: > >block in quick proto tcp from any os "Linux" to any port ssh How does that work? Does PF do some sort of os fingerprinting on the remot= e side before allowing the first SYN through? =20 Also, if you have a mix of Linux and FreeBSD boxes, presumably this would n= ot be a great idea right? It's not just getting people who are faking it? = =20 >From what I've seen on this attack, it looks like the hosts just send rando= m logins to random IP addresses constantly, so adding an IP address to a bl= ackhole list isn't as effective because you'll be getting hits from thousan= ds of IP addresses, but only a single hit. In fact it looks like this atta= ck is specifically designed to defeat the "I'll add the attacker's IP addre= ss to a black hole list" strategy, by coming in on a different address ever= y time. =20 From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 7 22:04: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 33B661065670 for ; Wed, 7 Oct 2009 22:04:52 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id CC1F08FC16 for ; Wed, 7 Oct 2009 22:04:51 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id DA59B5C025 for ; Thu, 8 Oct 2009 06:04:50 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id AC44955CE3ED; Thu, 8 Oct 2009 06:04:50 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id BX2+BDRR88IC; Thu, 8 Oct 2009 06:04:46 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-60.dsl.pltn13.sbcglobal.net [76.237.33.60]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id B8AAB55CE3F5; Thu, 8 Oct 2009 06:04:44 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=lyczJLkQdA2v4RlsLJlwlZs8psqe3+v2tgXLQvRHOd32yb2Ql0bspPFnvWqf4Dy2q BaEfe7nLGXlqu/yY04czQ== Message-ID: <4ACD107A.5080803@delphij.net> Date: Wed, 07 Oct 2009 15:04:42 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.23 (X11/20091004) MIME-Version: 1.0 To: "Andresen, Jason R." References: <20091002201039.GA53034@flint.openpave.org> <20091003081335.GA19914@marx.net.bit> <200910032357.02207.doconnor@gsoft.com.au> <4AC85E3B.4040906@delphij.net> <600C0C33850FFE49B76BDD81AED4D2580131FCB08C@IMCMBX3.MITRE.ORG> In-Reply-To: <600C0C33850FFE49B76BDD81AED4D2580131FCB08C@IMCMBX3.MITRE.ORG> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "freebsd-hackers@freebsd.org" Subject: Re: Distributed SSH attack X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2009 22:04:52 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Anderesen, Andresen, Jason R. wrote: [...] >> Believe it or not, I find this pf.conf rule very effective to mitigate >> this type of distributed SSH botnet attack: >> >> block in quick proto tcp from any os "Linux" to any port ssh > > How does that work? Does PF do some sort of os fingerprinting on the remote side before allowing the first SYN through? Well, this would have pros and cons. pf employs a "fingerprint" mechanism that would passively detect the operating system based on some predefined criteria, and the "Linux" matches several old Linux kernel's TCP fingerprint. Note that with some tweaks to Linux's TCP parameters, or newer Linux kernels, this can be bypassed. However, if the administrator choose to do this, it's not quite likely that their boxes would be part of the botnet. > Also, if you have a mix of Linux and FreeBSD boxes, presumably this > would not be a great idea right? It's not just getting people who > are faking it? Yes and no. Attackers would adopt to whatever defenders trying to stop them, however, for this type of attack (note that blocking Linux from being able to SSH on one system does not mean you would be more safe, it just mitigate the excessive login issue), what the attacker wanted is to have more botnet boxes, and he or she wouldn't care about having 1 more FreeBSD system be there or not, at the expense of faking or tweaking the TCP stack. >> From what I've seen on this attack, it looks like the hosts just >> send random logins to random IP addresses constantly, so adding an >> IP address to a blackhole list isn't as effective because you'll be >> getting hits from thousands of IP addresses, but only a single hit. >> In fact it looks like this attack is specifically designed to >> defeat the "I'll add the attacker's IP address to a black hole >> list" strategy, by coming in on a different address every time. Yes that's right. Since the scan is being done over a large scale of IP address space, it's possible to hide yourself by blocking Linux logins, since these boxes are usually managed by neglecting administrators and tends not to apply security updates from time to time. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEARECAAYFAkrNEHkACgkQi+vbBBjt66BFxACfbfrUJnnVM9YGw6bVSo5hnfnO BwwAoKFf8DnRd3suCIYMGhZN6FqlTPrP =NwHo -----END PGP SIGNATURE----- From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 8 10:02:13 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 F0790106568B; Thu, 8 Oct 2009 10:02:13 +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 46D858FC1A; Thu, 8 Oct 2009 10:02:13 +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 n98A295h042067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Oct 2009 13:02:09 +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 n98A29rT032312; Thu, 8 Oct 2009 13:02:09 +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 n98A29iC032311; Thu, 8 Oct 2009 13:02:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 8 Oct 2009 13:02:09 +0300 From: Kostik Belousov To: Stephen Hocking Message-ID: <20091008100209.GG2259@deviant.kiev.zoral.com.ua> References: <6300771b0910071753s6580c099i8c348824a6fe1a72@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2e7L0d/MUbHEOUYO" Content-Disposition: inline In-Reply-To: <6300771b0910071753s6580c099i8c348824a6fe1a72@mail.gmail.com> 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: ports@freebsd.org, hackers@freebsd.org Subject: Re: sigwait - differences between Linux & 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: Thu, 08 Oct 2009 10:02:14 -0000 --2e7L0d/MUbHEOUYO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 08, 2009 at 11:53:21AM +1100, Stephen Hocking wrote: > Hi all, >=20 > In my efforts to make the xrdp port more robust under FreeBSD, I have > discovered that sigwait (kind of an analogue to select(2), but for > signals rather than I/O) re-enables ignored signals in its list under > Linux, but not FreeBSD. The sesman daemon uses SIGCHLD to clean up > after a session has exited. Under Linux this works OK, under FreeSBD > it doesn't. I have worked around it in a very hackish manner (define a > dummy signal handler and enable it using signal, which means that the > sigwait call can then be unblocked by it), but am wondering if anyone > else has run across the same problem, and if so, if they fixed it in > an elegant manner. Also, does anyone know the correct semantics of > sigwait under this situation? ports@ is the wrong list to discuss the issue in the base system. Solaris 10 sigwait(2) manpage says the following: If sigwait() is called on an ignored signal, then the occurrence of the signal will be ignored, unless sigaction() changes the disposition. We have the same behaviour as Solaris, ingored signals are not queued or recorded regardeless of the presence of sigwaiting thread. --2e7L0d/MUbHEOUYO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrNuKEACgkQC3+MBN1Mb4gQJwCgvgLOveItqyok4c9LdZ3RRpfB s0QAoNSiwghMw1i+hPC671bwMtptj0K0 =j41b -----END PGP SIGNATURE----- --2e7L0d/MUbHEOUYO-- From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 8 10:27:30 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 98CEB106568F for ; Thu, 8 Oct 2009 10:27:30 +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 171C48FC1C for ; Thu, 8 Oct 2009 10:27:29 +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 n98ARP6j044513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Oct 2009 13:27:25 +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 n98ARPJJ035854; Thu, 8 Oct 2009 13:27:25 +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 n98ARPBV035853; Thu, 8 Oct 2009 13:27:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 8 Oct 2009 13:27:25 +0300 From: Kostik Belousov To: Vlad Galu Message-ID: <20091008102725.GH2259@deviant.kiev.zoral.com.ua> References: <6300771b0910071753s6580c099i8c348824a6fe1a72@mail.gmail.com> <20091008100209.GG2259@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MT9P10dJYE2MyE4L" Content-Disposition: inline In-Reply-To: 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: Stephen Hocking , hackers@freebsd.org Subject: Re: sigwait - differences between Linux & 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: Thu, 08 Oct 2009 10:27:30 -0000 --MT9P10dJYE2MyE4L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 08, 2009 at 01:23:37PM +0300, Vlad Galu wrote: > On Thu, Oct 8, 2009 at 1:02 PM, Kostik Belousov wro= te: > > On Thu, Oct 08, 2009 at 11:53:21AM +1100, Stephen Hocking wrote: > >> Hi all, > >> > >> In my efforts to make the xrdp port more robust under FreeBSD, I have > >> discovered that sigwait (kind of an analogue to select(2), but for > >> signals rather than I/O) re-enables ignored signals in its list under > >> Linux, but not FreeBSD. The sesman daemon uses SIGCHLD to clean up > >> after a session has exited. Under Linux this works OK, under FreeSBD > >> it doesn't. I have worked around it in a very hackish manner (define a > >> dummy signal handler and enable it using signal, which means that the > >> sigwait call can then be unblocked by it), but am wondering if anyone > >> else has run across the same problem, and if so, if they fixed it in > >> an elegant manner. Also, does anyone know the correct semantics of > >> sigwait under this situation? > > > > ports@ is the wrong list to discuss the issue in the base system. > > > > Solaris 10 sigwait(2) manpage says the following: > > If sigwait() is called on an ignored signal, then the occurrence of the > > signal will be ignored, unless sigaction() changes the disposition. > > > > We have the same behaviour as Solaris, ingored signals are not queued or > > recorded regardeless of the presence of sigwaiting thread. > > >=20 > This is a bit confusing. sigwait(2) says: "The signals specified by > set should be blocked at the time of the call to sigwait()."... Blocked and ignored are different attributes of signal. Ignored means that signal disposition is SIG_IGN, that causes the signal delivery event to be ignored. Blocked means that regardeless of signal disposition, signal is not delivered, but it is recorded somewhere and delivery happen when it unblocked. --MT9P10dJYE2MyE4L Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrNvowACgkQC3+MBN1Mb4gtDgCeLIB+Dk3bkR43wmYZDW+/1sNX zloAoIHgaMm0qpUI8dYjePghtPNg6SND =PNY3 -----END PGP SIGNATURE----- --MT9P10dJYE2MyE4L-- From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 8 10:55:43 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 2B28E106566B for ; Thu, 8 Oct 2009 10:55:43 +0000 (UTC) (envelope-from dudu@dudu.ro) Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by mx1.freebsd.org (Postfix) with ESMTP id B68FD8FC17 for ; Thu, 8 Oct 2009 10:55:42 +0000 (UTC) Received: by bwz27 with SMTP id 27so4578125bwz.43 for ; Thu, 08 Oct 2009 03:55:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.25.27 with SMTP id x27mr297143fab.7.1254997437520; Thu, 08 Oct 2009 03:23:57 -0700 (PDT) In-Reply-To: <20091008100209.GG2259@deviant.kiev.zoral.com.ua> References: <6300771b0910071753s6580c099i8c348824a6fe1a72@mail.gmail.com> <20091008100209.GG2259@deviant.kiev.zoral.com.ua> From: Vlad Galu Date: Thu, 8 Oct 2009 13:23:37 +0300 Message-ID: To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: Stephen Hocking , hackers@freebsd.org Subject: Re: sigwait - differences between Linux & 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: Thu, 08 Oct 2009 10:55:43 -0000 On Thu, Oct 8, 2009 at 1:02 PM, Kostik Belousov wrote: > On Thu, Oct 08, 2009 at 11:53:21AM +1100, Stephen Hocking wrote: >> Hi all, >> >> In my efforts to make the xrdp port more robust under FreeBSD, I have >> discovered that sigwait (kind of an analogue to select(2), but for >> signals rather than I/O) re-enables ignored signals in its list under >> Linux, but not FreeBSD. The sesman daemon uses SIGCHLD to clean up >> after a session has exited. Under Linux this works OK, under FreeSBD >> it doesn't. I have worked around it in a very hackish manner (define a >> dummy signal handler and enable it using signal, which means that the >> sigwait call can then be unblocked by it), but am wondering if anyone >> else has run across the same problem, and if so, if they fixed it in >> an elegant manner. Also, does anyone know the correct semantics of >> sigwait under this situation? > > ports@ is the wrong list to discuss the issue in the base system. > > Solaris 10 sigwait(2) manpage says the following: > If sigwait() is called on an ignored signal, then the occurrence of the > signal will be ignored, unless sigaction() changes the disposition. > > We have the same behaviour as Solaris, ingored signals are not queued or > recorded regardeless of the presence of sigwaiting thread. > This is a bit confusing. sigwait(2) says: "The signals specified by set should be blocked at the time of the call to sigwait()."... From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 8 22:15: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 ABF651065670 for ; Thu, 8 Oct 2009 22:15:26 +0000 (UTC) (envelope-from mel.flynn+fbsd.hackers@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 7F4738FC14 for ; Thu, 8 Oct 2009 22:15:26 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 96D807E857 for ; Thu, 8 Oct 2009 14:15:38 -0800 (AKDT) From: Mel Flynn To: freebsd-hackers@freebsd.org Date: Fri, 9 Oct 2009 00:15:24 +0200 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RC1; KDE/4.3.1; i386; ; ) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> Subject: Running a program through gdb without "interfering" 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, 08 Oct 2009 22:15:26 -0000 Hi, is there a way to have a program run through gdb and gdb only record a segfault, but otherwise let the program run? Why I'd like this is the following: I've got a i386 jail on an amd64 box, running 7.2-p4. UNAME_p and UNAME_m have been set to i386 as well as ARCH in /etc/make.conf. Running portmaster[1] to build ports under my uid and PM_SU_CMD, sudo *sometimes* segfaults. It's only sudo, so at present I don't have a reason to doubt memory. However, it doesn't dump core, so I'm at a loss what the culprit could be. [1] In order to get this working I had to put a statically compiled ps in the jail, or the uid test would fail. It has the downside that it lists both jail and host processes, but it is acceptable to me as the jail is only accessible from the host (pf enforced). I suspect sudo to have a similar problem or even related to ps returning processes from a uid that doesn't exist in the jail, but without a backtrace I don't know what to fix. -- Mel From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 8 23:17:02 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 12F68106568B for ; Thu, 8 Oct 2009 23:17:02 +0000 (UTC) (envelope-from mel.flynn+fbsd.hackers@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id D611E8FC13 for ; Thu, 8 Oct 2009 23:17:01 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 768577E857; Thu, 8 Oct 2009 15:17:13 -0800 (AKDT) From: Mel Flynn To: freebsd-hackers@freebsd.org Date: Fri, 9 Oct 2009 01:16:59 +0200 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RC1; KDE/4.3.1; i386; ; ) References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> <3a142e750910081538g213eb63cse559b4601e97a3@mail.gmail.com> In-Reply-To: <3a142e750910081538g213eb63cse559b4601e97a3@mail.gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200910090116.59158.mel.flynn+fbsd.hackers@mailing.thruhere.net> Cc: Paul B Mahol Subject: Re: Running a program through gdb without "interfering" 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, 08 Oct 2009 23:17:02 -0000 On Friday 09 October 2009 00:38:32 Paul B Mahol wrote: > On 10/9/09, Mel Flynn wrote: > > Hi, > > > > is there a way to have a program run through gdb and gdb only record a > > segfault, but otherwise let the program run? > > > > Why I'd like this is the following: > > I've got a i386 jail on an amd64 box, running 7.2-p4. UNAME_p and UNAME_m > > have > > been set to i386 as well as ARCH in /etc/make.conf. Running portmaster[1] > > to build ports under my uid and PM_SU_CMD, sudo *sometimes* segfaults. > > It's only > > sudo, so at present I don't have a reason to doubt memory. However, it > > doesn't > > dump core, so I'm at a loss what the culprit could be. > > Tried 'sysctl kern.sugid_coredump=1' ? Hmm, no. Enabled now and waiting for the next segfault. I actually looked at the sysctl -d, but it didn't register that this could be the main cause. Perhaps that sentence could be more clear: -kern.sugid_coredump: Enable coredumping set user/group ID processes +kenr.sugid_coredump: Allow setuid/setgid processes to dump core -- Mel From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 09:32: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 2BE30106566B for ; Fri, 9 Oct 2009 09:32:05 +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 BA3CB8FC0C for ; Fri, 9 Oct 2009 09:32:04 +0000 (UTC) Received: from [195.4.92.23] (helo=13.mx.freenet.de) by mout4.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #92) id 1MwBpS-0005oB-Iu; Fri, 09 Oct 2009 11:32:02 +0200 Received: from t976b.t.pppool.de ([89.55.151.107]:59606 helo=ernst.jennejohn.org) by 13.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #94) id 1MwBpS-0001o2-DJ; Fri, 09 Oct 2009 11:32:02 +0200 Date: Fri, 9 Oct 2009 11:32:01 +0200 From: Gary Jennejohn To: Mel Flynn Message-ID: <20091009113201.0ade498f@ernst.jennejohn.org> In-Reply-To: <200910090116.59158.mel.flynn+fbsd.hackers@mailing.thruhere.net> References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> <3a142e750910081538g213eb63cse559b4601e97a3@mail.gmail.com> <200910090116.59158.mel.flynn+fbsd.hackers@mailing.thruhere.net> 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: freebsd-hackers@freebsd.org, Paul B Mahol Subject: Re: Running a program through gdb without "interfering" 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, 09 Oct 2009 09:32:05 -0000 On Fri, 9 Oct 2009 01:16:59 +0200 Mel Flynn wrote: > On Friday 09 October 2009 00:38:32 Paul B Mahol wrote: > > On 10/9/09, Mel Flynn wrote: > > > Hi, > > > > > > is there a way to have a program run through gdb and gdb only record a > > > segfault, but otherwise let the program run? > > > > > > Why I'd like this is the following: > > > I've got a i386 jail on an amd64 box, running 7.2-p4. UNAME_p and UNAME_m > > > have > > > been set to i386 as well as ARCH in /etc/make.conf. Running portmaster[1] > > > to build ports under my uid and PM_SU_CMD, sudo *sometimes* segfaults. > > > It's only > > > sudo, so at present I don't have a reason to doubt memory. However, it > > > doesn't > > > dump core, so I'm at a loss what the culprit could be. > > > > Tried 'sysctl kern.sugid_coredump=1' ? > > Hmm, no. Enabled now and waiting for the next segfault. > I actually looked at the sysctl -d, but it didn't register that this could be > the main cause. > Perhaps that sentence could be more clear: > -kern.sugid_coredump: Enable coredumping set user/group ID processes > +kenr.sugid_coredump: Allow setuid/setgid processes to dump core > See the info file for gdb, section 5.3 Signals. It's possible to tell gdb how to handle signals, e.g. stop vs. nostop, etc. --- Gary Jennejohn From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 09:38: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 AA1411065672 for ; Fri, 9 Oct 2009 09:38:31 +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 6D2748FC08 for ; Fri, 9 Oct 2009 09:38:31 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 5EF996D41B; Fri, 9 Oct 2009 09:38:30 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 1319B844A2; Fri, 9 Oct 2009 11:38:30 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mel Flynn References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> Date: Fri, 09 Oct 2009 11:38:29 +0200 In-Reply-To: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> (Mel Flynn's message of "Fri, 9 Oct 2009 00:15:24 +0200") Message-ID: <86skds7vqi.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: Running a program through gdb without "interfering" 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, 09 Oct 2009 09:38:31 -0000 Mel Flynn writes: > is there a way to have a program run through gdb and gdb only record a=20 > segfault, but otherwise let the program run? Yes, just run "gdb /path/to/program" and type "run". > [...] sudo *sometimes* segfaults [...] However, it doesn't dump core sudo(1) is setuid root. You need to set kern.sugid_coredump to get it to dump core. > [1] In order to get this working I had to put a statically compiled ps in= the=20 > jail, or the uid test would fail. It has the downside that it lists both = jail=20 > and host processes, [...] Uh, no. Processes outside the jail are not visible inside it, no matter what version of ps(1) or top(1) or any other such program you use. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 14:08: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 C0D1B1065697 for ; Fri, 9 Oct 2009 14:08:44 +0000 (UTC) (envelope-from stef-list@memberwebs.com) Received: from memberwebs.com (memberwebs.com [94.75.203.95]) by mx1.freebsd.org (Postfix) with ESMTP id 8940D8FC13 for ; Fri, 9 Oct 2009 14:08:44 +0000 (UTC) Received: from [172.27.5.159] (unknown [172.27.5.159]) by memberwebs.com (Postfix) with ESMTP id 4FCF583E4BA; Fri, 9 Oct 2009 14:08:40 +0000 (UTC) Message-ID: <4ACF43EA.9050508@memberwebs.com> Date: Fri, 09 Oct 2009 09:08:42 -0500 From: Stef Walter User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Mel Flynn References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> In-Reply-To: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Running a program through gdb without "interfering" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: stef@memberwebs.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2009 14:08:44 -0000 Mel Flynn wrote: > [1] In order to get this working I had to put a statically compiled ps in the > jail This is a pretty standard practice. I always put these statically built into any jails that don't match the outside system. I use the following crunchgen config to accomplish that. Cheers, Stef # Commands to build in progs ps ipcs netstat pkill top w killall progs systat iostat progs jkill progs kldstat # Link these programs to each other ln pkill pgrep ln w uptime # Libraries which we need libs -lutil -lkvm -ldevstat -lncurses -ldevstat -lm -lnetgraph -lmemstat -lipx From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 14:50: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 8DA451065676 for ; Fri, 9 Oct 2009 14:50:08 +0000 (UTC) (envelope-from mel.flynn+fbsd.hackers@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 544B38FC20 for ; Fri, 9 Oct 2009 14:50:07 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.lan.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id C58167E853; Fri, 9 Oct 2009 06:50:18 -0800 (AKDT) From: Mel Flynn To: freebsd-hackers@freebsd.org Date: Fri, 9 Oct 2009 16:50:04 +0200 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RC1; KDE/4.3.1; i386; ; ) References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> <86skds7vqi.fsf@ds4.des.no> In-Reply-To: <86skds7vqi.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> Cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= Subject: Re: Running a program through gdb without "interfering" 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, 09 Oct 2009 14:50:08 -0000 On Friday 09 October 2009 11:38:29 Dag-Erling Sm=F8rgrav wrote: > Mel Flynn writes: > > is there a way to have a program run through gdb and gdb only record a > > segfault, but otherwise let the program run? >=20 > Yes, just run "gdb /path/to/program" and type "run". Not what I was looking for. The segfaults are random and the only way to=20 somewhat reliably reproduce it is to have portmaster invoke it as it's=20 PM_SU_CMD. And no, running that same command again doesn't trigger the=20 segfault, so it's "something environmental". Hence I'm looking for somethin= g=20 like: gdb -batch -x script_with_run_cmd.gdb -exec /usr/local/bin/sudo $argv where somehow I need $argv to be passed as arguments to sudo. I'm thinking = i=20 should just wrap it and mktemp(1) a new command script for gdb to use with = set=20 args $*, but if anyone has a more clever idea, I'd love to hear it. > > [...] sudo *sometimes* segfaults [...] However, it doesn't dump core >=20 > sudo(1) is setuid root. You need to set kern.sugid_coredump to get it > to dump core. It still segfaults and doesn't dump: Oct 9 04:34:18 smell kernel: pid 39476 (sudo), uid 0: exited on signal 11 Oct 9 04:36:32 smell kernel: pid 79657 (sudo), uid 0: exited on signal 11 Oct 9 04:36:43 smell kernel: pid 82390 (sudo), uid 0: exited on signal 11 Oct 9 04:51:46 smell kernel: pid 3601 (sudo), uid 0: exited on signal 11 find / -name '*.core' in the jail does not yield anything.=20 > > [1] In order to get this working I had to put a statically compiled ps = in > > the jail, or the uid test would fail. It has the downside that it lists > > both jail and host processes, [...] >=20 > Uh, no. Processes outside the jail are not visible inside it, no matter > what version of ps(1) or top(1) or any other such program you use. I'll write this off as pilot error, cause I cannot reproduce it. I saw bash= as=20 one of the processes listed in a blank ps run, which isn't installed in the= =20 jail, but since I don't have the terminal history anymore, it's entirely=20 possible I ran ps on the host. =2D-=20 Mel From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 15:01:37 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 C88721065676 for ; Fri, 9 Oct 2009 15:01:37 +0000 (UTC) (envelope-from mel.flynn+fbsd.hackers@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 91F2C8FC20 for ; Fri, 9 Oct 2009 15:01:37 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 2D9E57E853; Fri, 9 Oct 2009 07:01:49 -0800 (AKDT) From: Mel Flynn To: freebsd-hackers@freebsd.org Date: Fri, 9 Oct 2009 17:01:34 +0200 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RC1; KDE/4.3.1; i386; ; ) References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> <86skds7vqi.fsf@ds4.des.no> <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> In-Reply-To: <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200910091701.34788.mel.flynn+fbsd.hackers@mailing.thruhere.net> Cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= Subject: Re: Running a program through gdb without "interfering" 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, 09 Oct 2009 15:01:37 -0000 On Friday 09 October 2009 16:50:04 Mel Flynn wrote: > On Friday 09 October 2009 11:38:29 Dag-Erling Sm=F8rgrav wrote: > > Mel Flynn writes: > > > [...] sudo *sometimes* segfaults [...] However, it doesn't dump core > > > > sudo(1) is setuid root. You need to set kern.sugid_coredump to get it > > to dump core. >=20 > It still segfaults and doesn't dump: > Oct 9 04:34:18 smell kernel: pid 39476 (sudo), uid 0: exited on signal 11 > Oct 9 04:36:32 smell kernel: pid 79657 (sudo), uid 0: exited on signal 11 > Oct 9 04:36:43 smell kernel: pid 82390 (sudo), uid 0: exited on signal 11 > Oct 9 04:51:46 smell kernel: pid 3601 (sudo), uid 0: exited on signal 11 >=20 > find / -name '*.core' in the jail does not yield anything. =46YI, there's one read-only mount into the jail, being /usr/src. I don't s= ee a=20 reason given the commands it segfaults on, for $cwd to be below that.For=20 example it segfaulted on sudo pkg_delete glproto2. Thought I'd mention it to rule it out.=20 =2D-=20 Mel From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 16:08: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 0DA0110656A8; Fri, 9 Oct 2009 16:08: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 D4C908FC18; Fri, 9 Oct 2009 16:08: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 863AB46B2C; Fri, 9 Oct 2009 12:08:16 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id C9D938A026; Fri, 9 Oct 2009 12:08:15 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Fri, 9 Oct 2009 11:28:11 -0400 User-Agent: KMail/1.9.7 References: <81ws3a1je1.fsf@zhuzha.ua1> In-Reply-To: <81ws3a1je1.fsf@zhuzha.ua1> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910091128.11513.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 09 Oct 2009 12:08:15 -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=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: Robert Watson , Mikolaj Golub Subject: Re: crashinfo: print the content of ddb capture budder 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, 09 Oct 2009 16:08:17 -0000 On Monday 05 October 2009 1:48:06 am Mikolaj Golub wrote: > Hi, > > It would be nice if crashinfo(8) were also trying to output the content of ddb > capture buffer. Something like in this patch: > > --- crashinfo.sh.orig 2009-10-05 08:26:26.000000000 +0300 > +++ crashinfo.sh 2009-10-05 08:43:56.000000000 +0300 > @@ -304,3 +304,18 @@ > echo "kernel config" > echo > config -x $KERNEL > + > +file=`mktemp /tmp/crashinfo.XXXXXX` > +if [ $? -eq 0 ]; then > + ddb capture -M $VMCORE -N $KERNEL print > $file 2>/dev/null > + if [ -s $file ]; then > + echo "------------------------------------------------------------------------" > + echo "ddb capture buffer" > + echo > + cat $file | > + sed -e 's/p\{10\}p*//' # XXX: this removes the unfilled part of a capture buffer > + echo > + fi > + rm -f $file > +fi > + > I'm definitely in favor of this. I assume you have tested it locally? Do you have a sample crash.X.txt file with it enabled? -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 17:06: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 DA9DE106566B for ; Fri, 9 Oct 2009 17:06:29 +0000 (UTC) (envelope-from is@rambler-co.ru) Received: from mailrelay1.rambler.ru (mailrelay1.rambler.ru [81.19.66.239]) by mx1.freebsd.org (Postfix) with ESMTP id 8FD478FC12 for ; Fri, 9 Oct 2009 17:06:29 +0000 (UTC) Received: from kas30pipe.localhost (localhost [127.0.0.1]) by mailrelay1.rambler.ru (Postfix) with ESMTP id 4174C130C77 for ; Fri, 9 Oct 2009 21:06:28 +0400 (MSD) Received: from localhost (unknown [81.19.68.137]) by mailrelay1.rambler.ru (Postfix) with ESMTP id 9C000130C1D for ; Fri, 9 Oct 2009 21:06:27 +0400 (MSD) Date: Fri, 9 Oct 2009 21:06:27 +0400 From: Igor Sysoev To: freebsd-hackers@freebsd.org Message-ID: <20091009170627.GR14613@rambler-co.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Anti-Virus: Kaspersky Anti-Virus for MailServers 5.5.33/RELEASE, bases: 02092009 #2738642, status: clean X-SpamTest-Envelope-From: is@rambler-co.ru X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 9536 [Sen 02 2009] X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 10 X-SpamTest-SPF: pass X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release Subject: newfs -r 2 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, 09 Oct 2009 17:06:29 -0000 I have found that newfs in 8-STABLE has -r switch with zero default value. I think it should be 1 or 2 by default: as I understand, these sectors are not used usually by filesystem anyway since they are not in last cylinder group. Therefore noone would see the difference in usable space, but this reservation will allow to add gjournal to the filesystem later. BTW, could anyone tell how to learn the last sector that filesystem may really use ? -- Igor Sysoev http://sysoev.ru/en/ From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 17:30:48 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 CCCFC106568B for ; Fri, 9 Oct 2009 17:30:48 +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 AA9F38FC15 for ; Fri, 9 Oct 2009 17:30:48 +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 n99HUko13648; Fri, 9 Oct 2009 10:30:46 -0700 (PDT) Received: from localhost (neldredg@localhost) by zeno.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id n99HUjQ01209; Fri, 9 Oct 2009 10:30:45 -0700 (PDT) X-Authentication-Warning: zeno.ucsd.edu: neldredg owned process doing -bs Date: Fri, 9 Oct 2009 10:30:44 -0700 (PDT) From: Nate Eldredge X-X-Sender: neldredg@zeno.ucsd.edu To: Mel Flynn In-Reply-To: <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> Message-ID: References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> <86skds7vqi.fsf@ds4.des.no> <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1506727461-1255109444=:5432" Cc: freebsd-hackers@freebsd.org, Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= Subject: Re: Running a program through gdb without "interfering" 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, 09 Oct 2009 17:30:48 -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. ---559023410-1506727461-1255109444=:5432 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 9 Oct 2009, Mel Flynn wrote: > On Friday 09 October 2009 11:38:29 Dag-Erling Sm=F8rgrav wrote: >> Mel Flynn writes: >>> is there a way to have a program run through gdb and gdb only record a >>> segfault, but otherwise let the program run? >> >> Yes, just run "gdb /path/to/program" and type "run". > > Not what I was looking for. The segfaults are random and the only way to > somewhat reliably reproduce it is to have portmaster invoke it as it's > PM_SU_CMD. And no, running that same command again doesn't trigger the > segfault, so it's "something environmental". Hence I'm looking for someth= ing > like: > gdb -batch -x script_with_run_cmd.gdb -exec /usr/local/bin/sudo $argv > > where somehow I need $argv to be passed as arguments to sudo. I'm thinkin= g i > should just wrap it and mktemp(1) a new command script for gdb to use wit= h set > args $*, but if anyone has a more clever idea, I'd love to hear it. This won't work. You can't debug setuid programs (for reasons which=20 should be obvious). You could do it if you ran everything as root, but it= =20 sounds like the bug doesn't occur in that case. --=20 Nate Eldredge nate@thatsmathematics.com ---559023410-1506727461-1255109444=:5432-- From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 17:32: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 E6D0E1065676 for ; Fri, 9 Oct 2009 17:32:52 +0000 (UTC) (envelope-from mel.flynn+fbsd.hackers@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id AE5E18FC15 for ; Fri, 9 Oct 2009 17:32:52 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id E9E777E857 for ; Fri, 9 Oct 2009 09:33:03 -0800 (AKDT) From: Mel Flynn To: freebsd-hackers@freebsd.org Date: Fri, 9 Oct 2009 19:32:48 +0200 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RC1; KDE/4.3.1; i386; ; ) References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> <86skds7vqi.fsf@ds4.des.no> <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> In-Reply-To: <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200910091932.49028.mel.flynn+fbsd.hackers@mailing.thruhere.net> Subject: Re: Running a program through gdb without "interfering" 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, 09 Oct 2009 17:32:53 -0000 On Friday 09 October 2009 16:50:04 Mel Flynn wrote: > On Friday 09 October 2009 11:38:29 Dag-Erling Sm=F8rgrav wrote: > > Mel Flynn writes: > > > is there a way to have a program run through gdb and gdb only record a > > > segfault, but otherwise let the program run? > > > > Yes, just run "gdb /path/to/program" and type "run". >=20 > Not what I was looking for. The segfaults are random and the only way to > somewhat reliably reproduce it is to have portmaster invoke it as it's > PM_SU_CMD. And no, running that same command again doesn't trigger the > segfault, so it's "something environmental". Hence I'm looking for > something like: > gdb -batch -x script_with_run_cmd.gdb -exec /usr/local/bin/sudo $argv >=20 > where somehow I need $argv to be passed as arguments to sudo. I'm thinking > i should just wrap it and mktemp(1) a new command script for gdb to use > with set args $*, but if anyone has a more clever idea, I'd love to hear > it. Dead end path :/ % bin/gdbsudo echo hi /tmp/gdbsudo.F3kdwJ:1: Error in sourced command file: /usr/local/bin/sudo: Permission denied. % ls -l /usr/local/bin/sudo =2D--s--x--x 2 root wheel 116380 Oct 8 18:31 /usr/local/bin/sudo % sudo chmod g+r /usr/local/bin/sudo % bin/gdbsudo echo hi (no debugging symbols found)...(no debugging symbols found)...(no debugging= =20 symbols found)...(no debugging symbols found)...sudo: must be setuid root Program exited with code 01. Perhaps the cause of it not dumping core either. Would've been nice to know= =20 why it segfaults, but not nice enough to keep digging. =2D-=20 Mel From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 18:43:11 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 463421065676; Fri, 9 Oct 2009 18:43:11 +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 08CA08FC15; Fri, 9 Oct 2009 18:43:10 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C8B9C35A825; Fri, 9 Oct 2009 20:43:09 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id ADEBA228CD; Fri, 9 Oct 2009 20:43:09 +0200 (CEST) Date: Fri, 9 Oct 2009 20:43:09 +0200 From: Jilles Tjoelker To: Stephen Hocking Message-ID: <20091009184309.GA15210@stack.nl> References: <6300771b0910071753s6580c099i8c348824a6fe1a72@mail.gmail.com> <20091008100209.GG2259@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091008100209.GG2259@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: ports@freebsd.org, Kostik Belousov , hackers@freebsd.org Subject: Re: sigwait - differences between Linux & 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, 09 Oct 2009 18:43:11 -0000 On Thu, Oct 08, 2009 at 01:02:09PM +0300, Kostik Belousov wrote: > On Thu, Oct 08, 2009 at 11:53:21AM +1100, Stephen Hocking wrote: > > In my efforts to make the xrdp port more robust under FreeBSD, I have > > discovered that sigwait (kind of an analogue to select(2), but for > > signals rather than I/O) re-enables ignored signals in its list under > > Linux, but not FreeBSD. The sesman daemon uses SIGCHLD to clean up > > after a session has exited. Under Linux this works OK, under FreeSBD > > it doesn't. I have worked around it in a very hackish manner (define a > > dummy signal handler and enable it using signal, which means that the > > sigwait call can then be unblocked by it), but am wondering if anyone > > else has run across the same problem, and if so, if they fixed it in > > an elegant manner. Also, does anyone know the correct semantics of > > sigwait under this situation? > ports@ is the wrong list to discuss the issue in the base system. > Solaris 10 sigwait(2) manpage says the following: > If sigwait() is called on an ignored signal, then the occurrence of the > signal will be ignored, unless sigaction() changes the disposition. > We have the same behaviour as Solaris, ingored signals are not queued or > recorded regardeless of the presence of sigwaiting thread. POSIX permits both behaviours here: a blocked and ignored signal may or may not be discarded immediately on generation. Making this depend on whether there is a sigwaiting thread seems broken, and I don't think Linux does that. I think your "very hackish" approach is correct: set up a dummy signal handler after blocking the signal. Additionally, POSIX requires applications to set the SA_SIGINFO flag if they want queuing. This applies even if the signals are blocked and received using sigwaitinfo(2) or sigtimedwait(2). The SA_SIGINFO flag can only be set by setting a handler using sigaction(2). (Note, this does not mean that all signals are queued if SA_SIGINFO is set. It means that signals may not be queued if SA_SIGINFO is not set.) -- Jilles Tjoelker From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 19:27: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 027C21065670 for ; Fri, 9 Oct 2009 19:27:23 +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 B7EC48FC15 for ; Fri, 9 Oct 2009 19:27:22 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id EA6DA6D41B; Fri, 9 Oct 2009 19:27:21 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id A90CF84562; Fri, 9 Oct 2009 21:27:21 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mel Flynn References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> <86skds7vqi.fsf@ds4.des.no> <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> Date: Fri, 09 Oct 2009 21:27:21 +0200 In-Reply-To: <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> (Mel Flynn's message of "Fri, 9 Oct 2009 16:50:04 +0200") Message-ID: <86skdss6zq.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: Running a program through gdb without "interfering" 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, 09 Oct 2009 19:27:23 -0000 Mel Flynn writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Yes, just run "gdb /path/to/program" and type "run". > Not what I was looking for. The segfaults are random and the only way to= =20 > somewhat reliably reproduce it is to have portmaster invoke it as it's=20 > PM_SU_CMD. And no, running that same command again doesn't trigger the=20 > segfault, so it's "something environmental". Hence I'm looking for someth= ing=20 > like: > gdb -batch -x script_with_run_cmd.gdb -exec /usr/local/bin/sudo $argv > > where somehow I need $argv to be passed as arguments to sudo. I'm thinkin= g i=20 > should just wrap it and mktemp(1) a new command script for gdb to use wit= h set=20 > args $*, but if anyone has a more clever idea, I'd love to hear it. Why look for a clever option, when the simple one will do just fine? :>gdb-script-$$ echo "set args $@" >>gdb-script-$$ echo "run" >>gdb-script-$$ gdb -batch -x gdb-script-$$ /usr/local/bin/sudo > It still segfaults and doesn't dump: > Oct 9 04:34:18 smell kernel: pid 39476 (sudo), uid 0: exited on signal 11 > Oct 9 04:36:32 smell kernel: pid 79657 (sudo), uid 0: exited on signal 11 > Oct 9 04:36:43 smell kernel: pid 82390 (sudo), uid 0: exited on signal 11 > Oct 9 04:51:46 smell kernel: pid 3601 (sudo), uid 0: exited on signal 11 > > find / -name '*.core' in the jail does not yield anything.=20 Add 'ulimit -c unlimited' somewhere in the script before it invokes sudo. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 19:32: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 E66CE106566B for ; Fri, 9 Oct 2009 19:32:50 +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 A71648FC14 for ; Fri, 9 Oct 2009 19:32:50 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id EC5C46D41C; Fri, 9 Oct 2009 19:32:49 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id BB30684562; Fri, 9 Oct 2009 21:32:49 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nate Eldredge References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> <86skds7vqi.fsf@ds4.des.no> <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> Date: Fri, 09 Oct 2009 21:32:49 +0200 In-Reply-To: (Nate Eldredge's message of "Fri, 9 Oct 2009 10:30:44 -0700 (PDT)") Message-ID: <86ocogs6qm.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, Mel Flynn Subject: Re: Running a program through gdb without "interfering" 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, 09 Oct 2009 19:32:51 -0000 Nate Eldredge writes: > This won't work. You can't debug setuid programs (for reasons which > should be obvious). Ah, true, but easily fixable. Add a sysctl for it (just copy-paste the declaration for kern.sugid_coredump and change the name) and check its value in p_candebug() (hint: "if (credentialchanged)"). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 19:52:45 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 A921E106568D for ; Fri, 9 Oct 2009 19:52:45 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay1.uni-muenster.de (ZIVM-EXRELAY1.UNI-MUENSTER.DE [128.176.192.14]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8148FC16 for ; Fri, 9 Oct 2009 19:52:44 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,534,1249250400"; d="scan'208";a="285106129" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay1.uni-muenster.de with ESMTP; 09 Oct 2009 21:52:43 +0200 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 58B211B0763; Fri, 9 Oct 2009 21:52:43 +0200 (CEST) Date: Fri, 09 Oct 2009 21:52:42 +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: sysinstall colours 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, 09 Oct 2009 19:52:45 -0000 hi there, sysinstall is probably one of those ancient relics everybody tries to avoid dealing with from a developers point of view but i just found this beautiful screenie of a (probably) ncurse-based installer: http://www.phoronix.net/image.php?id=yoper_2009_beta&image=yoper_dresden_7_lrg i was surprised how much better it looks with those nice colours compared to sysinstall. is there any way the sysinstall colours could be adjusted (without a lot of work) to also feature such beautiful colours? i had a quick look at the sysinstall, libdialog and ncurses sources and to me it seems that to change sysinstall's colours the hardcoded values of COLOR_BLACK COLOR_RED COLOR_GREEN COLOR_YELLOW COLOR_BLUE COLOR_MAGENTA COLOR_CYAN COLOR_WHITE have to be changed in contrib/ncurses/ncurses/base/lib_color.c or is there an easier way? because this would of course affect all apps that are linked to ncurses. cheers. alex From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 21:25: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 419C110656B2 for ; Fri, 9 Oct 2009 21:25:15 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f223.google.com (mail-bw0-f223.google.com [209.85.218.223]) by mx1.freebsd.org (Postfix) with ESMTP id 88CA68FC12 for ; Fri, 9 Oct 2009 21:25:14 +0000 (UTC) Received: by bwz23 with SMTP id 23so921802bwz.43 for ; Fri, 09 Oct 2009 14:25:13 -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=wQo9LcnMSRfxSZwdIsshiPGzMUTy98plBygVYXftdcQ=; b=Ht13z/ZHwHEZcHrElnr5lH6lTH7xEuph1D75rVAVLqfWmi2uUti7Wr05kO8C3OvLzk UgL+j92rprvkTvjXpo9NFxH0X83P18bdjnWfCqtY6rBHrTZnq7n9nxgYzmJWk1m+quCh pr56m4W2UfvNpBvEoXoNjs80lRwAoaYlaFgCs= 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=c9UimtYffPutxcHQxMEDHVHYE4z0e7/tcY9VXiYXV7Z01c8n9rxYX1OnipR+Ei9idv xLtCle7+i34gjVb+IaEP4jk+0jaKPA+akH/bEcDHD3C7TejuwjwOZ09KErVFIckVQvmo k1ksk/XdNalSQRlK/IHddXJMSurB+fXhqprC0= Received: by 10.204.25.152 with SMTP id z24mr2616928bkb.44.1255123512854; Fri, 09 Oct 2009 14:25:12 -0700 (PDT) Received: from localhost ([95.69.172.150]) by mx.google.com with ESMTPS id d13sm2376815fka.52.2009.10.09.14.25.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Oct 2009 14:25:11 -0700 (PDT) To: John Baldwin References: <81ws3a1je1.fsf@zhuzha.ua1> <200910091128.11513.jhb@freebsd.org> Organization: TOA Ukraine From: Mikolaj Golub Date: Sat, 10 Oct 2009 00:25:09 +0300 In-Reply-To: <200910091128.11513.jhb@freebsd.org> (John Baldwin's message of "Fri\, 9 Oct 2009 11\:28\:11 -0400") Message-ID: <86r5tcmf9m.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, Robert Watson Subject: Re: crashinfo: print the content of ddb capture budder 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, 09 Oct 2009 21:25:15 -0000 On Fri, 9 Oct 2009 11:28:11 -0400 John Baldwin wrote: JB> On Monday 05 October 2009 1:48:06 am Mikolaj Golub wrote: >> Hi, >> >> It would be nice if crashinfo(8) were also trying to output the content of ddb >> capture buffer. Something like in this patch: >> >> --- crashinfo.sh.orig 2009-10-05 08:26:26.000000000 +0300 >> +++ crashinfo.sh 2009-10-05 08:43:56.000000000 +0300 >> @@ -304,3 +304,18 @@ >> echo "kernel config" >> echo >> config -x $KERNEL >> + >> +file=`mktemp /tmp/crashinfo.XXXXXX` >> +if [ $? -eq 0 ]; then >> + ddb capture -M $VMCORE -N $KERNEL print > $file 2>/dev/null >> + if [ -s $file ]; then >> + echo "------------------------------------------------------------------------" >> + echo "ddb capture buffer" >> + echo >> + cat $file | >> + sed -e 's/p\{10\}p*//' # XXX: this removes the unfilled part of a capture buffer >> + echo >> + fi >> + rm -f $file >> +fi >> + >> JB> I'm definitely in favor of this. I assume you have tested it locally? Do you have a sample JB> crash.X.txt file with it enabled? I have tested it on 8.0. zhuzha:~% ls -l /var/crash/vmcore.23 -rw------- 1 root wheel 166703104 2009-10-05 08:03 /var/crash/vmcore.23 zhuzha:~% sudo crashinfo Writing crash summary to /var/crash/core.txt.23. zhuzha:~% grep -B5 -A30 'ddb capture buffer' /var/crash/core.txt.23 ------------------------------------------------------------------------ kernel config config: File /boot/kernel.old/kernel doesn't contain configuration file. Either unsupported, or not compiled with INCLUDE_CONFIG_FILE ------------------------------------------------------------------------ ddb capture buffer db:0:kdb.enter.panic> show pcpu cpuid = 0 dynamic pcpu = 0x68ee80 curthread = 0xc4a1ad80: pid 2276 "sysctl" curpcb = 0xe6d44d90 fpcurthread = none idlethread = 0xc4576900: pid 11 "idle: cpu0" APIC ID = 0 currentldt = 0x50 spin locks held: db:0:kdb.enter.panic> show allpcpu Current CPU: 0 cpuid = 0 dynamic pcpu = 0x68ee80 curthread = 0xc4a1ad80: pid 2276 "sysctl" curpcb = 0xe6d44d90 fpcurthread = none idlethread = 0xc4576900: pid 11 "idle: cpu0" APIC ID = 0 currentldt = 0x50 spin locks held: cpuid = 1 dynamic pcpu = 0x34ffe80 curthread = 0xc5837480: pid 2191 "screen" curpcb = 0xe6e5ed90 fpcurthread = none idlethread = 0xc4576b40: pid 11 "idle: cpu1" zhuzha:~% tail /var/crash/core.txt.23 mi_switch(104,0,c0c798d3,1d6,44,...) at mi_switch+0x200 sleepq_switch(c0dc8190,0,c0c798d3,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0dc7ee0,44,c0c7793c,0,0,...) at sleepq_timedwait+0x6b _sleep(c0dc7ee0,0,44,c0c7793c,2710,...) at _sleep+0x339 scheduler(0,141ec00,141ec00,141e000,1425000,...) at scheduler+0x23e mi_startup() at mi_startup+0x96 begin() at begin+0x2c db:0:kdb.enter.panic> call doadump zhuzha:~% Actually the last echo in the patch looks like is not necessary. Do you want the whole crash.23.txt file for review? Also, I remember I tested it on crashdump of a kernel without ddb support and no issues were noticed too. -- Mikolaj Golub From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 21:32: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 B9547106566B for ; Fri, 9 Oct 2009 21:32:50 +0000 (UTC) (envelope-from jhellenthal@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 3E2698FC1A for ; Fri, 9 Oct 2009 21:32:49 +0000 (UTC) Received: by ewy18 with SMTP id 18so1442401ewy.43 for ; Fri, 09 Oct 2009 14:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=CA0V5UWKKnB26drqImeu37HLxbJWzetARD7POn+2yls=; b=JSP73gMt8cJXxFlfbPD12+5v81vYB8m41IysASZuCjW9lPvoPVkgwq8Me6qbHJnoIq XVDKawIYJZGzGM9HEFVt/yCGW/w9WuawW+TYUcw6Pcs6n2oeoWimVSS5K2PAE4XAPl8B 56C4/XLq2NFW/IRdrTDlptc2g3N8zNg+70Y9M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=KL3us2bB4izKKq8d9pY5wo0lXghjSLVKcobvqLAgIOZtnEh9Al08YWOTsrFV+JIb5c MXLPVmjPPIKEC1weXEwVDkds0g9L4QMwqJUaKxSkwOHqFT1gevoxwpaHyla45ELxCgb7 rEhlGdbk1gpBWVgiS5ygpY1uaewyQOS/kwyto= Received: by 10.216.88.8 with SMTP id z8mr1026271wee.109.1255123968390; Fri, 09 Oct 2009 14:32:48 -0700 (PDT) Received: from dimension.5p.local (adsl-99-19-46-114.dsl.klmzmi.sbcglobal.net [99.19.46.114]) by mx.google.com with ESMTPS id p10sm249695gvf.29.2009.10.09.14.32.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Oct 2009 14:32:47 -0700 (PDT) Sender: "J. Hellenthal" Date: Fri, 9 Oct 2009 17:32:43 -0400 From: jhell To: Alexander Best In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: sysinstall colours 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, 09 Oct 2009 21:32:50 -0000 On Fri, 9 Oct 2009 21:52 +0200, alexbestms@ wrote: > hi there, > > sysinstall is probably one of those ancient relics everybody tries to avoid > dealing with from a developers point of view but i just found this beautiful > screenie of a (probably) ncurse-based installer: > > http://www.phoronix.net/image.php?id=yoper_2009_beta&image=yoper_dresden_7_lrg > > i was surprised how much better it looks with those nice colours compared to > sysinstall. > > is there any way the sysinstall colours could be adjusted (without a lot of > work) to also feature such beautiful colours? i had a quick look at the > sysinstall, libdialog and ncurses sources and to me it seems that to change > sysinstall's colours the hardcoded values of > > COLOR_BLACK > COLOR_RED > COLOR_GREEN > COLOR_YELLOW > COLOR_BLUE > COLOR_MAGENTA > COLOR_CYAN > COLOR_WHITE > > have to be changed in contrib/ncurses/ncurses/base/lib_color.c or is there an > easier way? because this would of course affect all apps that are linked to > ncurses. > > cheers. > alex sysinstall looks like this too when it is ran in a gnome terminal or some other terminal that is ran in a X environment. -- ;; dataix.net!jhell 2048R/89D8547E 2009-09-30 ;; BSD since FreeBSD 4.2 Linux since Slackware 2.1 ;; 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 23:10: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 888A410656A3 for ; Fri, 9 Oct 2009 23:10:52 +0000 (UTC) (envelope-from mail@0xabadba.be) Received: from mail-vw0-f180.google.com (mail-vw0-f180.google.com [209.85.212.180]) by mx1.freebsd.org (Postfix) with ESMTP id 489A48FC18 for ; Fri, 9 Oct 2009 23:10:52 +0000 (UTC) Received: by vws10 with SMTP id 10so4413425vws.7 for ; Fri, 09 Oct 2009 16:10:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.114.211 with SMTP id f19mr5047544vcq.1.1255128291111; Fri, 09 Oct 2009 15:44:51 -0700 (PDT) X-Originating-IP: [149.106.224.20] In-Reply-To: References: From: james toy Date: Fri, 9 Oct 2009 18:44:31 -0400 Message-ID: <61c92c7d0910091544g36db4824t40298167fb9275ad@mail.gmail.com> To: jhell Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, Alexander Best Subject: Re: sysinstall colours 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, 09 Oct 2009 23:10:52 -0000 Alexander, ==8<== >> http://www.phoronix.net/image.php?id=yoper_2009_beta&image=yoper_dresden_7_lrg ==8<== The head maintainer of Yoper; Tobias G, runs a kernel patchset I work on from http://zen-sources.org as his default kernel. I am sure he would be more than happy to discuss some of their methods if you are interested in learning or modifying the current sysinstall system. Not sure how much this will help; however, it cannot hurt to ask. Taking ideas from Linux distros is rarely a good idea I've found though :) =jt From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 00:27:55 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 A445F1065676 for ; Sat, 10 Oct 2009 00:27:55 +0000 (UTC) (envelope-from sektie@gmail.com) Received: from mail-px0-f192.google.com (mail-px0-f192.google.com [209.85.216.192]) by mx1.freebsd.org (Postfix) with ESMTP id 772778FC0C for ; Sat, 10 Oct 2009 00:27:55 +0000 (UTC) Received: by pxi30 with SMTP id 30so5296892pxi.7 for ; Fri, 09 Oct 2009 17:27:55 -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:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=oMZ3ta28fLwGTZNOJyLHM7W0YSoR4Di+w8GQeMFAw6g=; b=JQjm2tLKsIJ7PK3Zx3Em2LfQnPHYa/C3cVHJAOSfn9TWooZo5WWdUpJWZW7BwIFJep k9Ur5YAMGjHMmfSAySPmWDdwXmLSSMQ7P4NQhXSuMYpD4zsjmqFJsUO1Vd3FsoQgJJak I7Y0Jhd6q8sS3GB6ow7BjYu7b2USZ7K7TYR98= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=JwkzcwNOq1dr0MjUJAfZGJz64rJnohPoeBSbJABKwi8ATsq6eQD1M9cna67bmh5a1Y Wo0otZa/VJg+EKpVCjSjVEebD5OJJW2lZgEdP45kNTiZ8lbSRlhLZHjZoc5dkATTK0B4 QMqQJZ27EkiZLSgaQXivMoM/sD9tVGnIsax6o= MIME-Version: 1.0 Sender: sektie@gmail.com Received: by 10.142.75.1 with SMTP id x1mr272450wfa.194.1255132772425; Fri, 09 Oct 2009 16:59:32 -0700 (PDT) In-Reply-To: References: Date: Fri, 9 Oct 2009 16:59:32 -0700 X-Google-Sender-Auth: 5dbb1326b0f0e235 Message-ID: From: Randi Harper 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: sysinstall colours 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, 10 Oct 2009 00:27:55 -0000 On Fri, Oct 9, 2009 at 12:52 PM, Alexander Best < alexbestms@math.uni-muenster.de> wrote: > hi there, > > sysinstall is probably one of those ancient relics everybody tries to avoid > dealing with from a developers point of view but i just found this > beautiful > screenie of a (probably) ncurse-based installer: > > > http://www.phoronix.net/image.php?id=yoper_2009_beta&image=yoper_dresden_7_lrg > > i was surprised how much better it looks with those nice colours compared > to > sysinstall. > > is there any way the sysinstall colours could be adjusted (without a lot of > work) to also feature such beautiful colours? i had a quick look at the > sysinstall, libdialog and ncurses sources and to me it seems that to change > sysinstall's colours the hardcoded values of > > COLOR_BLACK > COLOR_RED > COLOR_GREEN > COLOR_YELLOW > COLOR_BLUE > COLOR_MAGENTA > COLOR_CYAN > COLOR_WHITE > > have to be changed in contrib/ncurses/ncurses/base/lib_color.c or is there > an > easier way? because this would of course affect all apps that are linked to > ncurses. > > cheers. > alex > Seriously?!?!?! All the problems with sysinstall, and your idea is to change the color? Are you trying to start a bikeshed? If so, I prefer pink. -- randi From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 01:52: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 7CC2F106568D for ; Sat, 10 Oct 2009 01:52:09 +0000 (UTC) (envelope-from mel.flynn+fbsd.hackers@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 445628FC1C for ; Sat, 10 Oct 2009 01:52:08 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.lan.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 6E5B17E857; Fri, 9 Oct 2009 17:52:20 -0800 (AKDT) From: Mel Flynn To: freebsd-hackers@freebsd.org Date: Sat, 10 Oct 2009 03:52:05 +0200 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RC1; KDE/4.3.1; i386; ; ) References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> <86skdss6zq.fsf@ds4.des.no> In-Reply-To: <86skdss6zq.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200910100352.05524.mel.flynn+fbsd.hackers@mailing.thruhere.net> Cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= Subject: Re: Running a program through gdb without "interfering" 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, 10 Oct 2009 01:52:09 -0000 On Friday 09 October 2009 21:27:21 Dag-Erling Sm=F8rgrav wrote: > Mel Flynn writes: > > Dag-Erling Sm=F8rgrav writes: > > > Yes, just run "gdb /path/to/program" and type "run". > > > > Not what I was looking for. The segfaults are random and the only way to > > somewhat reliably reproduce it is to have portmaster invoke it as it's > > PM_SU_CMD. And no, running that same command again doesn't trigger the > > segfault, so it's "something environmental". Hence I'm looking for > > something like: > > gdb -batch -x script_with_run_cmd.gdb -exec /usr/local/bin/sudo $argv > > > > where somehow I need $argv to be passed as arguments to sudo. I'm > > thinking i should just wrap it and mktemp(1) a new command script for g= db > > to use with set args $*, but if anyone has a more clever idea, I'd love > > to hear it. >=20 > Why look for a clever option, when the simple one will do just fine? Cause I don't know how much of the cause of this bug I'm influencing. Even= =20 though this is now the simple solution, it would be simpler if gdb (or anot= her=20 debugger) could work similar as sudo, where it would take the first argumen= t=20 as binary and the rest as arguments to the binary. This would do away with= =20 some extra IO I'm now creating. Though, it's unlikely it is related to IO,= =20 there is no pattern that I've found yet for the segfault, so I'm trying to= =20 limit any "extra stuff". I'll patch the kernel tomorrow with the new sysctl and see how far that get= s=20 me. > Add 'ulimit -c unlimited' somewhere in the script before it invokes sudo. I'll add it. =2D-=20 Mel From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 08:50: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 2D1E71065670 for ; Sat, 10 Oct 2009 08:50:22 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-bw0-f223.google.com (mail-bw0-f223.google.com [209.85.218.223]) by mx1.freebsd.org (Postfix) with ESMTP id AE9068FC12 for ; Sat, 10 Oct 2009 08:50:21 +0000 (UTC) Received: by bwz23 with SMTP id 23so1081837bwz.43 for ; Sat, 10 Oct 2009 01:50:20 -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=7i04fX0YUo0aH8t676wLE/KygD698z3kquZx9ljsvG0=; b=jsyvmJMEdJVeMrJDpVwHxIQg+MpaIjthniRtw7kl4tBIdtdLQpH39IK7YZvpeWce+X P4XLswHjRIkmW6XIDSa7n5nHL0usR8hZMU3M/CsEVTLVxYqVkNFkWkvGoAhy8+a978J9 YkqA99FyUKT22I3EsxmtyO/Mez7CCnv/qBO9c= 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=PxG2C6ODBBOOEjeOMNTkoXZzbkRlJBbEGy8tgfiInThC83KQXHXikRzzMkReozqhgM MG5rIwYiRhwM7li6F9iQMJloPmKLnASXnNYipRhiWQIGiQODhXdjFJQGWSSGaL5XNUzA HBnpL+a23MGgdm34uQzADLAJF4obF3RxcRwFk= MIME-Version: 1.0 Received: by 10.103.78.7 with SMTP id f7mr1472300mul.95.1255164620192; Sat, 10 Oct 2009 01:50:20 -0700 (PDT) In-Reply-To: References: Date: Sat, 10 Oct 2009 08:50:20 +0000 Message-ID: <3a142e750910100150g7459e037u7b84b4b4bbc2bf8@mail.gmail.com> From: Paul B Mahol To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: sysinstall colours 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, 10 Oct 2009 08:50:22 -0000 On 10/9/09, Alexander Best wrote: > hi there, > > sysinstall is probably one of those ancient relics everybody tries to avoid > dealing with from a developers point of view but i just found this beautiful > screenie of a (probably) ncurse-based installer: > > http://www.phoronix.net/image.php?id=yoper_2009_beta&image=yoper_dresden_7_lrg > > i was surprised how much better it looks with those nice colours compared to > sysinstall. > > is there any way the sysinstall colours could be adjusted (without a lot of > work) to also feature such beautiful colours? i had a quick look at the > sysinstall, libdialog and ncurses sources and to me it seems that to change > sysinstall's colours the hardcoded values of > > COLOR_BLACK > COLOR_RED > COLOR_GREEN > COLOR_YELLOW > COLOR_BLUE > COLOR_MAGENTA > COLOR_CYAN > COLOR_WHITE > > have to be changed in contrib/ncurses/ncurses/base/lib_color.c or is there > an > easier way? because this would of course affect all apps that are linked to > ncurses. This have nothing to do with ncurses, colors you like simple can not be displayed in current syscons(4) and making support for 256 colors or even true bit color in sysinstall(so that it looks amazing in konsole) is waste of time. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 10:06:42 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 27D9F1065679 for ; Sat, 10 Oct 2009 10:06:42 +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 B2DAD8FC16 for ; Sat, 10 Oct 2009 10:06:41 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,536,1249250400"; d="scan'208";a="15546383" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 10 Oct 2009 12:06:40 +0200 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 10DBE1B0763; Sat, 10 Oct 2009 12:06:40 +0200 (CEST) Date: Sat, 10 Oct 2009 12:06:39 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: sysinstall colours 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, 10 Oct 2009 10:06:42 -0000 jhell schrieb am 2009-10-09: > On Fri, 9 Oct 2009 21:52 +0200, alexbestms@ wrote: > >hi there, > >sysinstall is probably one of those ancient relics everybody tries > >to avoid > >dealing with from a developers point of view but i just found this > >beautiful > >screenie of a (probably) ncurse-based installer: > >http://www.phoronix.net/image.php?id=yoper_2009_beta&image=yoper_dre > >sden_7_lrg > >i was surprised how much better it looks with those nice colours > >compared to > >sysinstall. > >is there any way the sysinstall colours could be adjusted (without > >a lot of > >work) to also feature such beautiful colours? i had a quick look at > >the > >sysinstall, libdialog and ncurses sources and to me it seems that > >to change > >sysinstall's colours the hardcoded values of > >COLOR_BLACK > >COLOR_RED > >COLOR_GREEN > >COLOR_YELLOW > >COLOR_BLUE > >COLOR_MAGENTA > >COLOR_CYAN > >COLOR_WHITE > >have to be changed in contrib/ncurses/ncurses/base/lib_color.c or > >is there an > >easier way? because this would of course affect all apps that are > >linked to > >ncurses. > >cheers. > >alex > sysinstall looks like this too when it is ran in a gnome terminal or > some other terminal that is ran in a X environment. > -- > ;; dataix.net!jhell 2048R/89D8547E 2009-09-30 > ;; BSD since FreeBSD 4.2 Linux since Slackware 2.1 > ;; 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E i'm running sysinstall in xterm with $TERM set to xterm-color and the colors don't seem any different to me. but you have a point there, because i could edit ~/.Xdefaults and adjust some xterm resources to change the standard colours. alex From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 10:21: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 D56EF106566B for ; Sat, 10 Oct 2009 10:21:31 +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 40CF08FC08 for ; Sat, 10 Oct 2009 10:21:31 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,536,1249250400"; d="scan'208";a="225958047" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER03.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 10 Oct 2009 12:21:29 +0200 Received: by ZIVMAILUSER03.UNI-MUENSTER.DE (Postfix, from userid 149459) id BA5121B0750; Sat, 10 Oct 2009 12:21:29 +0200 (CEST) Date: Sat, 10 Oct 2009 12:21:28 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Randi Harper 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: sysinstall colours 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, 10 Oct 2009 10:21:31 -0000 Randi Harper schrieb am 2009-10-10: > On Fri, Oct 9, 2009 at 12:52 PM, Alexander Best < > alexbestms@math.uni-muenster.de> wrote: > > hi there, > > sysinstall is probably one of those ancient relics everybody tries > > to avoid > > dealing with from a developers point of view but i just found this > > beautiful > > screenie of a (probably) ncurse-based installer: > > http://www.phoronix.net/image.php?id=yoper_2009_beta&image=yoper_dresden_7_lrg > > i was surprised how much better it looks with those nice colours > > compared > > to > > sysinstall. > > is there any way the sysinstall colours could be adjusted (without > > a lot of > > work) to also feature such beautiful colours? i had a quick look at > > the > > sysinstall, libdialog and ncurses sources and to me it seems that > > to change > > sysinstall's colours the hardcoded values of > > COLOR_BLACK > > COLOR_RED > > COLOR_GREEN > > COLOR_YELLOW > > COLOR_BLUE > > COLOR_MAGENTA > > COLOR_CYAN > > COLOR_WHITE > > have to be changed in contrib/ncurses/ncurses/base/lib_color.c or > > is there > > an > > easier way? because this would of course affect all apps that are > > linked to > > ncurses. > > cheers. > > alex > Seriously?!?!?! All the problems with sysinstall, and your idea is to > change > the color? Are you trying to start a bikeshed? If so, I prefer pink. > -- randi of course sysinstall has a ton of problems and should be replaced. no doubt about it. but look at it from this angle: current developers don't seem to have any interest in improving sysinstall. so it's important to get new people involved in freebsd. and the way to do that is with an attractive looking installer and an easy installation process imo. sure a good installer doesn't make a good os. but let's face it. when you've been running windows for a few years and finally want to switch to something else you're likely looking for an os which doesn't frighten you off right at the start (which freebsd sort of does). so i think having a good looking installer is more than just eyecandy. i don't think hardcore developers who prefer working with a bare X and vi(m)/emacs and so forth should look down on people who are slowly starting to get involved in an os, because without new people freebsd will someday be dead. alex From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 10:34: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 734EF1065694 for ; Sat, 10 Oct 2009 10:34:07 +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 0BD078FC15 for ; Sat, 10 Oct 2009 10:34:06 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,536,1249250400"; d="scan'208";a="15547823" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER03.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 10 Oct 2009 12:34:06 +0200 Received: by ZIVMAILUSER03.UNI-MUENSTER.DE (Postfix, from userid 149459) id 189A11B0750; Sat, 10 Oct 2009 12:34:06 +0200 (CEST) Date: Sat, 10 Oct 2009 12:34:05 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Mikolaj Golub Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: Sat, 10 Oct 2009 10:34:07 -0000 thanks. this is a cool script and very useful indeed. only thing you might want to do is check for root privileges at the beginning to avoid nasty error messages like. awk: can't open file /var/crash/info.0 source line number 12 thanks again. alex From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 11:07: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 EF5D01065696 for ; Sat, 10 Oct 2009 11:07:34 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-yx0-f171.google.com (mail-yx0-f171.google.com [209.85.210.171]) by mx1.freebsd.org (Postfix) with ESMTP id A099A8FC1F for ; Sat, 10 Oct 2009 11:07:34 +0000 (UTC) Received: by yxe1 with SMTP id 1so852958yxe.3 for ; Sat, 10 Oct 2009 04:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=xCT47Fo7noYNPCw9JHJpZGmt5HaTHPgTt4gmJz2Gwg0=; b=eTrYQQ85xF24pO6oke9cwtYYW/OsHiPouP0WrBErr1x7Gz1mFwH2TowxcAvzgpqyP5 RjrGirs15tXDblO5t2HDd5ctSbVKGbZCsEim1eiCpUprqSS19wfQtpT0RFV3Redwquum +FmMAotyJ60prQjj1JKz55+4NpVLhqy+v4zEs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=utQ9KMOJlD1HDW6cIoEnZ8PoeyTccvPgBfMFjiQKojtRVqKXniKTFL8sixOC+jv4pO kOXRQ7XYh3FVfW4OXfeSdlV4ehQFiHc0ailSUHFDjetEli8Ri9GWFBTvHeWeYNZ7MKM+ UlkVgy583GVMQ4LAQayosyvqtBfRi5f1pFw/M= Received: by 10.150.238.4 with SMTP id l4mr6489183ybh.177.1255172853793; Sat, 10 Oct 2009 04:07:33 -0700 (PDT) Received: from dimension.5p.local (adsl-99-19-46-114.dsl.klmzmi.sbcglobal.net [99.19.46.114]) by mx.google.com with ESMTPS id 13sm1080803gxk.5.2009.10.10.04.07.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 10 Oct 2009 04:07:33 -0700 (PDT) Sender: "J. Hellenthal" Date: Sat, 10 Oct 2009 07:07:30 -0400 From: jhell To: Alexander Best In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: FreeBSD Hackers , Randi Harper Subject: Re: sysinstall colours 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, 10 Oct 2009 11:07:35 -0000 On Sat, 10 Oct 2009 06:21, alexbestms@ wrote: > of course sysinstall has a ton of problems and should be replaced. no doubt > about it. but look at it from this angle: > You should really ask what the FreeBSD angle on this is. It is really well versed and well planned out and covers many areas among many people which make the installer a very versatile yet very controversial thing to replace. > current developers don't seem to have any interest in improving sysinstall. so > it's important to get new people involved in freebsd. and the way to do that > is with an attractive looking installer and an easy installation process imo. > There has been a lot of expressed interest in replacing the installed multiple times in the past with unsaid I believe 3 projects going on right now (someone correct me if I'm wrong) everywhere from graphical to script. > sure a good installer doesn't make a good os. but let's face it. when you've > been running windows for a few years and finally want to switch to something > else you're likely looking for an os which doesn't frighten you off right at > the start (which freebsd sort of does). > When you have been running windows for a few years and you have decided to research your options you have kept a open mind and willingness to see what else is out there before you have passed judgment upon something because of its colors. More people search for functionality and use before practical looks. > so i think having a good looking installer is more than just eyecandy. i don't > think hardcore developers who prefer working with a bare X and vi(m)/emacs and > so forth should look down on people who are slowly starting to get involved in > an os, because without new people freebsd will someday be dead. > > alex > Certainly not going to be dead. Forums as of this email have 8,334 registered users alone. That's not counting all the Corporate entities, Yahoo if you may and Google if you will plus uncountable more. -- ;; dataix.net!jhell 2048R/89D8547E 2009-09-30 ;; BSD since FreeBSD 4.2 Linux since Slackware 2.1 ;; 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 13:43: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 0D39F1065672 for ; Sat, 10 Oct 2009 13:43:07 +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 8F5198FC0C for ; Sat, 10 Oct 2009 13:43:06 +0000 (UTC) Received: by ewy18 with SMTP id 18so1772232ewy.43 for ; Sat, 10 Oct 2009 06:43:05 -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=PmjM5X8t0ydRx8Kg226bHUxD2lnuZKA/GezqLLyVJ+8=; b=Fb7STiVQYIvv99HedlUjx4PpgQQZiJCZm7qBVtpU/GuLdLF86lS+qidr/HT1r8F6P/ M6SsiUx7EwefalgptW2eP0g9VuLJKs28kUuIG4CCMUJ4zX+8fEpObE3dSpcTFF/w1n5t vbaiI1MuSD9VS4K8tyX5614wsLRwEOVDJYF/4= 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=AvO+WvWg5cWS/FLqXSoM9/1z+kZ4c6UMisc5b+HPxDnJjk/bZmbadtYKaG2ixapuGR JViaPDMZ8GuKDU7yepHmHrTNChbbIBngaiC/uGgnhwPBLE6uq8mPKgKNdrI8XCkDBSXB q5qQP2Wa/z50KOovbEBkuKrxoy5a044ignjOw= Received: by 10.210.152.4 with SMTP id z4mr4713879ebd.7.1255182185706; Sat, 10 Oct 2009 06:43:05 -0700 (PDT) Received: from localhost (vpn-195-69-246-94.customer.onet.com.ua [195.69.246.94]) by mx.google.com with ESMTPS id 5sm2351048eyh.10.2009.10.10.06.43.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 10 Oct 2009 06:43:04 -0700 (PDT) To: Alexander Best References: Organization: TOA Ukraine From: Mikolaj Golub Date: Sat, 10 Oct 2009 16:43:02 +0300 In-Reply-To: (Alexander Best's message of "Sat\, 10 Oct 2009 12\:34\:05 +0200 \(CEST\)") Message-ID: <86d44vqs9l.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: Sat, 10 Oct 2009 13:43:07 -0000 On Sat, 10 Oct 2009 12:34:05 +0200 (CEST) Alexander Best wrote: AB> thanks. this is a cool script and very useful indeed. only thing you might AB> want to do is check for root privileges at the beginning to avoid nasty error AB> messages like. AB> awk: can't open file /var/crash/info.0 AB> source line number 12 In some cases you might not need root privileges. E.g. on some servers I don't have root but SA gives me read access to crashdumps. In this case if the script had a check for root privileges I would not be able to use it. Actually as for me the message looks informative enough, it says that we have some problems with accessing crash dump files, so permissions should be checked. -- Mikolaj Golub From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 14:28: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 C19D4106566B for ; Sat, 10 Oct 2009 14:28:00 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from mx.nitro.dk (zarniwoop.nitro.dk [83.92.207.38]) by mx1.freebsd.org (Postfix) with ESMTP id 818AA8FC1F for ; Sat, 10 Oct 2009 14:28:00 +0000 (UTC) Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3]) by mx.nitro.dk (Postfix) with ESMTP id 95B8E2D4890; Sat, 10 Oct 2009 14:27:59 +0000 (UTC) Received: by arthur.nitro.dk (Postfix, from userid 1000) id 55D385C05; Sat, 10 Oct 2009 16:27:59 +0200 (CEST) Date: Sat, 10 Oct 2009 16:27:58 +0200 From: "Simon L. Nielsen" To: stef@memberwebs.com Message-ID: <20091010142758.GB1225@arthur.nitro.dk> References: <4ABBD5FA.5070507@memberwebs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ABBD5FA.5070507@memberwebs.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org Subject: Re: Is the FreeBSD ABI compatibility policy documented anywhere 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, 10 Oct 2009 14:28:00 -0000 On 2009.09.24 15:26:34 -0500, Stef Walter wrote: > It seems that FreeBSD has an ABI compatibility policy where major > versions remain ABI and API compatible throughout minor point versions. > That is to say that the kernel interfaces and libraries for (eg) > 7-STABLE, 7.1-RELEASE, 7.2-RELEASE are not supposed to change. It's not entirely that simple. The ABI on a stable branch like 7.x should be backward compatible, but there isn't a guarantee of forward compatibility. IE, 7.0 binary should be able to run on 7.x, but a 7.2 binary might not run on 7.0. It should be more or less the same with the API's. PS. do note that there is no 100% guarantee. At times the defacto policy might be violated if there are very good reasons for doing so. This would e.g. an important fix for something where the changed ABI, more likely K(kernel)BI, change should affect few people and the change is required for fixing some important bug. > Is this a policy of the project? If so, is it documented anywhere? Or is > it just a convention? I don't remember seeing it ever documented, just discussed. What I wrote above is also just my understanding of curreny defact policy. -- Simon L. Nielsen From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 17:11: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 8015210656C0; Sat, 10 Oct 2009 17:11:53 +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 419C88FC08; Sat, 10 Oct 2009 17:11:51 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id A0A516D41B; Sat, 10 Oct 2009 17:11:50 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 48F0684503; Sat, 10 Oct 2009 19:11:50 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Simon L. Nielsen" References: <4ABBD5FA.5070507@memberwebs.com> <20091010142758.GB1225@arthur.nitro.dk> Date: Sat, 10 Oct 2009 19:11:50 +0200 In-Reply-To: <20091010142758.GB1225@arthur.nitro.dk> (Simon L. Nielsen's message of "Sat, 10 Oct 2009 16:27:58 +0200") Message-ID: <86d44vp415.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, stef@memberwebs.com Subject: Re: Is the FreeBSD ABI compatibility policy documented anywhere 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, 10 Oct 2009 17:11:53 -0000 "Simon L. Nielsen" writes: > It's not entirely that simple. The ABI on a stable branch like 7.x > should be backward compatible, but there isn't a guarantee of forward > compatibility. IE, 7.0 binary should be able to run on 7.x, but a 7.2 > binary might not run on 7.0. It should be more or less the same with > the API's. > > PS. do note that there is no 100% guarantee. Correct, but we're getting closer to that now that we have symbol versioning - although we won't reach 100% until we have versioned symbols in *all* libraries, which is currently not the case. Even then, a developer might break the ABI by mistake, but hopefully we'd catch that before it made it into a release. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 18:11: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 8FCCB106566B for ; Sat, 10 Oct 2009 18:11:10 +0000 (UTC) (envelope-from alex-goncharov@comcast.net) Received: from QMTA11.westchester.pa.mail.comcast.net (qmta11.westchester.pa.mail.comcast.net [76.96.59.211]) by mx1.freebsd.org (Postfix) with ESMTP id 2A9788FC18 for ; Sat, 10 Oct 2009 18:11:09 +0000 (UTC) Received: from OMTA22.westchester.pa.mail.comcast.net ([76.96.62.73]) by QMTA11.westchester.pa.mail.comcast.net with comcast id r5i01c0071ap0As5B6BA53; Sat, 10 Oct 2009 18:11:10 +0000 Received: from daland.home ([24.61.85.144]) by OMTA22.westchester.pa.mail.comcast.net with comcast id r6Fl1c00X36qgMk3i6FmZk; Sat, 10 Oct 2009 18:15:47 +0000 Received: from algo by daland.home with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MwgPL-000Neg-W2; Sat, 10 Oct 2009 14:11:07 -0400 From: Alex Goncharov To: Dag-Erling Smørgrav In-reply-to: <86d44vp415.fsf@ds4.des.no> (message from Dag-Erling Smørgrav on Sat, 10 Oct 2009 19:11:50 +0200) References: <4ABBD5FA.5070507@memberwebs.com> <20091010142758.GB1225@arthur.nitro.dk> <86d44vp415.fsf@ds4.des.no> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: Sender: Alex Goncharov Date: Sat, 10 Oct 2009 14:11:07 -0400 Cc: freebsd-hackers@freebsd.org, stef@memberwebs.com, simon@FreeBSD.org Subject: Re: Is the FreeBSD ABI compatibility policy documented anywhere X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alex Goncharov List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Oct 2009 18:11:10 -0000 ,--- You/Dag-Erling (Sat, 10 Oct 2009 19:11:50 +0200) ----* | "Simon L. Nielsen" writes: | > It's not entirely that simple. The ABI on a stable branch like 7.x | > should be backward compatible, but there isn't a guarantee of forward | > compatibility. IE, 7.0 binary should be able to run on 7.x, but a 7.2 | > binary might not run on 7.0. It should be more or less the same with | > the API's. | | Correct, but we're getting closer to that now that we have symbol | versioning - although we won't reach 100% until we have versioned | symbols in *all* libraries, which is currently not the case. Even then, | a developer might break the ABI by mistake, but hopefully we'd catch | that before it made it into a release. It's important to note that symbol compatibility is not the whole thing -- the behaviour on exceptions may be equally important to some applications. E.g. CMUCL code has to handle different ways to notify of memory protection failures this way: #if __FreeBSD_version < 700004 #define PROTECTION_VIOLATION_SIGNAL SIGBUS #define PROTECTION_VIOLATION_CODE BUS_PAGE_FAULT #else #define PROTECTION_VIOLATION_SIGNAL SIGSEGV #define PROTECTION_VIOLATION_CODE SEGV_ACCERR #endif A CMUCL binary built on a pre-7.1 (?) release of FreeBSD, will crash almost immediately when run on 7.1 (well, "if memory serves"). -- Alex -- alex-goncharov@comcast.net -- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 18:21: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 C9A53106566B; Sat, 10 Oct 2009 18:21:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id B9ED58FC12; Sat, 10 Oct 2009 18:21:06 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n9AIKmJJ013162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Oct 2009 21:20:48 +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 n9AIKmn6084638; Sat, 10 Oct 2009 21:20:48 +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 n9AIKmcL084637; Sat, 10 Oct 2009 21:20:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 10 Oct 2009 21:20:48 +0300 From: Kostik Belousov To: Alex Goncharov Message-ID: <20091010182048.GD2259@deviant.kiev.zoral.com.ua> References: <4ABBD5FA.5070507@memberwebs.com> <20091010142758.GB1225@arthur.nitro.dk> <86d44vp415.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ikjtAgnMx2oLjqdX" Content-Disposition: inline In-Reply-To: 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: Dag-Erling =?koi8-r?B?U23DuHJncmF2?= , stef@memberwebs.com, simon@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: Is the FreeBSD ABI compatibility policy documented anywhere 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, 10 Oct 2009 18:21:08 -0000 --ikjtAgnMx2oLjqdX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 10, 2009 at 02:11:07PM -0400, Alex Goncharov wrote: > ,--- You/Dag-Erling (Sat, 10 Oct 2009 19:11:50 +0200) ----* > | "Simon L. Nielsen" writes: > | > It's not entirely that simple. The ABI on a stable branch like 7.x > | > should be backward compatible, but there isn't a guarantee of forward > | > compatibility. IE, 7.0 binary should be able to run on 7.x, but a 7.2 > | > binary might not run on 7.0. It should be more or less the same with > | > the API's. > |=20 > | Correct, but we're getting closer to that now that we have symbol > | versioning - although we won't reach 100% until we have versioned > | symbols in *all* libraries, which is currently not the case. Even then, > | a developer might break the ABI by mistake, but hopefully we'd catch > | that before it made it into a release. >=20 > It's important to note that symbol compatibility is not the whole > thing -- the behaviour on exceptions may be equally important to some > applications. E.g. CMUCL code has to handle different ways to notify > of memory protection failures this way: >=20 > #if __FreeBSD_version < 700004 > #define PROTECTION_VIOLATION_SIGNAL SIGBUS > #define PROTECTION_VIOLATION_CODE BUS_PAGE_FAULT > #else > #define PROTECTION_VIOLATION_SIGNAL SIGSEGV > #define PROTECTION_VIOLATION_CODE SEGV_ACCERR > #endif >=20 > A CMUCL binary built on a pre-7.1 (?) release of FreeBSD, will crash > almost immediately when run on 7.1 (well, "if memory serves"). This has been an issue for 7.0, and it was explicitely handled, see r174254. --ikjtAgnMx2oLjqdX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrQ0H8ACgkQC3+MBN1Mb4j0/QCgmO6ebLZv2r+7EXnXQXA/MMRA Ye0AoK+fpUt2MJctQ/tEvt3mm4VzIyk5 =IagP -----END PGP SIGNATURE----- --ikjtAgnMx2oLjqdX-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 18:41: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 0DDEC1065670 for ; Sat, 10 Oct 2009 18:41:06 +0000 (UTC) (envelope-from alex-goncharov@comcast.net) Received: from QMTA12.westchester.pa.mail.comcast.net (qmta12.westchester.pa.mail.comcast.net [76.96.59.227]) by mx1.freebsd.org (Postfix) with ESMTP id A39968FC1C for ; Sat, 10 Oct 2009 18:41:05 +0000 (UTC) Received: from OMTA14.westchester.pa.mail.comcast.net ([76.96.62.60]) by QMTA12.westchester.pa.mail.comcast.net with comcast id r6Rp1c0051HzFnQ5C6h5qY; Sat, 10 Oct 2009 18:41:05 +0000 Received: from daland.home ([24.61.85.144]) by OMTA14.westchester.pa.mail.comcast.net with comcast id r6h51c00236qgMk3a6h5Ve; Sat, 10 Oct 2009 18:41:05 +0000 Received: from algo by daland.home with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MwgsJ-000NnI-Ro; Sat, 10 Oct 2009 14:41:03 -0400 From: Alex Goncharov To: Kostik Belousov In-reply-to: <20091010182048.GD2259@deviant.kiev.zoral.com.ua> (message from Kostik Belousov on Sat, 10 Oct 2009 21:20:48 +0300) References: <4ABBD5FA.5070507@memberwebs.com> <20091010142758.GB1225@arthur.nitro.dk> <86d44vp415.fsf@ds4.des.no> <20091010182048.GD2259@deviant.kiev.zoral.com.ua> Message-Id: Sender: Alex Goncharov Date: Sat, 10 Oct 2009 14:41:03 -0400 Cc: des@des.no, simon@freebsd.org, stef@memberwebs.com, freebsd-hackers@freebsd.org, alex-goncharov@comcast.net Subject: Re: Is the FreeBSD ABI compatibility policy documented anywhere X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alex Goncharov List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Oct 2009 18:41:06 -0000 ,--- You/Kostik (Sat, 10 Oct 2009 21:20:48 +0300) ----* | > A CMUCL binary built on a pre-7.1 (?) release of FreeBSD, will crash | > almost immediately when run on 7.1 (well, "if memory serves"). | | This has been an issue for 7.0, and it was explicitely handled, see r174254. I know it was (I was the one who first ran into the problem, way back then). My point here was to state that the behavior on signals is almost as important as symbols' compatibility. As for "it was", see this few-days-old thread: http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/287d1a57226f0cda/a6805cf10ca0cab9?q=cmucl&lnk=nl& I found an even easier way to crash CMUCL 19c/19f on FreeBSD 7.1 where the last message was posted today. Although most messages there are totally unrelated to CMUCL, FreeBSD (in fact, almost anything relevant), somebody, somewhere still hit the issue a few days ago (I am not inclined to analyze his environment, frankly). The question, "Will a FreeBSD 7.2 (e.g.) build run all right on FreeBSD 8.0 (e.g.)?", is often asked, and I think it is impossible to give any guarantees -- the best one can realistically say, is, "probably" (with compatibility libraries, in some case). At least, I don't give any assurances for the binaries I upload to http://common-lisp.net/project/cmucl/downloads: I build against the latest code on a few branches of FreeBSD (RELENG and CURRENT) -- and if a 7.2 build runs for you on 7.1 and/or 8.0, you are in luck (and I do expect this), but it may not, and who will tell you it will, without trying? -- Alex -- alex-goncharov@comcast.net --