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

Specifying sources and sinks for saber #1612

Open
enochii opened this issue Dec 18, 2024 · 0 comments
Open

Specifying sources and sinks for saber #1612

enochii opened this issue Dec 18, 2024 · 0 comments

Comments

@enochii
Copy link
Contributor

enochii commented Dec 18, 2024

Hi, I am using saber to detect memory leaks. I notice that some programs may use operator new and operator delete to allocate and deallocate memory. It seems like currently saber does not support them (https://github.com/SVF-tools/SVF/blob/master/svf/lib/SABER/SaberCheckerAPI.cpp#L51).

Moreover, after compilation, the name mangling mechanism may modify the name of specific API. For instance, in my case, operator new and operator delete are replaced by _Znwm and _ZdlPv.

!56597 = !DISubprogram(name: "operator new", linkageName: "_Znwm", scope: !56598, file: !56598, line: 120, type: !56599, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !421)
...
!56601 = !DISubprogram(name: "operator delete", linkageName: "_ZdlPv", scope: !56598, file: !56598, line: 124, type: !4745, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !421)

A possible workaround is adding _Znwm and _ZdlPv to ei_pairs in https://github.com/SVF-tools/SVF/blob/master/svf/lib/SABER/SaberCheckerAPI.cpp#L51.

Is there any other way to sidestep this mechanism? I guess it would be convenient that saber can automatically transform these mangled names to the original ones to enable effective detection. Another suggestion is to use a specification file (e.g., x.json) to replace the hard-coded ei_pairs array.

@enochii enochii changed the title Identifying alloc and free sites for saber Specifying sources and sinks for saber Dec 18, 2024
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