Project

General

Profile

Actions

Bug #754

open

Rerouting does not work for static functions

Added by Vadim Mutilin over 13 years ago. Updated over 11 years ago.

Status:
Open
Priority:
Normal
Category:
BLAST
Start date:
01/31/2011
Due date:
% Done:

0%

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

Description

When template function is defined with static modifier
like:

static int mutex_is_locked_TEMPLATE(struct mutex *lock)
{

then rerouting to it does not work, function body is undefined (the definition and the use in the same file).
res_misc_open_0 = misc_open(var_misc_open_0_p0 /* inode */, var_misc_open_0_p1 /* file */);
{
   tmp = mutex_is_locked_i_mutex(&(i_mutex)) { /* The function body is undefined. */ };
   is_locked = tmp;
   assert(is_locked != 0);
   mutex_unlock_i_mutex(&(i_mutex) /* lock */);
   {
     assert(ldv_mutex_i_mutex != 2);
     __blast_assert();
   }
}

See tests-model-32_7--test-mutexislocked.tar.bz2 from small tests and kernel-rules/files/model0032-double.c.

For the bug #635 I removed static modifier.


Related issues 1 (0 open1 closed)

Related to C Instrumentation Framework - Feature #2462: We should develop "rerouter" functionality inside CIFClosedEvgeny Novikov02/20/2012

Actions
Actions #1

Updated by Evgeny Novikov over 11 years ago

  • Status changed from New to Open
  • Assignee changed from Pavel Shved to Evgeny Novikov

I investigated the problem and found out some strangenesses. First of all mutex_is_locked function is static inline for all configurations for all Linux kernels we have tested with. Now in 32_7 plain rerouting model there is such the model for mutex_is_locked function:

int mutex_is_locked_TEMPLATE(struct mutex *lock)
{ 
...
}

And it's successfully applied! For instance, see unsafe for specially broken driver tests-model-32_7--test-mutexislocked.tar.bz2 here for example.

So, the issue looks to be resolved but the behavior of plain rerouter is strange... Why we had to hack Rule Instrumentor for 39_7 model if plain rerouter ignores static and inline?..

Actions

Also available in: Atom PDF