[Mesa-dev] Let's enable _GLIBCXX_ASSERTIONS=1 on mesa debug builds

Matt Turner mattst88 at gmail.com
Fri Sep 10 20:33:01 UTC 2021

On Fri, Sep 10, 2021 at 10:20 AM Timur Kristóf <timur.kristof at gmail.com> wrote:
> Hi,
> We've been recently working on tracking down some "mysterious" crashes
> that some users experienced on distro builds of mesa but we couldn't
> reproduce locally, until we found out about _GLIBCXX_ASSERTIONS=1 which
> seems to be not enabled by default in mesa, but is enabled by a lot of
> distros.
> I realize that enabling it by default on all mesa builds would have
> performance implications, so I propose to just enable it by default in
> mesa debug builds.
> What do you think? Would this be okay with the mesa community?

I've never heard of this before. According to the documentation [1] it is:

> Undefined by default. When defined, enables extra error checking in the form of precondition assertions, such as bounds checking in strings and null pointer checks when dereferencing smart pointers.

Seems reasonable to enable it for debug builds if we're using C++
features in Mesa that it covers.

[1] https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html

More information about the mesa-dev mailing list