I guess this means that under ASAN, the stack is not allocated in the
traditional way. For some reason there's a 1MB offset between where the
ExceptionCallback was allocated and where a local variable inside its
constructor was allocated.

The check there is pretty hacky and probably technically UB. It's meant to
detect and warn about bad usage. Assuming the ExceptionCallback is, in
fact, being allocated on the stack, then the exception is bogus. I suppose
we may need to #ifdef it out when ASAN is active, or find some other way to
verify that the object is stack-allocated...

-Kenton

On Mon, Oct 12, 2020 at 4:35 PM Vitali Lovich <[email protected]> wrote:

> I'm seeing this assert trigger in exception.c++ when run on ASAN on our
> (admittedly old) Linux boxes:
>
>   KJ_ASSERT(offset < 65536 && offset > -65536,
>             "ExceptionCallback must be allocated on the stack.");
>
> The value of offset is 1048864. Is this code perhaps relying on some
> construct that's not reliable under ASAN? I would have expected ASAN to
> warn about that but it doesn't. Just the exception triggers.
>
> Unfortunately it's a bit hard to run this under a debugger or I would have
> delved far more on my own (& maybe disassemble things). Any insights would
> be appreciated.
>
> Thanks,
> Vitali
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" 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/capnproto/de1aaa9b-c798-467d-b1d2-11ac9ae42880n%40googlegroups.com
> <https://groups.google.com/d/msgid/capnproto/de1aaa9b-c798-467d-b1d2-11ac9ae42880n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" 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/capnproto/CAJouXQmPhru_3%2B7XL0ywaQ%2BUu0Ldkxx5dZxnjUFBWzWQKH955Q%40mail.gmail.com.

Reply via email to