DynamoRIO / DynamoRIO/drmemory

persisted saved-bb table has fewer entries than persisted coarse unit

Open
#869 1 comment 0 reactions 0 assignees View on GitHub
Bug-Assert Migrated Priority-Medium
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on April 18, 2012 17:22:24_

ASSERT missing bb info on translation

after fixing issue #868, hitting assert while translating:
ASSERT(save != NULL, "missing bb info");
for 0x77ae8c81 == ntdll!RtlEnterCriticalSection+0x39
it is for ud2a:
0:005> U 0x0260faac
+0x25afaab:
0260faac 0f0b ud2

it seems to fire consistently for tag 0x77ae8c81

which is in the coarse unit for ntdll:
0:012> ?? ((dynamorio!coarse_table_t_)0x221e371c)->table[((0x77ae8c81 \* 2654435769) >> (32 - ((dynamorio!coarse_table_t_)0x221e371c)->hash_bits)) & ((dynamorio!coarse_table_t*)0x221e371c)->hash_mask]
struct _app_to_cache_t
+0x000 app : 0x77ae8c81 "???"
+0x004 cache : 0x0005aa87 ""

sanity checks:

0:012> U 0x025a5000+5aa87 L10
+0x259fa86:
025ffa87 648915c80e0000 mov fs:[00000ec8],edx
025ffa8e 64890dc40e0000 mov fs:[00000ec4],ecx
025ffa95 8d4f14 lea ecx,[edi+0x14]
025ffa98 8bd1 mov edx,ecx
025ffa9a c1ea10 shr edx,0x10
025ffa9d c1e902 shr ecx,0x2
025ffaa0 030c954061b973 add ecx,[drmemorylib!shadow_table (73b96140)+edx*4]
025ffaa7 803901 cmp byte ptr [ecx],0x1
025ffaaa 7502 jnz +0x259faad (025ffaae)
025ffaac 0f0b ud2
025ffaae 8b4714 mov eax,[edi+0x14]
025ffab1 a900000004 test eax,0x4000000
025ffab6 648b0dc40e0000 mov ecx,fs:[00000ec4]
025ffabd 648b15c80e0000 mov edx,fs:[00000ec8]
025ffac4 0f85e6080000 jne +0x25a03af (026003b0)
025ffaca e931f6ffff jmp +0x259f0ff (025ff100)

0:012> U 77ae8c81
ntdll!RtlEnterCriticalSection+0x39:
77ae8c81 8b4714 mov eax,[edi+0x14]
77ae8c84 a900000004 test eax,0x4000000
77ae8c89 0f8534160200 jne ntdll!RtlEnterCriticalSection+0x43 (77b0a2c3)

so the question is, why isn't this tag in the persisted bb table too?
% grep 'resurrecting bb 0x77ae8c' /c/users/bruening/AppData/LocalLow/drmemory/D_/g_
resurrecting bb 0x77ae8c3b
resurrecting bb 0x77ae8c4f
resurrecting bb 0x77ae8c58

0x19fe entries in ntdll bb_saved table that were persisted, and 0x1ab2
entries in persisted entry hashtable (0x879 in th_htable==stubs): shouldn't they be equal? need to investigate

_Original issue: http://code.google.com/p/drmemory/issues/detail?id=869_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.