[libc++]

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[libc++]

Romanenkov Kirill via cfe-dev
Hi,

compiling a C++ application with UBSan enabled, I get a couple of
alignment-related errors from UBSan on std::map-related functions. The
map is of type std::map<int, std::function<void()>>.

Relevant messages: https://gist.github.com/hesiod/3f978eace168609af37a2
1ca26e7adc0

This occured with libc++ 3.8.0 and clang/llvm 3.9.1 on Arch Linux.

Tobias

PS: Please make sure to include me in all replies since I am not
subscribed to cfe-dev.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [libc++]

Romanenkov Kirill via cfe-dev
Hi,

There use to be known UBSAN failures in libc++, they have been fixed as of now AFAIK (most in 3.9).

Best,


Mehdi

> On Feb 13, 2017, at 6:56 AM, Tobias Markus via cfe-dev <[hidden email]> wrote:
>
> Hi,
>
> compiling a C++ application with UBSan enabled, I get a couple of
> alignment-related errors from UBSan on std::map-related functions. The
> map is of type std::map<int, std::function<void()>>.
>
> Relevant messages: https://gist.github.com/hesiod/3f978eace168609af37a2
> 1ca26e7adc0
>
> This occured with libc++ 3.8.0 and clang/llvm 3.9.1 on Arch Linux.
>
> Tobias
>
> PS: Please make sure to include me in all replies since I am not
> subscribed to cfe-dev.
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [libc++]

Romanenkov Kirill via cfe-dev
I have only come across reports of -fsanitize=object-size violations in libcxx, never alignment issues. However, this is a fairly old version of libc++, and the issues may have been fixed already.

Tobias, can you provide instructions on how to reproduce this issue?

vedant


> On Feb 13, 2017, at 8:33 AM, Mehdi Amini via cfe-dev <[hidden email]> wrote:
>
> Hi,
>
> There use to be known UBSAN failures in libc++, they have been fixed as of now AFAIK (most in 3.9).
>
> Best,
>
> —
> Mehdi
>
>> On Feb 13, 2017, at 6:56 AM, Tobias Markus via cfe-dev <[hidden email]> wrote:
>>
>> Hi,
>>
>> compiling a C++ application with UBSan enabled, I get a couple of
>> alignment-related errors from UBSan on std::map-related functions. The
>> map is of type std::map<int, std::function<void()>>.
>>
>> Relevant messages: https://gist.github.com/hesiod/3f978eace168609af37a2
>> 1ca26e7adc0
>>
>> This occured with libc++ 3.8.0 and clang/llvm 3.9.1 on Arch Linux.
>>
>> Tobias
>>
>> PS: Please make sure to include me in all replies since I am not
>> subscribed to cfe-dev.
>> _______________________________________________
>> cfe-dev mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [libc++]

Romanenkov Kirill via cfe-dev


On Mon, Feb 13, 2017 at 3:31 PM, Vedant Kumar via cfe-dev <[hidden email]> wrote:
I have only come across reports of -fsanitize=object-size violations in libcxx, never alignment issues. However, this is a fairly old version of libc++, and the issues may have been fixed already.

The alignment violations occur for the same reasons the object-size violations do, except that the value_type has stricter alignment requirements instead of being too large.

These violations should be fixed in the associative containers in v3.9 (ex. map set). Similar violations in the unordered containers were only fixed in v4.0.

I'm confident that these UBSAN issues have already been addressed.

/Eric

 

Tobias, can you provide instructions on how to reproduce this issue?

vedant


> On Feb 13, 2017, at 8:33 AM, Mehdi Amini via cfe-dev <[hidden email]> wrote:
>
> Hi,
>
> There use to be known UBSAN failures in libc++, they have been fixed as of now AFAIK (most in 3.9).
>
> Best,
>
> —
> Mehdi
>
>> On Feb 13, 2017, at 6:56 AM, Tobias Markus via cfe-dev <[hidden email]> wrote:
>>
>> Hi,
>>
>> compiling a C++ application with UBSan enabled, I get a couple of
>> alignment-related errors from UBSan on std::map-related functions. The
>> map is of type std::map<int, std::function<void()>>.
>>
>> Relevant messages: https://gist.github.com/hesiod/3f978eace168609af37a2
>> 1ca26e7adc0
>>
>> This occured with libc++ 3.8.0 and clang/llvm 3.9.1 on Arch Linux.
>>
>> Tobias
>>
>> PS: Please make sure to include me in all replies since I am not
>> subscribed to cfe-dev.
>> _______________________________________________
>> cfe-dev mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [libc++]

