Thanks, Thomas.

As this is a confirmed issue now, I went ahead and created an issue to
track it: https://github.com/emscripten-core/emscripten/issues/13324


Maksim


On Mon, Jan 25, 2021 at 8:58 PM 'Thomas Lively' via emscripten-discuss <
emscripten-discuss@googlegroups.com> wrote:

> Thanks, I am able to reproduce the issue locally. Looking into it now.
>
> On Thu, Jan 21, 2021 at 7:15 PM 'Maksim Ivanov' via emscripten-discuss <
> emscripten-discuss@googlegroups.com> wrote:
>
>> The minimized repro is:
>>
>> #include <gmock/gmock.h>
>> #include <gtest/gtest.h>
>> class A final {
>>  public:
>>   MOCK_METHOD0(Foo, void());
>> };
>> TEST(Some, DISABLED_Basic) {
>>   A a;
>>   EXPECT_CALL(a, Foo());
>> }
>>
>> Googletest/mock are 1.10.0.
>>
>>
>> Maksim
>>
>>
>> On Fri, Jan 22, 2021 at 1:07 AM Maksim Ivanov <em...@google.com> wrote:
>>
>>> Thanks, Alon.
>>> I added this flag and, indeed, it's an infinite recursion.
>>>
>>> I'll update this thread once I have a minimized repro sample to share.
>>>
>>>
>>> Maksim
>>>
>>>
>>> On Fri, Jan 22, 2021 at 12:06 AM Alon Zakai <alonza...@gmail.com> wrote:
>>>
>>>> Different versions of node may truncate the stack to different
>>>> defaults. But it is configurable, try
>>>>
>>>> node --stack-trace-limit=1000
>>>>
>>>> On Thu, Jan 21, 2021 at 2:53 PM 'Maksim Ivanov' via emscripten-discuss <
>>>> emscripten-discuss@googlegroups.com> wrote:
>>>>
>>>>> @Alon: Hard to say whether it's an infinite recursion - the snippet I
>>>>> attached is all what's output. Can it be that something truncates the 
>>>>> stack
>>>>> before printing, without leaving any trace of what was truncated?
>>>>> My other hypothesis was that some code generated by UBSan allocates
>>>>> huge variables on stack; again, I don't know how to verify that.
>>>>>
>>>>> @Thomas: Sure; I'll probably be able to do it in a couple of days,
>>>>> after minimizing the repro and removing irrelevant details from it.
>>>>>
>>>>>
>>>>> Maksim
>>>>>
>>>>>
>>>>> On Thu, Jan 21, 2021 at 11:49 PM 'Thomas Lively' via
>>>>> emscripten-discuss <emscripten-discuss@googlegroups.com> wrote:
>>>>>
>>>>>> I've seen reports of infinite recursions involving
>>>>>> __ubsan_handle_dynamic_type_cache_miss before, but I've never been able 
>>>>>> to
>>>>>> reproduce them to investigate. Would you be able to share your 
>>>>>> reproducer?
>>>>>>
>>>>>> On Thu, Jan 21, 2021 at 2:24 PM Alon Zakai <alonza...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Does the stack trace look like it's an infinite recursion? That
>>>>>>> could be a toolchain bug.
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Jan 20, 2021 at 11:58 AM 'Maksim Ivanov' via
>>>>>>> emscripten-discuss <emscripten-discuss@googlegroups.com> wrote:
>>>>>>>
>>>>>>>> Hello, does anyone have a tip on how to work around the "Maximum
>>>>>>>> call stack size exceeded" error when running a UBsan-sanitized 
>>>>>>>> Emscripten
>>>>>>>> program under Node?
>>>>>>>>
>>>>>>>> The error is:
>>>>>>>>
>>>>>>>> "RangeError: Maximum call stack size exceeded
>>>>>>>>     at _emscripten_return_address (a.out.js:6788:35)
>>>>>>>>     at __ubsan_handle_dynamic_type_cache_miss
>>>>>>>> (wasm-function[8220]:0x210eb3)
>>>>>>>>     at std::type_info::operator==(std::type_info const&) const
>>>>>>>> (wasm-function[938]:0x648b3)
>>>>>>>>     at is_equal(std::type_info const*, std::type_info const*, bool)
>>>>>>>> (wasm-function[8154]:0x20a911)
>>>>>>>>     at __dynamic_cast (wasm-function[8156]:0x20aa48)
>>>>>>>>     at __ubsan::checkDynamicType(void*, void*, unsigned long)
>>>>>>>> (wasm-function[8196]:0x20f1b9)
>>>>>>>>     at
>>>>>>>> HandleDynamicTypeCacheMiss(__ubsan::DynamicTypeCacheMissData*, unsigned
>>>>>>>> long, unsigned long, __ubsan::ReportOptions) 
>>>>>>>> (wasm-function[8221]:0x210f03)
>>>>>>>>     at __ubsan_handle_dynamic_type_cache_miss
>>>>>>>> (wasm-function[8220]:0x210ed7)
>>>>>>>>     at std::type_info::operator==(std::type_info const&) const
>>>>>>>> (wasm-function[938]:0x648b3)
>>>>>>>>     at is_equal(std::type_info const*, std::type_info const*, bool)
>>>>>>>> (wasm-function[8154]:0x20a911)"
>>>>>>>>
>>>>>>>> I'm not 100% sure, but it seems that the error doesn't indicate a
>>>>>>>> bug in the program, because it doesn't appear when compiling a small
>>>>>>>> program (e.g., a Googletest binary with 0 tests) and begins to appear 
>>>>>>>> even
>>>>>>>> after adding unused code (e.g., a bunch of disabled Googletest tests).
>>>>>>>>
>>>>>>>> I tried passing "--stack_size=8192" to Node, but this didn't help;
>>>>>>>> also, when increasing the number (e.g., to 131072) I'm starting to get 
>>>>>>>> a
>>>>>>>> different error:
>>>>>>>>
>>>>>>>> RuntimeError: memory access out of bounds
>>>>>>>>     at __dynamic_cast (wasm-function[8156]:0x20aa0f)
>>>>>>>>     at __ubsan::checkDynamicType(void*, void*, unsigned long)
>>>>>>>> (wasm-function[8196]:0x20f1b9)
>>>>>>>>     at
>>>>>>>> HandleDynamicTypeCacheMiss(__ubsan::DynamicTypeCacheMissData*, unsigned
>>>>>>>> long, unsigned long, __ubsan::ReportOptions) 
>>>>>>>> (wasm-function[8221]:0x210f03)
>>>>>>>>     at __ubsan_handle_dynamic_type_cache_miss
>>>>>>>> (wasm-function[8220]:0x210ed7)
>>>>>>>>     at std::type_info::operator==(std::type_info const&) const
>>>>>>>> (wasm-function[938]:0x648b3)
>>>>>>>>     at is_equal(std::type_info const*, std::type_info const*, bool)
>>>>>>>> (wasm-function[8154]:0x20a911)
>>>>>>>>     at __dynamic_cast (wasm-function[8156]:0x20aa48)
>>>>>>>>     at __ubsan::checkDynamicType(void*, void*, unsigned long)
>>>>>>>> (wasm-function[8196]:0x20f1b9)
>>>>>>>>     at
>>>>>>>> HandleDynamicTypeCacheMiss(__ubsan::DynamicTypeCacheMissData*, unsigned
>>>>>>>> long, unsigned long, __ubsan::ReportOptions) 
>>>>>>>> (wasm-function[8221]:0x210f03)
>>>>>>>>     at __ubsan_handle_dynamic_type_cache_miss
>>>>>>>> (wasm-function[8220]:0x210ed7)
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "emscripten-discuss" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an email to emscripten-discuss+unsubscr...@googlegroups.com.
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/8c9c6b8b-a4b1-427c-965c-5828f8fa8fe9n%40googlegroups.com
>>>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/8c9c6b8b-a4b1-427c-965c-5828f8fa8fe9n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "emscripten-discuss" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to emscripten-discuss+unsubscr...@googlegroups.com.
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpRAZ87AKvva7HxffLjQa64rGHk%3Dp%3DxfiWjgRO6X0iZzVg%40mail.gmail.com
>>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpRAZ87AKvva7HxffLjQa64rGHk%3Dp%3DxfiWjgRO6X0iZzVg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "emscripten-discuss" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to emscripten-discuss+unsubscr...@googlegroups.com.
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/emscripten-discuss/CAJZD_EWHYYeb6q8TU690PR%2Bk%3DtpBPAEU%2Bp6fp_Xvi%3DDiaHWKyg%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/CAJZD_EWHYYeb6q8TU690PR%2Bk%3DtpBPAEU%2Bp6fp_Xvi%3DDiaHWKyg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "emscripten-discuss" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to emscripten-discuss+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/emscripten-discuss/CAH%3DwB8wGU1PO2UJw1die2A6xHWAhAeNADvfryG8Jo8nbKdQhdA%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/CAH%3DwB8wGU1PO2UJw1die2A6xHWAhAeNADvfryG8Jo8nbKdQhdA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "emscripten-discuss" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to emscripten-discuss+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpTqgwkOxBvYH5539nvZ9JuGePDKi10jmFzEN_nhSe-gnA%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpTqgwkOxBvYH5539nvZ9JuGePDKi10jmFzEN_nhSe-gnA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>
>> Maksim Ivanov
>>
>> Software Engineer
>>
>> em...@google.com
>> +49 (0)176 65889070 <+49%20176%2065889070>
>>
>>
>> Google Germany GmbH
>>
>> Erika-Mann-Straße 33
>>
>> 80331 München
>>
>>
>> Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
>>
>> Registergericht und -nummer: Hamburg, HRB 86891
>>
>> Sitz der Gesellschaft: Hamburg
>>
>>
>> Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind,
>> leiten Sie diese bitte nicht weiter, informieren Sie den Absender und
>> löschen Sie die E-Mail und alle Anhänge. Vielen Dank.
>>
>>
>>
>> This e-mail is confidential. If you are not the right addressee please do
>> not forward it, please inform the sender, and please erase this e-mail
>> including any attachments. Thanks.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to emscripten-discuss+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/emscripten-discuss/CAH%3DwB8wP71fpX4NxvwFBifZf_Wzqozi-FAMfBbSE2-Un74o%2BAw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/emscripten-discuss/CAH%3DwB8wP71fpX4NxvwFBifZf_Wzqozi-FAMfBbSE2-Un74o%2BAw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emscripten-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/CAJZD_EVETdfzrchHrqQNoH8WgemDv2HGAJhDPw6QyX-5sZL51Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/emscripten-discuss/CAJZD_EVETdfzrchHrqQNoH8WgemDv2HGAJhDPw6QyX-5sZL51Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAH%3DwB8wcmf2zo9pK6qeK%2BU0Ou2ZVTwK1%3D--0wGoJJYtEHUfREQ%40mail.gmail.com.

Reply via email to