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

2021-09-10 Thread Matt Turner
On Fri, Sep 10, 2021 at 2:19 PM Timur Kristóf  wrote:
> Matt Turner  ezt írta (időpont: 2021. szept. 10., P 
> 22:33):
>>
>> On Fri, Sep 10, 2021 at 10:20 AM Timur Kristóf  
>> 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:
>>
>> > _GLIBCXX_ASSERTIONS
>> >
>> > 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.


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

2021-09-10 Thread Timur Kristóf
Matt Turner  ezt írta (időpont: 2021. szept. 10., P
22:33):

> On Fri, Sep 10, 2021 at 10:20 AM Timur Kristóf 
> 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:
>
> > _GLIBCXX_ASSERTIONS
> >
> > 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.


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


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

2021-09-10 Thread Marek Olšák
Yes, this would be useful.

Marek


On Fri, Sep 10, 2021 at 1:20 PM Timur Kristóf 
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?
>
> Thanks & best regards,
> Timur
>
>
>


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

2021-09-10 Thread Matt Turner
On Fri, Sep 10, 2021 at 10:20 AM Timur Kristóf  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:

> _GLIBCXX_ASSERTIONS
>
> 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


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

2021-09-10 Thread Timur Kristóf
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?

Thanks & best regards,
Timur