RFR(S): 8219650: [Testbug] Fix potential crashes in new test hotspot gtest "test_print_hex_dump"
Thomas Stüfe
thomas.stuefe at gmail.com
Thu Feb 28 18:21:21 UTC 2019
On Thu, Feb 28, 2019 at 4:59 PM Aleksey Shipilev <shade at redhat.com> wrote:
> On 2/28/19 4:21 PM, Thomas Stüfe wrote:
> > Took this over from Christoph since he is busy with other stuff.
> >
> >
> http://cr.openjdk.java.net/~stuefe/webrevs/8219650-shade-print-hex/webrev.00/webrev/
>
> Looks okay.
>
thanks!
>
> Do we really need to change stack alloc to malloc now, though? For any
> char*, either the char*
> itself, or (char*) + 1 would be misaligned for any unit size greater than
> 1.
>
>
Yeah.. thats maybe me being a bit anal. I like having a confirmed aligned
case first.
Unless it really irks you, lets keep it that way. We all spent way too much
time on this thing, and while it is a really fascinating topic... :)
> Note that the reason is_readable_pointer() did not catch the SIGBUS was
> that is_readable_pointer()
> > does a SafeFetch32 on the address; so, it just requires 32bit alignment.
> In the crash case, we had
> > 32bit aligned pointer and tried to load a 64bit valute (unitsize=8).
>
> Dang. That's a problem for is_readable_pointer, is it not? It should be
> doing native-width access?
>
I think is_readable_pointer makes no promises about the alignment, just
that if you access that location it you wont access unmapped memory.
Otherwise, what would be the right way? is_readable_pointer() cannot know
what I plan to do with the pointer. I might plan to load a single byte from
it.
..Thomas
> -Aleksey
>
>
More information about the hotspot-dev
mailing list