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 <[email protected]> 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 <
> [email protected]> 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 [email protected].
>> 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 [email protected].
> 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 [email protected].
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.

Reply via email to