Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Egalito UseDef analysis doesn't capture all writes to memory? #34

Open
lmFox opened this issue Sep 13, 2021 · 0 comments
Open

Egalito UseDef analysis doesn't capture all writes to memory? #34

lmFox opened this issue Sep 13, 2021 · 0 comments

Comments

@lmFox
Copy link

lmFox commented Sep 13, 2021

Hi there! Thank you for your work on Egalito.

I have noticed that in specific cases not all writes to memory seem to be captured by Egalito's UseDef analysis. When applying UseDef to a function like:

void foo(struct test *t, int n) {
  if (n < 5) {
    t->x = 10;  
  }
  else { 
    t->x = 12;
  }
}

both of the writes to t->x don't seem to occur in any of the states of the UDRegMemWorkingSet.

I have checked this with:

$ gcc --version
gcc (Debian 8.3.0-6) 8.3.0

$ clang --version
clang version 13.0.0

which generates assembly like:

0000000000001100 <foo>:
    1100:	55                   	push   %rbp
    1101:	48 89 e5             	mov    %rsp,%rbp
    1104:	48 89 7d f8          	mov    %rdi,-0x8(%rbp)
    1108:	89 75 f4             	mov    %esi,-0xc(%rbp)
    110b:	83 7d f4 05          	cmpl   $0x5,-0xc(%rbp)
    110f:	0f 8d 0f 00 00 00    	jge    1124 <foo+0x24>
    1115:	48 8b 45 f8          	mov    -0x8(%rbp),%rax
    1119:	c7 00 0a 00 00 00    	movl   $0xa,(%rax)
    111f:	e9 0a 00 00 00       	jmpq   112e <foo+0x2e>
    1124:	48 8b 45 f8          	mov    -0x8(%rbp),%rax
    1128:	c7 00 0c 00 00 00    	movl   $0xc,(%rax)
    112e:	5d                   	pop    %rbp
    112f:	c3                   	retq 

I hope to hear back from you. Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant