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

Fix dup af+ removing function from hts #16526

Merged
merged 2 commits into from
Apr 12, 2020
Merged

Fix dup af+ removing function from hts #16526

merged 2 commits into from
Apr 12, 2020

Conversation

thestr4ng3r
Copy link
Contributor

Detailed description

This fixes the following issue:

$ r2 /bin/ls
> af;.afi*
# cannot add basic block errors
> af;.afi*
# no errors at all
> af;.afi*
# cannot add basic block errors again

or more narrowed down:

[0x00000000]> af+ 0x1337 func
[0x00000000]> af+ 0x1337 func
Invalid function name 'func' at 0x00001337
Cannot add function (duplicated)
[0x00000000]> af+ 0x1337 func
[0x00000000]> af+ 0x1337 func
Invalid function name 'func' at 0x00001337
Cannot add function (duplicated)
[0x00000000]>

The expected behavior is that all subsequent af+ calls show the error.
This is however not only about error printing, in fact the duplicated af+ would remove the function from the address and name hashtables which is a problem.

Closing issues

#15453 (doesn't directly solve the project-related issue but I think we can close with r2db coming soon^TM)

@radare
Copy link
Collaborator

radare commented Apr 11, 2020

looks red. pls confirm if the referenced issue can be closed

@radare
Copy link
Collaborator

radare commented Apr 11, 2020

Screenshot 2020-04-11 at 20 15 37

IMAGE 2020-04-11 20:15:49

@radare radare added this to the 4.4.0 - pangolin milestone Apr 11, 2020
@thestr4ng3r
Copy link
Contributor Author

Yeah it slightly changes analysis behavior. But that is because before there were some "leaked" duplicate functions at the same address, so it is more correct now.

Well as I have written, the issue itself is about projects, which is not fixed by this. But since trying to fix current projects at this point would be a waste of time, I think we can close it.

Copy link
Collaborator

@radare radare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@radare radare merged commit 95fa7a3 into master Apr 12, 2020
@thestr4ng3r thestr4ng3r deleted the dupfcn branch April 12, 2020 09:02
Emi1305 pushed a commit to Emi1305/radare2 that referenced this pull request Jul 12, 2020
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

Successfully merging this pull request may close these issues.

2 participants