Project

General

Profile

Bug #7670

Instrumentation of memory allocation functions from driver code should correctly pass size of memory

Added by Vadim Mutilin over 2 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Urgent
Category:
Rule specifications
Target version:
Start date:
11/01/2016
Due date:
% Done:

100%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

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.


Related issues

Related to Klever - Feature #7481: Try to use memory allocating function models by defaultNew08/17/2016

Actions
Related to Klever - Feature #7971: Rule specification generic:memory lacks test casesClosed02/13/2017

Actions

History

#1

Updated by Vadim Mutilin over 2 years ago

  • Description updated (diff)
#2

Updated by Vadim Mutilin over 2 years ago

  • Description updated (diff)
#3

Updated by Evgeny Novikov over 2 years ago

  • 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.

#4

Updated by Evgeny Novikov over 1 year ago

  • 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).

#5

Updated by Evgeny Novikov 10 months ago

  • Target version set to 1.0
  • Priority changed from High to Urgent
  • Assignee changed from Evgeny Novikov to Anton Vasilyev

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.

#6

Updated by Evgeny Novikov 10 months ago

  • Related to Feature #7971: Rule specification generic:memory lacks test cases added
#7

Updated by Anton Vasilyev 10 months ago

  • % Done changed from 0 to 100
  • Assignee changed from Anton Vasilyev to Evgeny Novikov
  • Status changed from New to Resolved

Fixed on branch fix_alloc_known_size, 68b24c59214

#8

Updated by Anton Vasilyev 10 months ago

Rebase on master is done in branch fix_alloc_known_size_rebase 92d9f523f ready to merge

#9

Updated by Anton Vasilyev 10 months ago

  • Assignee changed from Evgeny Novikov to Anton Vasilyev

Tested with generic:memory

#10

Updated by Evgeny Novikov 10 months ago

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.

#11

Updated by Evgeny Novikov 10 months ago

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.

#12

Updated by Evgeny Novikov 10 months ago

  • 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