From owner-svn-src-all@FreeBSD.ORG Wed Jan 16 19:16:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B52B4E29; Wed, 16 Jan 2013 19:16:29 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f43.google.com (mail-oa0-f43.google.com [209.85.219.43]) by mx1.freebsd.org (Postfix) with ESMTP id 482C4696; Wed, 16 Jan 2013 19:16:29 +0000 (UTC) Received: by mail-oa0-f43.google.com with SMTP id k1so1794625oag.16 for ; Wed, 16 Jan 2013 11:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=PfE5plrmjIScF6K2NEHNjfra4MtNR+xedh3tJbL4oHg=; b=ovdVXxtJ/Ps+eRutqGZtwcEXgm24BhQFs3pzrM/QfbUYDf65Or8wGKAF1O5ujkycp6 NlypO5lZySX4YmS3hiyWRHcfyNfRLgbfr0S/ncluR/jPVEZEzheK0yY8ng/YuikN+XOO JS5V++dYdG8PHCoY05cTKkUGI9vNx1t5vBEaXGYkEzxW9xkGcjiE99IyCg4DTz4NgSlC FtngHxb9O0yfS8hvZlESTCEFxg9QonJEwZZsIeDSp2p1GCFoVGVrSe/5dSRHfmZzhXBO aL0VmmVL1NolnaRTHihuWOmdeqRxQLq0z9cJGkMwtd1AhflSnOrc3X3y9okF46aGva5/ ti5Q== MIME-Version: 1.0 X-Received: by 10.60.0.165 with SMTP id 5mr1766712oef.128.1358363783274; Wed, 16 Jan 2013 11:16:23 -0800 (PST) Received: by 10.76.107.241 with HTTP; Wed, 16 Jan 2013 11:16:23 -0800 (PST) In-Reply-To: <50F6F450.50102@delphij.net> References: <201301160503.r0G53qie087155@svn.freebsd.org> <50F6ED68.50602@delphij.net> <0928E58E-F510-47CD-957F-8C321B1210CC@gmail.com> <50F6F450.50102@delphij.net> Date: Wed, 16 Jan 2013 11:16:23 -0800 Message-ID: Subject: Re: svn commit: r245494 - head/bin/pwait From: Garrett Cooper To: d@delphij.net Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , Xin LI , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Eitan Adler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2013 19:16:29 -0000 On Wed, Jan 16, 2013 at 10:41 AM, Xin Li wrote: ... > Well, calling exit(3) actually do less on C++ (dtor's are not called > in this case, if any local object is declared on stack, which is done > when the code say 'return') but the difference is less on C. Good to know -- thanks! > In style(9) there is no explicit mention of using exit(3) but the > example do use exit() instead of return() for main(). There's a fair amount of subtlety in style(9) ;)... > By the way speaking for exit(3) preventing bugs on other OSes, do you > have reference to these issue? It sounds weird as I would see these > as serious leakage which are normally fixed very quickly and we > shouldn't be the first people who seeing them... It wasn't really leakage, and it was only Windows (AFAICT) which is its own special case. MSVC++ has copious warnings about using POSIX APIs anyhow, so I figure it's a bad idea to depend on POSIX on Windows :(... There's a program that we have at $work that does dd equivalent logic for writing/verifying files and what was happening is that whenever the atexit handler was entered (basically whenever the terminating condition was met) it would segfault on Windows. It might have been a bug in terms of it entering the atexit(3) handler recursively (which didn't occur on other OSes, e.g. FreeBSD, Linux, and OSX), but I didn't take the time to track down the exact culprit (my goal was to only stop the bleeding ;)..). Thanks! -Garrett