Bug 384261

Summary: Assert failure on helgrind with the SIDT instruction
Product: [Developer tools] valgrind Reporter: Andrea Mazzoleni <amadvance>
Component: helgrindAssignee: Julian Seward <jseward>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.13.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Andrea Mazzoleni 2017-09-01 13:22:21 UTC
A program that uses threading and the SIDT instruction makes helgrind to fail with the assertion failure:

Helgrind: hg_main.c:4478 (instrument_mem_access): Assertion 'szB > 8 && szB <= 512' failed.

In my understanding this happens because instrument_mem_access() expects memory accesses of size 1,2,4 and >=8 bytes, but not of 6 bytes, like the SIDT instruction is doing.

Just changing the assert in hg_main.c to allow szB==6 makes helgrind to work.

I'm using valgrind 13.0 compiled from source in a Ubuntu 14.04 x64 system running a 32 bit program.