Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Urgent
Category:
Requirement 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 2 (1 open1 closed)

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

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

Actions
Actions #1

Updated by Vadim Mutilin about 8 years ago

  • Description updated (diff)
Actions #2

Updated by Vadim Mutilin about 8 years ago

  • Description updated (diff)
Actions #3

Updated by Evgeny Novikov almost 8 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.

Actions #4

Updated by Evgeny Novikov over 7 years 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).

Actions #5

Updated by Evgeny Novikov over 6 years ago

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

Actions #6

Updated by Evgeny Novikov over 6 years ago

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

Updated by Anton Vasilyev over 6 years ago

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

Fixed on branch fix_alloc_known_size, 68b24c59214

Actions #8

Updated by Anton Vasilyev over 6 years ago

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

Actions #9

Updated by Anton Vasilyev over 6 years ago

  • Assignee changed from Evgeny Novikov to Anton Vasilyev

Tested with generic:memory

Actions #10

Updated by Evgeny Novikov over 6 years 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.

Actions #11

Updated by Evgeny Novikov over 6 years 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.

Actions #12

Updated by Evgeny Novikov over 6 years 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.

Actions

Also available in: Atom PDF