[Bug gdb/27994] ASan crash when printing expression involving function call
simark at simark dot ca
sourceware-bugzilla@sourceware.org
Tue Jun 22 00:13:52 GMT 2021
https://sourceware.org/bugzilla/show_bug.cgi?id=27994
--- Comment #5 from Simon Marchi <simark at simark dot ca> ---
(In reply to Andrew Burgess from comment #2)
> Created attachment 13509 [details]
> Possible fix.
>
> Here's a possible fix. Following on from my previous comment, in the "old"
> world, the leading '0x4' which I thought was where the `this' pointer was
> going to be placed is actually where we used to place the value representing
> the callee. In the new world we store this outside the arguments (vals)
> array.
>
> Thus, where we previous passed argvec[1] which became vals[1], this should
> have been vals[0] - as the 0 index is now the `this' pointer, not the callee.
>
> I have also added a trailing nullptr as required by typecmp.
>
> This certainly stops the Asan failure that was originally reported. I'm
> currently running the full test set to see if there are any problems thrown
> up.
>
> Any initial thoughts would be great.
What you said makes sense to me. I tried to debug it when I reported it, but I
didn't have much time and it was all a bit blurry. But what you said matches
what I remember. I didn't have time to compare the behavior after with the
behavior before, thanks for doing this.
I'd be tempted to make what we pass down a gdb::array_view, instead of a
NULL-terminated array, but I haven't actually tried it.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Gdb-prs
mailing list