public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Adam Sampson <ats@offog.org>
Cc: xfs@oss.sgi.com
Subject: Re: [ANNOUNCE] xfsprogs: v3.2.0 released!
Date: Tue, 20 May 2014 18:27:24 +1000	[thread overview]
Message-ID: <20140520082724.GJ18954@dastard> (raw)
In-Reply-To: <20140519025553.GB8554@dastard>

On Mon, May 19, 2014 at 12:55:53PM +1000, Dave Chinner wrote:
> On Sat, May 17, 2014 at 11:53:08AM +0100, Adam Sampson wrote:
> > Dave Chinner <david@fromorbit.com> writes:
> > 
> > > [...] it's preferable to have things like xfs_repair abort when it
> > > comes across an inconsistency it can't handle than to continue blindly
> > > along and making a bigger mess of the filesystem it's supposed to be
> > > fixing...
> > 
> > Yes -- that's why I was building with DEBUG= on previous releases
> > (i.e. I want assertions enabled). doc/INSTALL says that DEBUG=-DNDEBUG
> > disables assertions, so packagers are quite likely to have DEBUG= in
> > their build process.
> 
> Hmmm - so, not being an everyday userspace programmer, it didn't
> even occur to me that "-DNDEBUG" actually changes libc header
> behaviour, not anything to do with the XFS code.
> 
> $ man assert
> .....
> BUGS
>        assert()  is  implemented as a macro; if the expression
>        tested has side-effects, program behavior will be different
>        depending on whether NDEBUG is defined.  This may create
>        Heisenbugs which go away when debugging is turned on.
> 
> Yup, it's oh so obvious now that "NDEBUG" is something owned by
> system library code, not the xfsprogs package...
> 
> <sigh>
> 
> > > Anyway, we'll look to fix it for 3.2.1.
> 
> Or maybe not. The intent of always turning off the asserts is that
> code like xfs_repair shouldn't assert fail when stuff it detected as
> out of bounds in a library function. IOWs, you're quite likely to
> unintentionally break repair by removing the NDEBUG define to
> re-instate the library asserts...

And it's not straight forward, either, because some of the ASSERT()s
have code in them that is only present when the libxfs code is built
with -DDEBUG, so compiling in the asserts without enabling -DDEBUG is
not going to work. And, well, compiling with -DDEBUG itself deosn't
work nor with -DNDEBUG -DDEBUG because -DDEBUG enables code that has
unhandled kernelisms in it.

So, right now, don't remove -NDEBUG from the libxfs/Makefile. It's
there for a good reason right now. i.e. removing it requires some
non-trivial work, and even if we do make it compile the resultant
code will probably not work (i.e. assert fail unnecessarily) given
the requirements that userspace has for tolerance of inconsistent
on-disk states.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2014-05-20  8:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16  5:56 [ANNOUNCE] xfsprogs: v3.2.0 released! Dave Chinner
2014-05-16 23:02 ` Adam Sampson
2014-05-17  0:23   ` Dave Chinner
2014-05-17  1:01     ` Eric Sandeen
2014-05-17 10:53     ` Adam Sampson
2014-05-19  2:55       ` Dave Chinner
2014-05-20  8:27         ` Dave Chinner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140520082724.GJ18954@dastard \
    --to=david@fromorbit.com \
    --cc=ats@offog.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox