Bug 380202 - Assertion failure for cache line size (vg_assert(cls == 64)) on aarch64
Summary: Assertion failure for cache line size (vg_assert(cls == 64)) on aarch64
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.13 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-25 19:35 UTC by Siddhesh Poyarekar
Modified: 2017-06-09 13:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Remove assertion that dcache line size is 64 bytes on aarch64 (516 bytes, patch)
2017-05-25 19:35 UTC, Siddhesh Poyarekar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Siddhesh Poyarekar 2017-05-25 19:35:51 UTC
Created attachment 105713 [details]
Remove assertion that dcache line size is 64 bytes on aarch64

We are seeing an assertion failure on an as yet unreleased aarch64 CPU because the dcache line size on the processor is 128 bytes.  The assertion in coregrind/m_libcproc.c that cache line size is always 64 bytes for aarch64 is not valid and should be dropped.  Attached patch does this.
Comment 1 Julian Seward 2017-05-30 13:15:27 UTC
I don't want to remove the assertion entirely.  Can you try with 
instead

  vg_assert(cls == 64 || cls == 128)

and see if that works?  With that in place, can you at least run the
instruction set tests

   perl tests/vg_regtest none/tests/arm64     and
   perl tests/vg_regtest none/tests/arm

without failing?
Comment 2 Siddhesh Poyarekar 2017-05-30 17:17:04 UTC
(In reply to Julian Seward from comment #1)
> I don't want to remove the assertion entirely.  Can you try with 
> instead
> 
>   vg_assert(cls == 64 || cls == 128)

That should work, but the trouble is that you'll have to keep patching the assert every time there is a different cache configuration.  I don't think the overhead is worth it, but it's your call in the end :)

> and see if that works?  With that in place, can you at least run the
> instruction set tests
> 
>    perl tests/vg_regtest none/tests/arm64     and
>    perl tests/vg_regtest none/tests/arm
> 
> without failing?

OK, I'll do this and get back to you.
Comment 3 Julian Seward 2017-06-06 08:40:55 UTC
(In reply to Siddhesh Poyarekar from comment #2)

Siddesh, we are trying to finalise the 3.13 release, which is very
close.  If it is easy and low risk, I would like to take this change,
so that Valgrind works on the new core you mention.  But I need
you to verify that it is OK first.  Can you do that?

Also, can you tell us what core this is for, now?
Comment 4 Siddhesh Poyarekar 2017-06-06 08:51:14 UTC
(In reply to Julian Seward from comment #3)
> Siddesh, we are trying to finalise the 3.13 release, which is very
> close.  If it is easy and low risk, I would like to take this change,
> so that Valgrind works on the new core you mention.  But I need
> you to verify that it is OK first.  Can you do that?

The fix works OK, thank you!
Comment 5 Julian Seward 2017-06-09 13:14:20 UTC
Fixed, r16438 (trunk).