FYI: There was another report of this problem, in our bug tracker:
https://crbug.com/v8/13630

On Mon, Dec 19, 2022 at 6:21 PM Nikos Papaspyrou <[email protected]>
wrote:

> For completeness:
>
>    - Originally https://crrev.com/c/3960991 introduced Stack in
>    ThreadLocalTop; at that time, Stack had just two pointer fields and was a
>    standard-layout class. I don't think there was anything fishy then.
>    - Later, https://crrev.com/c/4017512 modified the Stack object, adding
>    a std::unique_ptr. This is probably fishy, as in g++ smart pointers are
>    considered to have standard-layout, whereas in clang++ they are not. (cc:
>    mlippautz@ because we had explicitly discussed this)
>    - Later, https://crrev.com/c/4081126 modified the Stack object again,
>    adding a std::vector of standard layout structures. This could also be
>    fishy, but it seems to be ok both in g++ and clang++. (cc:thibaud@ for
>    that CL).
>
> I suppose we need a C++ language lawyer. :-)
> If the verdict is negative, we could convert the std::unique_ptr to a raw
> pointer and the vector to a linked list data structure.
>
> On Mon, Dec 19, 2022 at 6:36 PM Clemens Backes <[email protected]>
> wrote:
>
>> You probably found my refactoring (https://crrev.com/c/3647353) via git
>> blame. Looks like the addition of ::heap::base::Stack to ThreadLocalTop (
>> https://crrev.com/c/3960991, [email protected]
>> <[email protected]>) broke the is_standard_layout assertion that was
>> added in 2018 (https://crrev.com/c/1278793, [email protected]
>> <[email protected]>).
>>
>> The standard layout requirement is there to ensure that the offsetof
>> expressions are actually well-defined. Having a std::unique_ptr and a
>> std::vector in a class that is required to have standard layout indeed
>> looks fishy.
>>
>> On Mon, Dec 19, 2022 at 2:02 PM Ben Noordhuis <[email protected]> wrote:
>>
>>> On Mon, Dec 19, 2022 at 1:43 PM Immanuel Haffner
>>> <[email protected]> wrote:
>>> >
>>> > I am currently facing issues building V8 at version 11.0.226 for
>>> embedding in my application. Compilation of several source files fails with
>>> the following error:
>>> >
>>> >
>>> ../../../../../../third-party/v8/v8/src/execution/isolate-data.h:279:3:
>>> error: static_assert failed due to requirement
>>> 'std::is_standard_layout<v8::internal::ThreadLocalTop>::value'
>>> >   static_assert(std::is_standard_layout<ThreadLocalTop>::value);
>>> >   ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> >
>>> ../../../../../../third-party/v8/v8/src/execution/isolate-data.h:281:3:
>>> error: static_assert failed due to requirement
>>> 'std::is_standard_layout<v8::internal::IsolateData>::value'
>>> >   static_assert(std::is_standard_layout<IsolateData>::value);
>>> >   ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> > 1 warning and 2 errors generated.
>>> >
>>> > I compile V8 with flags
>>> >
>>> > is_clang=true clang_base_path=\"/usr\" use_lld=false use_gold=true
>>> v8_enable_pointer_compression=true treat_warnings_as_errors=false
>>> v8_use_external_startup_data=false use_sysroot=false
>>> use_custom_libcxx=false clang_use_chrome_plugins=false target_cpu=\"x64\""
>>> >
>>> > I have tried both my system Clang and Google's toolchain. The
>>> compilation error is the same. My system clang is on 14.0.6.
>>> >
>>> > Git blame tells me @Clemens Backes is the author of the respective
>>> lines of code.
>>> > I hope you or someone else can help me out.
>>>
>>> IsolateData embeds ThreadLocalTop embeds Stack embeds std::unique_ptr
>>> and std::vector. Those last two are likely not standard layout types
>>> on your system.
>>>
>>> --
>>> --
>>> v8-dev mailing list
>>> [email protected]
>>> http://groups.google.com/group/v8-dev
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "v8-dev" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/v8-dev/CAHQurc_vTA009ypjv8umvpCXj7JZEbOMKmR9rWy8mBvTx_ONhw%40mail.gmail.com
>>> .
>>>
>>
>>
>> --
>>
>> Clemens Backes
>>
>> Software Engineer
>>
>> [email protected]
>>
>> Google Germany GmbH
>>
>> Erika-Mann-Straße 33
>>
>> 80636 München
>>
>> Geschäftsführer: Paul Manicle, Liana Sebastian
>>
>> Registergericht und -nummer: Hamburg, HRB 86891
>>
>> Sitz der Gesellschaft: Hamburg
>>
>> Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten
>> haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter,
>> löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen,
>> dass die E-Mail an die falsche Person gesendet wurde.
>>
>>
>> This e-mail is confidential. If you received this communication by
>> mistake, please don't forward it to anyone else, please erase all copies
>> and attachments, and please let me know that it has gone to the wrong
>> person.
>>
>>
>> Nikolaos Papaspyrou
>
> Software Engineer
>
> [email protected]
>
>
> Google Germany GmbH
>
> Erika-Mann-Straße 33
>
> 80636 München
>
>
> Geschäftsführer: Paul Manicle, Liana Sebastian
>
> Registergericht und -nummer: Hamburg, HRB 86891
>
> Sitz der Gesellschaft: Hamburg
>
>
> Diese E-Mail ist vertraulich. Falls Sie diese fälschlicherweise erhalten
> haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter,
> löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen,
> dass die E-Mail an die falsche Person gesendet wurde.
>
>
>
> This e-mail is confidential. If you received this communication by
> mistake, please don't forward it to anyone else, please erase all copies
> and attachments, and please let me know that it has gone to the wrong
> person.
>


-- 

Clemens Backes

Software Engineer

[email protected]

Google Germany GmbH

Erika-Mann-Straße 33

80636 München

Geschäftsführer: Paul Manicle, Liana Sebastian

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten
haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter,
löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen,
dass die E-Mail an die falsche Person gesendet wurde.


This e-mail is confidential. If you received this communication by mistake,
please don't forward it to anyone else, please erase all copies and
attachments, and please let me know that it has gone to the wrong person.

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/CAGO%3DqhBWi%3DTAsJ6WTHgaziUEj6_NZgcQj02QHSq_ouHG0OHgKw%40mail.gmail.com.

Reply via email to