Bug #7670
closed
Instrumentation of memory allocation functions from driver code should correctly pass size of memory
Added by Vadim Mutilin about 8 years ago.
Updated over 6 years ago.
Category:
Requirement specifications
Description
Now function allocations with known size like kmalloc are replaced with ldv_malloc_unknown_size.
Thus size parameter is lost.
See for example aspect
around: ALLOC_KNOWN_SIZE
{
void *res;
ldv_check_alloc_flags(flags);
res = ldv_malloc_unknown_size();
ldv_after_alloc(res);
return res;
}
In correct case ldv_malloc(size) should be called.
- Description updated (diff)
- Description updated (diff)
- Assignee set to Evgeny Novikov
I also noticed this issue and I hope that I will be able to fix it together with fixes and improvements in other rule specifications.
- Priority changed from Urgent to High
Let's fix and improve specifications after we will have good tests and a testing infrastructure (version:0.3) and likely after we will complete a considerable refactoring of Core (1.0).
- Assignee changed from Evgeny Novikov to Anton Vasilyev
- Priority changed from High to Urgent
- Target version set to 1.0
It seems that we lose dozens of bugs and hundreds of false alarms due to this issue. Since its fix is trivial, we can include into Klever 1.0.
- Related to Feature #7971: Rule specification generic:memory lacks test cases added
- Status changed from New to Resolved
- Assignee changed from Anton Vasilyev to Evgeny Novikov
- % Done changed from 0 to 100
Rebase on master is done in branch fix_alloc_known_size_rebase 92d9f523f ready to merge
- Assignee changed from Evgeny Novikov to Anton Vasilyev
Tested with generic:memory
I fixed it a bit in the same branch, updated preset marks and scheduled a comprehensive testing. If it will pass, I will merge the branch to master.
I had to update the branch one more time and started one more iteration of testing, since tests identified differences in associated marks. Indeed, this happens first of all because of we still have very bad aspects for some rule specifications causing auxiliary functions ending with \d+ in error trace patterns (of course any slight change in instrumentation can result in changes in error trace patterns). Other cases can be expected because of there were calls to kmalloc in test drivers and in corresponding error trace patterns. Now there are calls to ldv_kmalloc.
- Status changed from Resolved to Closed
Tests passed, so I merged the branch to master in a354b4c6.
Besides, there isn't any feature requests for Klever 1.0. So, that commit is tagged with 1.0rc1! From now until release just bug fixes can find their way to master.
Also available in: Atom
PDF