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

Matt Turner mattst88 at gmail.com
Fri Sep 10 21:41:33 UTC 2021

On Fri, Sep 10, 2021 at 2:19 PM Timur Kristóf <timur.kristof at gmail.com> wrote:
> Matt Turner <mattst88 at gmail.com> ezt írta (időpont: 2021. szept. 10., P 22:33):
>> 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.
> While at it, do you think we should also use any of the other similar macros from the doc?
> I think _GLIBCXX_DEBUG and _GLIBCXX_SANITIZE_VECTOR look particularly useful.

Yeah, those seem reasonable as well. Don't know if we have the ability
to enable _GLIBCXX_SANITIZE_VECTOR only with ASan or not (or whether
it does something without ASan also enabled), but that might be worth
looking into.

More information about the mesa-dev mailing list