Romanenkov Kirill via cfe-dev
In reply to this post by Romanenkov Kirill via cfe-dev
See here for similar misaligned failure in __tree: https://bugs.llvm.org//show_bug.cgi?id=19302#c9

(I can only assume Eric fixes all of them, but at least we don’t have any blacklist anymore on our UBSAN bots AFAIK)


Mehdi



> On Feb 13, 2017, at 2:31 PM, Vedant Kumar <[hidden email]> wrote:
>
> I have only come across reports of -fsanitize=object-size violations in libcxx, never alignment issues. However, this is a fairly old version of libc++, and the issues may have been fixed already.
>
> Tobias, can you provide instructions on how to reproduce this issue?
>
> vedant
>
>
>> On Feb 13, 2017, at 8:33 AM, Mehdi Amini via cfe-dev <[hidden email]> wrote:
>>
>> Hi,
>>
>> There use to be known UBSAN failures in libc++, they have been fixed as of now AFAIK (most in 3.9).
>>
>> Best,
>>
>> —
>> Mehdi
>>
>>> On Feb 13, 2017, at 6:56 AM, Tobias Markus via cfe-dev <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> compiling a C++ application with UBSan enabled, I get a couple of
>>> alignment-related errors from UBSan on std::map-related functions. The
>>> map is of type std::map<int, std::function<void()>>.
>>>
>>> Relevant messages: https://gist.github.com/hesiod/3f978eace168609af37a2
>>> 1ca26e7adc0
>>>
>>> This occured with libc++ 3.8.0 and clang/llvm 3.9.1 on Arch Linux.
>>>
>>> Tobias
>>>
>>> PS: Please make sure to include me in all replies since I am not
>>> subscribed to cfe-dev.
>>> _______________________________________________
>>> cfe-dev mailing list
>>> [hidden email]
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>> _______________________________________________
>> cfe-dev mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [libc++] UBSan reports alignment errors in std::map

Romanenkov Kirill via cfe-dev
In reply to this post by Romanenkov Kirill via cfe-dev
Hi,

I just realized that the reason the libc++ I have installed is rather old is
that Arch recently dropped libc++ from the community repository (and thus there
weren't any updates).

As you said, the issue will probably disappear with a newer libc++, so I will go
ahead and try that. Sorry for the noise.

Regards
Tobias

On Mon, 2017-02-13 at 14:31 -0800, Vedant Kumar wrote:

> I have only come across reports of -fsanitize=object-size violations in
> libcxx, never alignment issues. However, this is a fairly old version of
> libc++, and the issues may have been fixed already.
>
> Tobias, can you provide instructions on how to reproduce this issue?
>
> vedant
>
>
> > On Feb 13, 2017, at 8:33 AM, Mehdi Amini via cfe-dev <[hidden email]
> > > wrote:
> >
> > Hi,
> >
> > There use to be known UBSAN failures in libc++, they have been fixed as of
> > now AFAIK (most in 3.9).
> >
> > Best,
> >
> > — 
> > Mehdi
> >
> > > On Feb 13, 2017, at 6:56 AM, Tobias Markus via cfe-dev <[hidden email]
> > > .org> wrote:
> > >
> > > Hi,
> > >
> > > compiling a C++ application with UBSan enabled, I get a couple of
> > > alignment-related errors from UBSan on std::map-related functions. The
> > > map is of type std::map<int, std::function<void()>>.
> > >
> > > Relevant messages: https://gist.github.com/hesiod/3f978eace168609af37a2
> > > 1ca26e7adc0
> > >
> > > This occured with libc++ 3.8.0 and clang/llvm 3.9.1 on Arch Linux.
> > >
> > > Tobias
> > >
> > > PS: Please make sure to include me in all replies since I am not
> > > subscribed to cfe-dev.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev