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

Possible callgraph analysis bug, calls to function pointers not among callgraph_edges #16

Open
ringzer0x00 opened this issue Nov 25, 2021 · 3 comments

Comments

@ringzer0x00
Copy link
Contributor

Hello,
I have been using cclyzer to perform callgraph and points-to analyses and I cannot see calls to function pointers among the callgraph edges from main() with both context-insensitive and context-sensitive analyses, while with direct calls they have no issues while being resolved.

The points-to analysis to me seems to be performed correctly, just the call to function pointers are not correctly classified as edges in the callgraph. Indirect calls to plt (like printf) are correctly resolved.

I attach the source I have used for testing.

void cane() {
	puts("cane");
}

void gatto() {
	puts("gatto");
}


int main() {

	void (*one)();
	void (*two)();

	one = &cane;
	two = &gatto;

	(*one)();
	(*two)();

	return 0;
}

From the logic implemented in the callgraph construction it seems like this could be a bug. All of the output csv regarding the contruction of the call graph (callgraph_*.csv) are empty on this one. If I use some other function inside the main they do appear, but no calls to function pointers whatsoever.

Thank you in advance.

@ktrianta
Copy link
Collaborator

Thank you for reporting this!

I am polishing a bug fix which I think will also fix this issue, so I am looking into this.

@ringzer0x00
Copy link
Contributor Author

Good morning @ktrianta, any update on this? If anything, is there a release version you are confident to be working when analyzing calls to function pointers?

Thank you.

@ktrianta
Copy link
Collaborator

ktrianta commented Dec 8, 2021

@ringzer0x00 I have pushed a fix!
Please report any related issue you encounter here. Thank you!

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

2 participants